Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
 public void AddBuildProduceConfig(BuildProduceConfig config)
 {
     buildProduceConfigs.Add(config.id, config);
 }