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

Examples of ch.sahits.game.openpatrician.model.building.ITradingOffice.move()


      int movedAmount = city.getCity().move(ware, -amount2Move,city.getPlayer());
      if (amount2Move!=-movedAmount){
        avgPrice = ware.computeBuyPrice(city.getCity().getWare(ware).getAmount()+movedAmount, movedAmount);
        amount2Move=movedAmount;
      }
      int loaded = office.move(ware, amount2Move,avgPrice);
      city.getPlayer().updateCash(-avgPrice*loaded);
    }
  }
}
 
View Full Code Here


          avgPrice = ware.getMaxValueSell();
        } else {
          avgPrice = ware.computeSellPrice(availableAmountCity,amount2Move);
        }
        city.getCity().move(ware, amount2Move,city.getPlayer()); // The price here is irrelevant
        int sold = office.move(ware, -amount2Move);
        city.getPlayer().updateCash(avgPrice * sold);
      } // end stored amount
    } // end office
  }
 
View Full Code Here

    ITradingOffice office = city.getPlayer().findTradingOffice(city.getCity());
    int availableAmountStorage = office.getWare(ware).getAmount();
    if (availableAmountStorage>0 && office!=null){
      int amount2Move = dialog.getAmount(availableAmountStorage); // This is ware specific size
      int avgPrice = office.getWare(ware).getAVGPrice();
      int moved = office.move(ware, -amount2Move,avgPrice);
      ship.load(ware, moved, avgPrice);
    }
  }
 
}
View Full Code Here

    ITradingOffice office = city.getPlayer().findTradingOffice(city.getCity());
    if (availableAmountShip>0 && office!=null){
      int amount2Move = dialog.getAmount(availableAmountShip); // This is ware specific size
      int avgPrice = ship.getWare(ware).getAVGPrice();
      int moved = ship.unload(ware, amount2Move);
      office.move(ware, moved,avgPrice);
    }

  }

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