game.economics
Class CivEconomy

java.lang.Object
  |
  +--java.util.Observable
        |
        +--game.economics.Economy
              |
              +--game.economics.CivEconomy
All Implemented Interfaces:
EconomyInterface

public class CivEconomy
extends Economy

The economy at the civilization level. Mostly thing to handle army support, and overall economic orders. For the economy supporting units. For now it will just be a civ-wide support. I had in mind that there is a need for each unit of a certain amount of supplies. Since what I am doing now is just temporary, I think the supply needed will be an Infrastructure class "Army Supplies".


Field Summary
 
Fields inherited from class game.economics.Economy
AMOUNT_PRODUCED, AMOUNT_PRODUCED_LAST_TURN, ECONOMY_TYPE, ESTIMATED_TAX_REVENUES, ignoreOrders, KAPITAL, LABOR_IN_SECTOR, MARKET, POPULATION, PRICE_X_POPULATION, PRODUCTION_TAX_BASE, PRODUCTION_TAX_BASE_LAST_TURN, SITES, TOTAL_WAGES, TRADITIONAL
 
Constructor Summary
CivEconomy(Administration administration)
           
 
Method Summary
 float addToArmySupplies(float amt)
          adds amt to supplies, no range checking
 Cost addToFortificationBuildingPoints(Cost amount)
          adds amount to fortification budget, no range checking for now
 float addToRoadBuildingPoints(float amt)
          adds amt to road building budget, no range checking for now
 float addToTreasury(float toAdd)
           
(package private)  float calculateMilitaryPayRatePercentage()
          What percentage of base pay do all TFs of the civ receive?
 void econTurnCompleted()
          all actions that come at end of civ econ turn
 float executeGovtEconOrders(java.lang.String testOrReal, java.lang.String orderName)
          Cranks the government economic orders for economy of a given type given by orderName.
 float getArmySupplies()
          gets total supplies available
 float getArmySuppliesNeeded()
          get needed amt of army supplies for next turn
(package private)  float getArmySuppliesNeededFromEconomy()
          use a crude metric to figure needed amt of army supplies for next turn
 CivEconomy getCivEconomy()
          gets economy of civilization that runs this economy
 Cost getFortificationBuildingPoints()
          gets amount of fortification building budget
 java.lang.String getMerchantDescription()
           
 float getMilitaryAttackXDueToSupplies()
          What value do we multiply attack by to account for supplies Temp way to handle civ support of combat troops 100% pay =100% effectiveness, 0% pay gives 25% effectiveness, linear between the two.
(package private)  float getMilitaryPayRatePercentage()
          What percentage of base pay do all TFs of the civ receive?
 float getRoadBuildingPoints()
          gets amt of road building budget
 float getSpending()
           
 float getSupplyAttack()
           
 float getTreasuryValue()
           
 float getTwiceMerchantProfits()
           
 
Methods inherited from class game.economics.Economy
addAllPossibleOrders, addGovtEconOrder, calculateCostOfGovernmentPurchases, calculateMarginalCostOfGovernmentOrder, calculateTotalCostOfGovernmentPurchases, clearGovtEconOrders, economicTurn, economicTurnThisLevel, executeGovtEconOrders, getAdministration, getAllMerchantsHereToString, getAllMerchantsMakingProfitHereToString, getAllMerchantsWithContractsHere, getAllMerchantsWithHomeHere, getAveragePrices, getAverageWages, getCivilization, getEconomicInfo, getEconomicSectorInfo, getEconomyType, getEstimatedTaxIncomePerTurn, getGoodsInfo, getGovtEconOrders, getGrowthRateInPercent, getLabor, getOwnerName, getProductionGrowthRateInPercent, getSuperior, getTaxRate, getTotalKapital, getTotalMerchantProfits, getUnitsBuiltByOrder, isBuildable, iterator, notifyObservers, removeFrames, removeGovtEconOrder, removeOrderIfNotValid, setAdministration, setEconomyInfoFrame, setEconomyOrdersFrame, setEconomyType, setTaxRate, updateAllFrames, updateFrames
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CivEconomy

public CivEconomy(Administration administration)
Method Detail

getCivEconomy

public CivEconomy getCivEconomy()
Description copied from class: Economy
gets economy of civilization that runs this economy

Specified by:
getCivEconomy in interface EconomyInterface
Overrides:
getCivEconomy in class Economy

econTurnCompleted

public void econTurnCompleted()
all actions that come at end of civ econ turn

Specified by:
econTurnCompleted in interface EconomyInterface
Overrides:
econTurnCompleted in class Economy

addToRoadBuildingPoints

public float addToRoadBuildingPoints(float amt)
adds amt to road building budget, no range checking for now


getRoadBuildingPoints

public float getRoadBuildingPoints()
gets amt of road building budget


addToFortificationBuildingPoints

public Cost addToFortificationBuildingPoints(Cost amount)
adds amount to fortification budget, no range checking for now


getFortificationBuildingPoints

public Cost getFortificationBuildingPoints()
gets amount of fortification building budget


addToTreasury

public float addToTreasury(float toAdd)

getTreasuryValue

public float getTreasuryValue()

getSpending

public float getSpending()

getSupplyAttack

public float getSupplyAttack()

getTwiceMerchantProfits

public float getTwiceMerchantProfits()

getMerchantDescription

public java.lang.String getMerchantDescription()

addToArmySupplies

public float addToArmySupplies(float amt)
adds amt to supplies, no range checking


getArmySupplies

public float getArmySupplies()
gets total supplies available


getArmySuppliesNeededFromEconomy

float getArmySuppliesNeededFromEconomy()
use a crude metric to figure needed amt of army supplies for next turn


getArmySuppliesNeeded

public float getArmySuppliesNeeded()
get needed amt of army supplies for next turn


calculateMilitaryPayRatePercentage

float calculateMilitaryPayRatePercentage()
What percentage of base pay do all TFs of the civ receive? Temp way to handle civ support of combat troops. Must only do once per turn!


getMilitaryPayRatePercentage

float getMilitaryPayRatePercentage()
What percentage of base pay do all TFs of the civ receive?


getMilitaryAttackXDueToSupplies

public float getMilitaryAttackXDueToSupplies()
What value do we multiply attack by to account for supplies Temp way to handle civ support of combat troops 100% pay =100% effectiveness, 0% pay gives 25% effectiveness, linear between the two.


executeGovtEconOrders

public float executeGovtEconOrders(java.lang.String testOrReal,
                                   java.lang.String orderName)
Description copied from class: Economy
Cranks the government economic orders for economy of a given type given by orderName. Also executes orders at any lower level in economy. Must be overridden at lowest level of economy. (MapSquareEconomy).

Specified by:
executeGovtEconOrders in interface EconomyInterface
Overrides:
executeGovtEconOrders in class Economy
Returns:
cost of the orders