Example #1
0
    public void CancelProduceArmy(ArmyType type, BuildingIdentity factoryID)
    {
        CostConfigData cost = ConfigInterface.Instance.ArmyConfigHelper.GetProduceCostData(type, this.PlayerData.GetArmyLevel(type));

        this.m_PlayerModule.Receive(cost.CostGold, cost.CostFood, cost.CostOil, cost.CostGem);
        this.m_BuildingModule.CancelArmyProduce(type, factoryID);
        this.m_BuildingModule.ReCalculateResource();
    }
Example #2
0
    public void CancelUpgradeArmy(ArmyType type, BuildingIdentity laboratoryID)
    {
        int            currentLevel = this.m_PlayerModule.Data.GetArmyLevel(type);
        CostConfigData cost         = ConfigInterface.Instance.ArmyConfigHelper.GetUpgradeCostData(type, currentLevel);

        this.m_PlayerModule.Receive(cost.CostGold, cost.CostFood, cost.CostOil, cost.CostGem);
        this.m_BuildingModule.CancelArmyUpgrade(laboratoryID);
    }
Example #3
0
    public ArmyIdentity ProduceArmy(ArmyType type, BuildingIdentity factoryID)
    {
        CostConfigData cost = ConfigInterface.Instance.ArmyConfigHelper.GetProduceCostData(type, this.PlayerData.GetArmyLevel(type));

        this.m_PlayerModule.Consume(cost.CostGold, cost.CostFood, cost.CostOil, cost.CostGem);

        int armyLevel = this.m_PlayerModule.Data.GetArmyLevel(type);
        int armyNO    = this.m_PlayerModule.Data.GetArmyStartNO(type);

        this.m_PlayerModule.AddArmy(type);
        ArmyIdentity result = this.m_ArmyModule.ProduceArmy(type, armyLevel, armyNO);

        this.m_BuildingModule.ProduceArmy(result, factoryID);
        return(result);
    }
Example #4
0
    private void ConsumeBuildingConstructResource(BuildingType type)
    {
        CostConfigData costData = ConfigInterface.Instance.BuildingConfigHelper.GetUpgradeCostData(type, 0);

        this.ConsumeResource(costData.CostGold, costData.CostFood, costData.CostOil, costData.CostGem);
    }