Пример #1
0
  public UnitImpl produceUnit() {
    hasProduced += 1;
    treasury -= productionCost;

    return unitProductionStrategy.produceUnit(ownedBy);
  }
Пример #2
0
 public void setProduction(String typeOfProduction) {
   this.typeOfProduction = typeOfProduction;
   unitProductionStrategy = new UnitFactory().createUnitStrategy(typeOfProduction);
   productionCost = unitProductionStrategy.getCost();
 }