Package ch.sahits.game.openpatrician.model.building

Examples of ch.sahits.game.openpatrician.model.building.IStorage


      ICity cityModel = city.getCity();
      y += (int)Math.rint(positions.titleHeigth*2/3);
     
     
      ITradingOffice office = city.getPlayer().findTradingOffice(cityModel);
      IStorage storage = office.getStorage();
     
      drawRow(g2d, y, positions.xNumbers, String.valueOf(office.getStored()/10));
      y += positions.lineHeight;

      drawRow(g2d, y, positions.xNumbers, String.valueOf(office.getCapacity()/10));
      y += positions.lineHeight;
     
      int additional = office.getStored()-office.getCapacity();
      if (additional<0) additional = 0;
      drawRow(g2d, y, positions.xNumbers, String.valueOf(additional/10));
      y += positions.lineHeight;
     
      drawRow(g2d, y, positions.xNumbers, String.valueOf(storage.getRentOutStorage()));
      y += positions.lineHeight;

      drawRow(g2d, y, positions.xNumbers, String.valueOf(storage.getCostsPerDay()));
      y += positions.lineHeight;
      y += positions.lineHeight;

      y += positions.lineHeight;
      y += positions.lineHeight;
     
      drawRow(g2d, y, positions.xNumbers, String.valueOf(storage.getNumberGuards()));
      y += positions.lineHeight;

      drawRow(g2d, y, positions.xNumbers, String.valueOf(storage.getGuardCostsPerDay()));
      y += positions.lineHeight;
     
      ELevel security = storage.getSecurityLevel(); // TODO externalize
      drawRow(g2d, y, positions.xNumbers, security.name());

    } catch (FontFormatException e) {
      e.printStackTrace();
    } catch (IOException e) {
View Full Code Here


    }


    @Override
    public void run() {
      IStorage storage = city.getPlayer().findTradingOffice(city.getCity()).getStorage();
      storage.updateGuardsNumber(guardNumberChange);
    }
View Full Code Here

      sum += cost;
    }
    this.propertyTaxes=sum;

    buildings = player.findBuildings(city,IWorkShop.class);
    IStorage storage = office.getStorage();
    dailyCost=0;
    for (IBuilding building : buildings) {
      dailyCost += (int)Math.rint(((IWorkShop)building).getSalaryPerWorker()/7.0);
    }
    for (int i = weekIndex; i<wageCostsDays.length;i++){
      this.wageCostsDays[i] = dailyCost+storage.getGuardCostsPerDay();
    }
    sum = 0;
    for (int cost : wageCostsDays) {
      sum += cost;
    }
    this.wageCosts=sum;
   
    IAutomatedTrading automaticTrading = office.getOfficeTrading();
    if (automaticTrading!=null){
      // TODO implement this when implementing office traiding
    } else {
      for (int i = weekIndex; i<officeTradingDays.length;i++){
        this.officeTradingDays[i] = 0;
      }
    }
    sum = 0;
    for (int cost : officeTradingDays) {
      sum += cost;
    }
    this.officeTrading=sum;
   
    // TODO update other expences
    for (int i = weekIndex; i<otherCostsDays.length;i++){
      this.otherCostsDays[i] = storage.getCostsPerDay();
    }
  }
View Full Code Here

TOP

Related Classes of ch.sahits.game.openpatrician.model.building.IStorage

Copyright © 2018 www.massapicom. 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.