summaryrefslogtreecommitdiff
path: root/src/input/json.rs
diff options
context:
space:
mode:
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>()
+ }
}
}