diff --git a/packages/cli/lib/central_command.dart b/packages/cli/lib/central_command.dart index d3d5f84d..f3015c88 100644 --- a/packages/cli/lib/central_command.dart +++ b/packages/cli/lib/central_command.dart @@ -85,10 +85,10 @@ class CentralCommand { /// but will not start new deals involving contracts. /// Mostly this makes unit-testing easier by allowing us to disable contract /// trading. - bool get isContractTradingEnabled => true; + bool get isContractTradingEnabled => config.enableContracts; /// Returns true if construction trading is enabled. - bool get isConstructionTradingEnabled => true; + bool get isConstructionTradingEnabled => config.enableConstruction; /// Minimum profit per second we expect this ship to make. // Should set this based on the ship type and how much we expect to earn diff --git a/packages/cli/lib/config.dart b/packages/cli/lib/config.dart index f573f591..05220f16 100644 --- a/packages/cli/lib/config.dart +++ b/packages/cli/lib/config.dart @@ -18,7 +18,7 @@ enum GamePhase with EnumIndexOrdering { /// Which phase are we in. // TODO(eseidel): Make this dynamic. -const gamePhase = GamePhase.bootstrap; +GamePhase gamePhase = GamePhase.bootstrap; /// Class for holding our hard-coded configuration values. class Config { @@ -29,6 +29,12 @@ class Config { /// Whether or not we should enable mining behaviors. final bool enableMining = gamePhase < GamePhase.exploration; + /// Whether or not we engage in construction behaviors. + final bool enableConstruction = gamePhase == GamePhase.construction; + + /// Whether or not we engage in contract behaviors. + final bool enableContracts = true; + /// What behaviors count as "mining" for our enable/disable mining. final miningBehaviors = { Behavior.miner, @@ -133,10 +139,9 @@ class Config { Behavior.seeder, Behavior.trader, ], - // TODO(eseidel): I don't think these do anything anymore: - // FleetRole.miner: [Behavior.miner], - // FleetRole.surveyor: [Behavior.surveyor], - // FleetRole.siphoner: [Behavior.siphoner], + FleetRole.miner: [Behavior.miner], + FleetRole.surveyor: [Behavior.surveyor], + FleetRole.siphoner: [Behavior.siphoner], }; // We could put some "total value" on the idea of the gate being open