pub struct StructureConfig {
pub description: Option<String>,
pub starting_level: Option<usize>,
pub production: Option<Vec<ProductionConfig>>,
pub production_multiplier: Option<f64>,
pub storage: Option<Vec<StorageConfig>>,
pub storage_multiplier: Option<f64>,
pub cost: Vec<HashMap<String, usize>>,
pub cost_multiplier: Option<f64>,
}Fields§
§description: Option<String>Description of the structure.
starting_level: Option<usize>Starting level for this type of structure If not provided it is 0
production: Option<Vec<ProductionConfig>>Used to specify how many of each resource is produced
The number of ticks needed to produce the resource at a level
production_multiplier: Option<f64>Used as a multiplier for the production.
The highest given production value will be multiplied by this value.
storage: Option<Vec<StorageConfig>>The amount of storage available at the starting level.
storage_multiplier: Option<f64>Used as a multiplier for the storage.
cost: Vec<HashMap<String, usize>>Cost for each level They are the costs to level up from the current level to the next level The first element is the cost to level up from 0 to 1
cost_multiplier: Option<f64>Used as a multiplier for the cost.
The highest given cost value will be multiplied by this value.
Implementations§
Source§impl StructureConfig
impl StructureConfig
Sourcepub fn get_cost(&self, level: usize) -> Cost
pub fn get_cost(&self, level: usize) -> Cost
Get the cost to build this structure at a given level
Sourcepub fn get_production(&self, level: usize) -> ProductionConfig
pub fn get_production(&self, level: usize) -> ProductionConfig
Get the production for this structure at a given level.
Sourcepub fn get_storage(&self, level: usize) -> StorageConfig
pub fn get_storage(&self, level: usize) -> StorageConfig
Get the storage for this structure at a given level.