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();	
	}
Exemple #2
0
 public void endTurn() {
   dock.closeDock();
 }
Exemple #3
0
 public void startTurn() {
   dock.openDock();
   requestMove();
 }