public static void main(String[] args) { //Creating abstract factory, //then creating two factories with it, //and then creating four ships with this factories AbstractFactory abstract_factory = new AbstractFactory();\ Dock trade = abstract_factory.create_dock("TradeShipDock"); Dock battle = abstract_factory.create_dock("BattleShipDock"); Ship cleeper = trade.create_ship("Cleeper"); Ship cutter = trade.create_ship("Cutter"); Ship fregate = battle.create_ship("Fregate"); Ship galeon = battle.create_ship("Galeon"); cleeper.act(); cutter.act(); fregate.act(); galeon.act(); }
public void endTurn() { dock.closeDock(); }
public void startTurn() { dock.openDock(); requestMove(); }