Package nz.ac.massey.softwarec.group3.actions

Examples of nz.ac.massey.softwarec.group3.actions.Action


    protected void processRequest(final HttpServletRequest request, final HttpServletResponse response)
            throws ServletException, IOException {
        final HttpSession session = request.getSession();
        final String email = (String) session.getAttribute("email");
        final Game game = (Game) session.getAttribute("game");
        Player player = null;
        if (game != null) {
            player = game.getPlayer(email);
        }
        final String actionType = (String) request.getParameter("action");
        final String value = (String) request.getParameter("value");
View Full Code Here


   
    @Before
    public void setUp() {
       
        player=new Player(4,4,4,false);
        game=new Game("username",001);
        action=new Action(player,"BAH","value",game,session);
    }
View Full Code Here

    public void setUp() {
       testing = new Game("group3scotlandyard@gmail.com", 1);
       players = new ArrayList<Player>();
       playing = false;
       mapXMLtest = "<?xml version='1.0' encoding='UTF-8'?> <map><intersections></intersections></map>";
       map = new Map(mapXMLtest);
       mrXMoves = new ArrayList<Move>();
       mapDevelopment = new MapDeveloper();
       mapNodes = mapDevelopment.developMap(mapXMLtest);
       mapJSONtest = map.createJSONString(mapNodes);
       mapst1 = new MapStation(0, 1.0, 1.0);
View Full Code Here

     */
    @Test
    public void testGetMap() {
        System.out.println("getMap & setMap");
        testing.setMap(map);
        Map expResult = map;
        Map result = testing.getMap();
        assertEquals(expResult, result);
    }
View Full Code Here

            game.setPlaying(true);
            game.startGame();
        }
        if ("setmap".equals(actionType)) {
            game = SessionListener.getSessionTracker().getGameTracker().createNewGame((String) session.getAttribute("email"));
            game.setMap(new Map(value));
            session.setAttribute("game", game);
        }
        if ("setmapname".equals(actionType)) {
            game.getMap().setMapName(value);
        }
View Full Code Here

       players = new ArrayList<Player>();
       playing = false;
       mapXMLtest = "<?xml version='1.0' encoding='UTF-8'?> <map><intersections></intersections></map>";
       map = new Map(mapXMLtest);
       mrXMoves = new ArrayList<Move>();
       mapDevelopment = new MapDeveloper();
       mapNodes = mapDevelopment.developMap(mapXMLtest);
       mapJSONtest = map.createJSONString(mapNodes);
       mapst1 = new MapStation(0, 1.0, 1.0);
       mapst2 = new MapStation(1, 2.0, 2.0);
       mapst3 = new MapStation(2, 3.0, 3.0);
View Full Code Here

    public void setUp() {
        player = new Player(1,2,3,true); //player in this case is Mr X.
        taxiTokens = 0;
        busTokens = 1;
        undergroundTokens = 2;
        currentLocation = new MapStation(1, 1.0, 1.0);
        ready = false;
    }
View Full Code Here

     */
    @Test
    public void getCurrentLocation() {
        System.out.println("getCurrentLocation & setCurrentLocation");
        player.setCurrentLocation(currentLocation);
        MapStation result = player.getCurrentLocation();
        assertEquals(currentLocation, result);
       
    }
View Full Code Here

       map = new Map(mapXMLtest);
       mrXMoves = new ArrayList<Move>();
       mapDevelopment = new MapDeveloper();
       mapNodes = mapDevelopment.developMap(mapXMLtest);
       mapJSONtest = map.createJSONString(mapNodes);
       mapst1 = new MapStation(0, 1.0, 1.0);
       mapst2 = new MapStation(1, 2.0, 2.0);
       mapst3 = new MapStation(2, 3.0, 3.0);
       mapst4 = new MapStation(1, 4.0, 4.0);
      
    }
View Full Code Here

     * @throws SAXException
     * @throws IOException
     */
    public void playerTakesTurn(final String value) throws ParserConfigurationException, SAXException, IOException{
        final Move move = createMove(value);
        final MapStation mapNode = map.getMapStation(move.getDestinationNode());
        if (!mrXLose(move)) {
            if ("TAXI".equals(move.getTicketType())) {
                players.get(whosTurn).useTaxiToken();
                players.get(whosTurn).setCurrentLocation(mapNode);
                if (!players.get(whosTurn).isMrX()) {
View Full Code Here

TOP

Related Classes of nz.ac.massey.softwarec.group3.actions.Action

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.