summaryrefslogtreecommitdiff
path: root/src/engine/mod.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-06-09 13:23:32 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-06-09 13:23:32 +0200
commite6b613207b540cfae6691d97941007d05ef019be (patch)
treeec520d591f0e91ef5c3b184aba15b153e7cd3bd1 /src/engine/mod.rs
parent96d55f1851b487d4deafec069e164d9e5b23fd9c (diff)
Calibrated energy cutoff and turned it on by default
Diffstat (limited to 'src/engine/mod.rs')
-rw-r--r--src/engine/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/engine/mod.rs b/src/engine/mod.rs
index 28583a1..739dd85 100644
--- a/src/engine/mod.rs
+++ b/src/engine/mod.rs
@@ -8,8 +8,8 @@ use self::settings::{GameSettings, BuildingSettings};
use std::ops::FnMut;
-#[cfg(feature = "energy-cutoff")] pub const ENERGY_PRODUCTION_CUTOFF: f32 = 2.;
-#[cfg(feature = "energy-cutoff")] pub const ENERGY_STORAGE_CUTOFF: u16 = 10;
+#[cfg(feature = "energy-cutoff")] pub const ENERGY_PRODUCTION_CUTOFF: f32 = 1.2;
+#[cfg(feature = "energy-cutoff")] pub const ENERGY_STORAGE_CUTOFF: f32 = 1.5;
#[derive(Debug, Clone, PartialEq)]
pub struct GameState {
@@ -293,8 +293,8 @@ impl Player {
#[cfg(feature = "energy-cutoff")]
pub fn sensible_buildings(&self, settings: &GameSettings) -> Vec<BuildingType> {
let mut result = Vec::with_capacity(3);
- let needs_energy = self.energy_generated as f32 >= ENERGY_PRODUCTION_CUTOFF * settings.max_building_price as f32 &&
- self.energy >= ENERGY_STORAGE_CUTOFF * settings.max_building_price;
+ let needs_energy = self.energy_generated as f32 <= ENERGY_PRODUCTION_CUTOFF * settings.max_building_price as f32 &&
+ self.energy as f32 <= ENERGY_STORAGE_CUTOFF * settings.max_building_price as f32;
for b in BuildingType::all().iter() {
let building_setting = settings.building_settings(*b);