Examples of Ship


Examples of es.mahulo.battleship.model.Ship

    Cell cell1 = new Cell();
    cell1.setX(9);
    cell1.setY(1);
    cells.add(cell1);
   
    Ship playerShip = new Ship();
    playerShip.setShipConfig(shipConfigs.get(4));
    playerShip.setCells(cells);
   
    List<Ship> ships = new ArrayList<Ship>();
    ships.add(playerShip);
   
    Player player = new Player();
    player.setId(1L);
    player.setShips(ships);
   
   
    cells = new ArrayList<Cell>();
    Cell cell2 = new Cell();
    cell1.setX(10);
    cell1.setY(2);
    cells.add(cell2);
   
    Ship ship = new Ship();
   
    configService.isValid(game, player,ship);
  }
View Full Code Here

Examples of es.mahulo.battleship.model.Ship

   
    Player player = new Player();
    player.setId(1L);
    player.setShips(playerShips);
   
    Ship ship = buildShip(shipConfigs.get(4),cellShip7);
   
    configService.isValid(game, player,ship);
  }
View Full Code Here

Examples of es.mahulo.battleship.model.Ship

      cell.setY(positions[i][1]);
      cells.add(cell);
     
    }
    
    Ship ship = new Ship();
   
    ship.setShipConfig(shipConfig);
    ship.setCells(cells);

   
    return ship;
  }
View Full Code Here

Examples of es.mahulo.battleship.model.Ship

      cell.setY(positions[i][1]);
      cells.add(cell);
     
    }
    
    Ship ship = new Ship();
   
    ship.setShipConfig(shipConfig);
    ship.setCells(cells);

   
    return ship;
  }
View Full Code Here

Examples of net.cis.common.model.structure.Ship

   */
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
      IAdaptable info) throws ExecutionException {
    Slot newElement = StructureFactory.eINSTANCE.createSlot();

    Ship owner = (Ship) getElementToEdit();
    owner.getSlots().add(newElement);

    doConfigure(newElement, monitor, info);

    ((CreateElementRequest) getRequest()).setNewElement(newElement);
    return CommandResult.newOKCommandResult(newElement);
View Full Code Here

Examples of net.cis.common.model.structure.Ship

  /**
   * @generated
   */
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
      IAdaptable info) throws ExecutionException {
    Ship newElement = StructureFactory.eINSTANCE.createShip();

    Modeler owner = (Modeler) getElementToEdit();
    owner.getShips().add(newElement);

    doConfigure(newElement, monitor, info);
View Full Code Here

Examples of net.cis.common.model.structure.Ship

      return Collections.emptyList();
    }
    Modeler modelElement = (Modeler) view.getElement();
    LinkedList<CismodelNodeDescriptor> result = new LinkedList<CismodelNodeDescriptor>();
    for (Iterator<?> it = modelElement.getShips().iterator(); it.hasNext();) {
      Ship childElement = (Ship) it.next();
      int visualID = CismodelVisualIDRegistry.getNodeVisualID(view,
          childElement);
      if (visualID == ShipEditPart.VISUAL_ID) {
        result.add(new CismodelNodeDescriptor(childElement, visualID));
        continue;
View Full Code Here

Examples of net.cis.common.model.structure.Ship

  public static List<CismodelNodeDescriptor> getShip_2001SemanticChildren(
      View view) {
    if (!view.isSetElement()) {
      return Collections.emptyList();
    }
    Ship modelElement = (Ship) view.getElement();
    LinkedList<CismodelNodeDescriptor> result = new LinkedList<CismodelNodeDescriptor>();
    for (Iterator<?> it = modelElement.getSlots().iterator(); it.hasNext();) {
      Slot childElement = (Slot) it.next();
      int visualID = CismodelVisualIDRegistry.getNodeVisualID(view,
          childElement);
      if (visualID == SlotEditPart.VISUAL_ID) {
        result.add(new CismodelNodeDescriptor(childElement, visualID));
View Full Code Here

Examples of net.coljac.pirates.Ship

      while(number.length()<3) {
        number = "0" + number;
      }
      List<Card> ships = db.getCardsByName(name);
      if (ships.size() == 1) {
        Ship theShip = (Ship)ships.get(0);
        theShip.setOwned(owned);
        theShip.setWanted(wanted);
      } else if (ships.size() == 0) {
        System.out.println("Can't find ship " + name);
      } else {
        List numbered = new ArrayList<Ship>();
        for(Card c: ships) {
          if(c.getNumber().equals(number)) {
            numbered.add((Ship)c);
          }
        }
        if(numbered.size()==1) {
          Ship theShip = (Ship)numbered.get(0);
          theShip.setOwned(owned);
          theShip.setWanted(wanted);
          db.save();
        } else {
          System.out.println("Too many ships: " + name + "  " + numbered.size());
        }
      }
View Full Code Here

Examples of net.coljac.pirates.Ship

      WebLink link = links[i];
      if (link.getText().indexOf("Ship") > 0) {
        int start = link.getURLString().indexOf("unitid=") + 7;
        int end = link.getURLString().indexOf("'", start);
        String id = link.getURLString().substring(start, end);
        Ship ship = getShip(id);
        MakeDB.db.getShips().add(ship);
        MakeDB.db.getCards().add(ship);

        if (pw != null) {
          pw.println(ship.toCSV());
        }
        ships++;
      }
    }
//    HibernateUtil.commit();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.