Package org.scotlandyard.engine.boardmap

Examples of org.scotlandyard.engine.boardmap.Coordinate


                {mrx,null}
               };
    for(int i=0;i<objects.length;i++){
      try{
        final Player player     = (Player)    objects[i][0];
        final Coordinate coor = (Coordinateobjects[i][1];

        game.setPlayerPosition(new PlayerPositionImpl(game, player, coor)); // this must throw an exception
        counter--;// should not reach here
      }catch(GameException ex){
        counter++;
View Full Code Here


  @Test//TODO add description here
  public final void testSetPosition() throws GameException {
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("1", creator, boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap, 1.1, 2.2);
    detective.setPosition(game, coor);
    Assert.assertEquals(coor, detective.getPosition(game));
  }
View Full Code Here

  @Test//TODO add description here
  public final void testGetPosition() throws GameException {
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("2", creator, boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap, 3.3, 4.4);
    detective.setPosition(game, coor);
    Assert.assertEquals(detective.getPosition(game), coor);
  }
View Full Code Here

  @Test//TODO add description here
  public final void testMethods() throws GameException {
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("2", creator, boardMap);
    final Game game2 = GameImpl.getNewInstance("3", creator, boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap, 1.1, 2.2);
    final Coordinate coor1 = new CoordinateImpl(boardMap, 1.6, 2.6);
    //Token token = new TokenImpl(detective, TransportationMethod.BUS);
    final Link route = new LinkImpl(boardMap, TransportationMethod.BUS, coor, coor1);
    //token.setNumberOfTickets(10);

    detective.setTokens(game, TransportationMethod.BUS, 10);
View Full Code Here

  @Test
  public final void testSetPosition() throws GameException{
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("1",creator,boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap, 1.1,2.2);
    mrX.setPosition(game, coor);
    Assert.assertEquals(coor, mrX.getPosition(game));
  }
View Full Code Here

  @Test//TODO add description here
  public final void testGetPosition()throws GameException{
    boardMap = BoardMapImpl.getNewInstance(MAPNAME);
    game = GameImpl.getNewInstance("2",creator,boardMap);
    final Coordinate coor = new CoordinateImpl(boardMap,3.3,4.4);
    mrX.setPosition(game, coor);
    Assert.assertEquals(mrX.getPosition(game), coor);

  }
View Full Code Here

  }

  @Test//TODO add description here
  public void testCreateCoordinate() throws GameException{
   
    final Coordinate coordinate = BoardMapFactory.createCoordinate(1, 2);
    assertNotNull(
        "the coordinate map should not be null",
        coordinate.getBoardMap()
        );
  }
View Full Code Here

  }

  @Test//TODO add description here
  public void testCreateLinkBoardMapTransportationMethodDoubleDoubleDoubleDouble() throws GameException{
    final Link link =BoardMapFactory.createLink(TransportationMethod.UG, 0, 1, 2, 3);
    final Coordinate coordinateA  = link.getCoordinateA();
    final Coordinate coordinateB  = link.getCoordinateB();
    assertNotNull(
        "the link map should not be null",
        link.getBoardMap()
        );
    assertNotNull(
        "the coordinate map should not be null",
        coordinateA.getBoardMap()
        );
    assertNotNull(
        "the coordinate map should not be null",
        coordinateB.getBoardMap()
        );
    assertEquals(
        "the coordinate A latitude should be [0]",
        0,
        coordinateA.getLatitude(),
        0
        );
    assertEquals(
        "the coordinate B longtitude should be [3]",
        3,
        coordinateB.getLongtitude(),
        0
        );
  }
View Full Code Here

        );
  }

  @Test//TODO add description here
  public void testCreateLinkTransportationMethodCoordinateCoordinate() throws GameException{
    final Coordinate cA  = BoardMapFactory.createCoordinate(0,1);
    final Coordinate cB  = BoardMapFactory.createCoordinate(2,3);
    final Link link =BoardMapFactory.createLink(TransportationMethod.UG, cA, cB);
    final Coordinate coordinateA  = link.getCoordinateA();
    final Coordinate coordinateB  = link.getCoordinateB();
    assertNotNull(
        "the link map should not be null",
        link.getBoardMap()
        );
    assertNotNull(
        "the coordinate map should not be null",
        coordinateA.getBoardMap()
        );
    assertNotNull(
        "the coordinate map should not be null",
        coordinateB.getBoardMap()
        );
    assertEquals(
        "the coordinate A latitude should be [0]",
        0,
        coordinateA.getLatitude(),
        0
        );
    assertEquals(
        "the coordinate B longtitude should be [3]",
        3,
        coordinateB.getLongtitude(),
        0
        );
    assertSame(
        "coordinate B == coB",
        cB,
View Full Code Here

TOP

Related Classes of org.scotlandyard.engine.boardmap.Coordinate

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.