Package es.mahulo.battleship.model

Examples of es.mahulo.battleship.model.Shot


  public void shotTest() {
   
    Client c = Client.create();
    WebResource r = c.resource("http://localhost:8080/BattleShip/rest/game/shot/1802");
   
    Shot shot = new Shot();
    shot.setX(1);
    shot.setY(1);
   
    r.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, shot);

  }     
View Full Code Here


  @Test public void shot1Test() {
   
    Client c = Client.create();
    WebResource r = c.resource("http://localhost:8080/BattleShip/rest/game/shot/2251");
   
    Shot shot = new Shot();
    shot.setX(1);
    shot.setY(1);
   
    r.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).post(ClientResponse.class, shot);

  }     
View Full Code Here

    game = gameServer.joinPlayer(game.getId(), "maeve");

    gameServer.addShip(1L,"manuel", ships1);
    gameServer.addShip(1L,"maeve", ships2);
   
    Shot shot = new Shot();
    shot.setX(1);
    shot.setY(1);
   
    Boolean hit = gameServer.shot(1L,"maeve", shot);
   
    Assert.assertTrue(hit);
  }
View Full Code Here

    game = gameServer.joinPlayer(game.getId(), "maeve");

    gameServer.addShip(1L,"manuel", ships1);
    gameServer.addShip(1L,"maeve", ships2);
   
    Shot shot = new Shot();
    shot.setX(3);
    shot.setY(3);
   
    Boolean hit = gameServer.shot(1L,"maeve", shot);
   
    Assert.assertFalse(hit);
  }
View Full Code Here

   
    return ship;
  }
 
  private void shotShip1(GameServiceImpl gameServer,int [][] positions) throws Exception {
    Shot shot2 = new Shot();
    shot2.setX(3);
    shot2.setY(3);

   
    for (int i=0; i< positions.length ;i++) {
      Shot shot1 = new Shot();
     
      shot1.setX(positions[i][0]);
      shot1.setY(positions[i][1]);
     
      gameServer.shot(1L,"maeve", shot1);
      gameServer.shot(1L,"manuel", shot2);
    }
  }
View Full Code Here

      gameServer.shot(1L,"manuel", shot2);
    }
  }
 
  private void shotShip2(GameServiceImpl gameServer,int [][] positions) throws Exception {
    Shot shot1 = new Shot();
    shot1.setX(3);
    shot1.setY(3);

   
    for (int i=0; i< positions.length ;i++) {
      Shot shot2 = new Shot();
     
      shot2.setX(positions[i][0]);
      shot2.setY(positions[i][1]);
     
      gameServer.shot(1L,"maeve", shot1);
      gameServer.shot(1L,"manuel", shot2);
    }
  }
View Full Code Here

 
  private void shotShipDraw(GameServiceImpl gameServer,int [][] positions) throws Exception {

   
    for (int i=0; i< positions.length ;i++) {
      Shot shot1 = new Shot();
     
      shot1.setX(positions[i][0]);
      shot1.setY(positions[i][1]);
     
      Shot shot2 = new Shot();
     
      shot2.setX(positions[i][0]);
      shot2.setY(positions[i][1]);

     
      gameServer.shot(1L,"maeve", shot1);
      gameServer.shot(1L,"manuel", shot2);
    }
View Full Code Here

TOP

Related Classes of es.mahulo.battleship.model.Shot

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.