Examples of Fleet


Examples of net.coljac.pirates.Fleet

      addToFleet.setEnabled(false);
    }
    addToFleet.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Crew c = cards.get(model.getLastClickedRow());
        Fleet f = fleetsPanel.getCurrentFleet();
        if (f != null) {
          f.addCrew(c);
          fleetsPanel.fleetChanged();
          statusBar.setText(c.getName() + " added to fleet.");
        }
      }
    });
View Full Code Here

Examples of net.coljac.pirates.Fleet


    l = HibernateUtil.createQuery("from Card as card").list();
    assertEquals(2, l.size());

    Fleet fleet = new Fleet();
    fleet.setName("BOB");
    fleet.addShip(ship);
    fleet.addCrew(crew);
    fleet.addCrewToShip(ship,crew);
    HibernateUtil.save(fleet);
    HibernateUtil.commit();

    Ship ship2 = new Ship();
    ship2.setName("SHIP 2");
    ship2.setPoints(2);
    HibernateUtil.save(ship2);
    fleet.addShip(ship2);
    HibernateUtil.currentSession().update(fleet);
    HibernateUtil.commit();


    l = HibernateUtil.createQuery("from Fleet as fleet").list();
    assertEquals(1, l.size());
    Fleet f2 = (Fleet)l.get(0);
    assertEquals(f2.getShips().get(0).getName(), "SHIP");


  }
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.