summaryrefslogtreecommitdiff
path: root/src/input/json.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-06-30 16:10:40 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-06-30 16:10:40 +0200
commit11457a738e63b5aaae55779fbfdc4978e6524bb1 (patch)
treedabb0b031db0b189fce1dac36c47f71f5aea0036 /src/input/json.rs
parent9db48d9c24fcdd7a807aacfe67cd34455c945555 (diff)
Moved 'expressive' specific building logic out of generi code
Diffstat (limited to 'src/input/json.rs')
-rw-r--r--src/input/json.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/input/json.rs b/src/input/json.rs
index 3968afd..6f7cda1 100644
--- a/src/input/json.rs
+++ b/src/input/json.rs
@@ -200,7 +200,11 @@ impl BuildingBlueprint {
impl Player {
fn to_engine(&self, settings: &engine::settings::GameSettings, buildings: &[expressive_engine::Building]) -> engine::Player {
- engine::Player::new(self.energy, self.health, settings, buildings)
+ engine::Player {
+ energy: self.energy,
+ health: self.health,
+ energy_generated: settings.energy_income + buildings.iter().map(|b| b.energy_generated_per_turn).sum::<u16>()
+ }
}
}