public void AddBuildModule(AbstractBuildConfig config, bool calculate = false) { if (config == null) { return; } buildModules.Add(config); config.App(uid, this, calculate); switch (config.buildModuleType) { case BuildModuleType.Produce: lastBuildProduceConfig = (BuildProduceConfig)config; build_produce = true; break; case BuildModuleType.Turret: lastBuildTurretConfig = (BuildTurretConfig)config; build_turret = true; break; case BuildModuleType.Spot: lastBuildSpotConfig = (BuildSpotConfig)config; build_spot = true; break; } }
public void RemoveBuildModule(AbstractBuildConfig config, bool calculate = false) { if (config == null) { return; } buildModules.Remove(config); config.Revoke(uid, this, calculate); switch (config.buildModuleType) { case BuildModuleType.Produce: if (lastBuildProduceConfig == config) { lastBuildProduceConfig = null; build_produce = false; } break; case BuildModuleType.Turret: if (lastBuildTurretConfig == config) { lastBuildTurretConfig = null; build_turret = false; } break; case BuildModuleType.Spot: if (lastBuildSpotConfig == config) { lastBuildSpotConfig = null; build_spot = false; } break; } }
public void AddBuildProduceConfig(BuildProduceConfig config) { buildProduceConfigs.Add(config.id, config); }