Package nz.ac.massey.softwarec.group3.game

Examples of nz.ac.massey.softwarec.group3.game.Player


    @Test
    public void testPerformAction() {
        System.out.println("performAction");
       
     
       Player  player=new Player(5,5,5,false);
       Game game=new Game("username",001);
       Action action=new Action(player,"action","value",game,session);
       
        ActionPerformerInterface instance = new ActionPerformerInterfaceImpl();
        instance.performAction(action);
View Full Code Here


    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

TOP

Related Classes of nz.ac.massey.softwarec.group3.game.Player

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.