Пример #1
0
    // 请求补充士兵
    public void RequestProduceSoldier(long buildingID, int soldierID, int cost)
    {
        PProductSolider data = new PProductSolider();

        data.buildId      = buildingID;
        data.soliderCfgId = soldierID;

        Net.Send(eCommand.PRODUCT_SOLIDERS, data, (buffer) => {
            PBuildInfo ret = Net.Deserialize <PBuildInfo>(buffer);
            if (!Net.CheckErrorCode(ret.errorCode, eCommand.PRODUCT_SOLIDERS))
            {
                return;
            }

            TroopBuildingInfo info = GetBuilding(ret.buildId) as TroopBuildingInfo;
            if (info != null)
            {
                // 扣去相应资源
                UserManager.Instance.CostMoney(cost, PriceType.MONEY);
                info.Deserialize(ret);
                RefreshUI(buildingID);
                UIManager.Instance.CloseWindow <UICitySoldierSelectView>();
                UIManager.Instance.RefreshWindow <UICitySoldierSwitchView>();
            }
        });
    }
Пример #2
0
    public override void OnBindData(params object[] param)
    {
        _currentInfo = param[0] as BuildingInfo;
        if (_currentInfo == null)
        {
            return;
        }

        if (_currentInfo.IsInBuilding())
        {
            _title.text  = Str.Get("UI_MSG_CANCEL");
            _detail.text = string.Format(Str.Get("UI_MSG_CANCEL_DETAIL"), _currentInfo.Cfg.BuildingName);
        }
        else if (_currentInfo.BuildingType == CityBuildingType.TRAIN)
        {
            // 快速升级兵种
            TrainBuildingInfo tbinfo = _currentInfo as TrainBuildingInfo;
            if (tbinfo != null && tbinfo.IsTrainingSoldier())
            {
                _title.text = Str.Get("UI_MSG_CANCEL");
                SoldierConfig cfg = SoldierConfigLoader.GetConfig(tbinfo.TrainSoldierCfgID);
                _detail.text = string.Format(Str.Get("UI_MSG_CANCEL_DETAIL"), cfg.SoldierName);
            }
        }
        else if (_currentInfo.BuildingType == CityBuildingType.TROOP)
        {
            // 快速生产士兵
            TroopBuildingInfo tbinfo = _currentInfo as TroopBuildingInfo;
            if (tbinfo != null && tbinfo.IsProducingSoldier())
            {
                _title.text  = Str.Get("UI_MSG_CANCEL_SOLDIER");
                _detail.text = string.Format(Str.Get("UI_MSG_CANCEL_SOLDIER_DETAIL"), tbinfo.SoldierCfg.SoldierName);
            }
        }
    }
Пример #3
0
 void UpdateTime()
 {
     if (_currentInfo.IsInBuilding())
     {
         // 建筑正在升级
         int cd = _currentInfo.GetLevelUpCD();
         _prgTime.fillAmount = 1.0f * cd / Utils.GetSeconds(_currentInfo.CfgLevel.UpgradeTime);
         _textTime.text      = Utils.GetCountDownString(cd);
     }
     else if (_currentInfo.BuildingType == CityBuildingType.TROOP)
     {
         // 如果是兵营的话
         TroopBuildingInfo tbinfo = _currentInfo as TroopBuildingInfo;
         if (tbinfo != null && tbinfo.IsProducingSoldier())
         {
             // 如果正在生产士兵,则显示士兵头像
             int cd = tbinfo.GetProducingCD();
             _prgTime.fillAmount = 1.0f * cd / tbinfo.GetMaxProduceTime();
             _textTime.text      = Utils.GetCountDownString(cd);
         }
     }
     else if (_currentInfo.BuildingType == CityBuildingType.TRAIN)
     {
         TrainBuildingInfo tbinfo = _currentInfo as TrainBuildingInfo;
         if (tbinfo != null && tbinfo.IsTrainingSoldier())
         {
             int cd = tbinfo.GetTrainCD();
             _prgTime.fillAmount = 1.0f * cd / tbinfo.GetMaxTrainTime();
             _textTime.text      = Utils.GetCountDownString(cd);
         }
     }
 }
Пример #4
0
    public void RequestQuickProduceSoldier(long buildingID, int soldierID)
    {
        TroopBuildingInfo infoSend = GetBuilding(buildingID) as TroopBuildingInfo;

        if (infoSend == null)
        {
            return;
        }

        PCMLongInt data = new PCMLongInt();

        data.arg1 = buildingID;
        data.arg2 = soldierID;

        Net.Send(eCommand.PRODUCT_SOLIDER_RIGHT_NOW, data, (buffer) => {
            PBuildInfo ret = Net.Deserialize <PBuildInfo>(buffer);
            if (!Net.CheckErrorCode(ret.errorCode, eCommand.PRODUCT_SOLIDER_RIGHT_NOW))
            {
                return;
            }

            UserManager.Instance.CostMoney(infoSend.GetQuickProducingCost(), PriceType.GOLD);

            infoSend.Deserialize(ret);
            RefreshUI(buildingID);

            UIManager.Instance.CloseWindow <UICitySoldierSelectView>();
            UIManager.Instance.CloseWindow <UICitySoldierSwitchView>();
        });
    }
Пример #5
0
 public void OnClickOK()
 {
     if (_currentInfo.IsInBuilding())
     {
         // 立刻升级建筑
         CityManager.Instance.RequestQuickUpgradeBuilding(_currentInfo.EntityID, false);
         CloseWindow();
     }
     else if (_currentInfo.BuildingType == CityBuildingType.TRAIN)
     {
         // 快速升级兵种
         TrainBuildingInfo tbinfo = _currentInfo as TrainBuildingInfo;
         if (tbinfo != null && tbinfo.IsTrainingSoldier())
         {
             CityManager.Instance.RequestQuickTrainSoldier(tbinfo.TrainSoldierCfgID, false);
             CloseWindow();
         }
     }
     else if (_currentInfo.BuildingType == CityBuildingType.TROOP)
     {
         // 快速生产士兵
         TroopBuildingInfo tbinfo = _currentInfo as TroopBuildingInfo;
         if (tbinfo != null && tbinfo.IsProducingSoldier())
         {
             CityManager.Instance.RequestQuickProduceSoldier(_currentInfo.EntityID, tbinfo.SoldierConfigID);
             CloseWindow();
         }
     }
     else
     {
         CloseWindow();
     }
 }
Пример #6
0
    private void OnMsgPushGetSoldier(byte[] buffer)
    {
        PPushSolilerGet ret = Net.Deserialize <PPushSolilerGet>(buffer);


        TroopBuildingInfo info = GetBuilding(ret.buildId) as TroopBuildingInfo;

        if (info == null)
        {
            return;
        }

        // 添加士兵数量
        info.SoldierCount += ret.addNum;
        Log.Info("添加新士兵" + info.SoldierCount);

        // 全部生产完毕
        if (ret.isFinished)
        {
            info.OnProduceFinish();
        }

        // 刷新对应建筑
        EventDispatcher.TriggerEvent(EventID.EVENT_CITY_BUILDING_REFRESH, ret.buildId);
    }
Пример #7
0
    // 请求取消生产士兵
    public void RequestCancelProduceSoldier(long buildingID, int soldierID)
    {
        TroopBuildingInfo infoSend = GetBuilding(buildingID) as TroopBuildingInfo;

        if (infoSend == null)
        {
            return;
        }

        PCMLongInt data = new PCMLongInt();

        data.arg1 = buildingID;
        data.arg2 = soldierID;

        Net.Send(eCommand.CANCLE_PRODUCT_SOLIDER, data, (buffer) => {
            PBuildInfo ret = Net.Deserialize <PBuildInfo>(buffer);
            if (!Net.CheckErrorCode(ret.errorCode, eCommand.CANCLE_PRODUCT_SOLIDER))
            {
                return;
            }

            infoSend.Deserialize(ret);

            // 请求同步数据(因为士兵有生产过程,所以客户端很难去计算正确的结果)
            UserManager.Instance.RequestSyncRes();
            RefreshUI(buildingID);
        });
    }
Пример #8
0
    public override void OnBindData(params object[] param)
    {
        _currentInfo = param[0] as TroopBuildingInfo;

        if (_currentInfo == null)
        {
            return;
        }
        _textDesc.text = _currentInfo.Cfg.BuildingDescription;
    }
Пример #9
0
    public override void OnBindData(params object[] param)
    {
        _currentInfo = param[0] as BuildingInfo;
        if (_currentInfo == null)
        {
            return;
        }

        int costValue = 0;

        if (_currentInfo.IsInBuilding())
        {
            costValue    = _currentInfo.GetQuickLevelUpCost(true);
            _title.text  = Str.Get("UI_MSG_QUICK_UPGRADE_TITLE");
            _detail.text = string.Format(Str.Get("UI_MSG_QUICK_UPGRADE_DETAIL"), costValue, _currentInfo.Cfg.BuildingName);
            _cost.text   = _currentInfo.GetQuickLevelUpCost(true).ToString();
        }
        else if (_currentInfo.BuildingType == CityBuildingType.TRAIN)
        {
            // 快速升级兵种
            TrainBuildingInfo tbinfo = _currentInfo as TrainBuildingInfo;
            if (tbinfo != null && tbinfo.IsTrainingSoldier())
            {
                costValue   = tbinfo.GetQuickTrainCost();
                _title.text = Str.Get("UI_MSG_QUICK_UPGRADE_TITLE");
                SoldierConfig cfg = SoldierConfigLoader.GetConfig(tbinfo.TrainSoldierCfgID);
                _detail.text = string.Format(Str.Get("UI_MSG_QUICK_UPGRADE_DETAIL"), costValue, cfg.SoldierName);
                _cost.text   = tbinfo.GetQuickTrainCost().ToString();
            }
        }
        else if (_currentInfo.BuildingType == CityBuildingType.TROOP)
        {
            // 快速生产士兵
            TroopBuildingInfo tbinfo = _currentInfo as TroopBuildingInfo;
            if (tbinfo != null && tbinfo.IsProducingSoldier())
            {
                costValue    = tbinfo.GetQuickProducingCost();
                _title.text  = Str.Get("UI_MSG_QUICK_PRODUCE_SOLDIER");
                _detail.text = string.Format(Str.Get("UI_MSG_QUICK_PRODUCE_SOLDIER_DETAIL"), costValue, tbinfo.SoldierCfg.SoldierName);
                _cost.text   = tbinfo.GetQuickProducingCost().ToString();
            }
        }

        RectTransform rc = _imgFlag.transform as RectTransform;

        if (rc)
        {
            rc.anchoredPosition = new Vector2(-(_imgFlag.preferredWidth + _cost.preferredWidth) / 2 - 2, rc.anchoredPosition.y);
        }

        if (costValue <= 0)
        {
            CloseWindow();
        }
    }
Пример #10
0
    public void SetInfo(int soldierCfgID, BuildingInfo buildingInfo)
    {
        _currentSoldierCfgID = soldierCfgID;
        int level = CityManager.Instance.GetSoldierLevel(soldierCfgID);

        _levelupCfg = SoldierLevelConfigLoader.GetConfig(soldierCfgID, level);
        if (_levelupCfg == null)
        {
            return;
        }

        _soldierIcon.sprite = ResourceManager.Instance.GetSoldierIcon(_currentSoldierCfgID);

        // 兵营界面
        _currentBuildingInfo = buildingInfo as TroopBuildingInfo;
        if (_currentBuildingInfo == null)
        {
            return;
        }

        int           maxCount = _currentBuildingInfo.CfgLevel.MaxStorage;
        SoldierConfig cfg      = SoldierConfigLoader.GetConfig(_currentSoldierCfgID);

        if (cfg == null)
        {
            return;
        }

        _maxCount   = maxCount / cfg.States;
        _count.text = "x" + (maxCount / cfg.States);

        int count = _currentBuildingInfo.GetMaxSoldierCount(_currentSoldierCfgID);

        _costValue = _currentBuildingInfo.GetSwitchCost(_currentSoldierCfgID);
        int timeValue = Utils.GetSeconds(cfg.Producetime * count);

        _cost.text = Mathf.Max(0, _costValue).ToString();

        // 银两不足,显示红色
        if (UserManager.Instance.Money >= _costValue)
        {
            _cost.color = Color.white;
        }
        else
        {
            _cost.color = Color.red;
        }

        _time.text = Utils.GetCountDownString(timeValue);

        // 士兵生产数目
        _count.gameObject.SetActive(true);

        _soldierLevel.text = "Lv" + level;
    }
Пример #11
0
    public void SetInfo(BuildingInfo info)
    {
        _currentInfo = info;

        if (_currentInfo == null)
        {
            return;
        }

        bool refresh = false;

        if (_currentInfo.IsInBuilding())
        {
            // 建筑正在升级
            _imageIcon.sprite = _levelupSprite;
            refresh           = true;
        }
        else if (_currentInfo.BuildingType == CityBuildingType.TROOP)
        {
            // 如果是兵营的话
            TroopBuildingInfo tbinfo = _currentInfo as TroopBuildingInfo;
            if (tbinfo != null && tbinfo.IsProducingSoldier())
            {
                // 如果正在生产士兵,则显示士兵头像
                _imageIcon.sprite = ResourceManager.Instance.GetSoldierIcon(tbinfo.SoldierConfigID);
                refresh           = true;
            }
        }
        else if (_currentInfo.BuildingType == CityBuildingType.TRAIN)
        {
            TrainBuildingInfo tbinfo = _currentInfo as TrainBuildingInfo;
            if (tbinfo != null && tbinfo.IsTrainingSoldier())
            {
                _imageIcon.sprite = ResourceManager.Instance.GetSoldierIcon(tbinfo.TrainSoldierCfgID);
                refresh           = true;
            }
        }

        if (refresh)
        {
            // 开启倒计时
            gameObject.SetActive(true);
            InvokeRepeating("UpdateTime", 0, 0.1f);
        }
        else
        {
            // 没有需要倒计时的
            gameObject.SetActive(false);
            CancelInvoke("UpdateTime");
        }
    }
Пример #12
0
    public void Deserialize(PPlayerInfo data)
    {
        if (data.pBattlePT.Count < 2)
        {
            Log.Error("Error Battle Formation");
            return;
        }

        // pvp的阵型数据
        PBattlePT formation = data.pBattlePT[1];

        // 英雄
        HeroList.Clear();
        foreach (var item in formation.heroPT)
        {
            HeroInfo info = new HeroInfo();
            info.Deserialize(item.hero, false);
            HeroList.Add(info);
        }

        SoldierList.Clear();
        foreach (var item in formation.buildPT)
        {
            BuildingInfo binfo = CityManager.Instance.CreateBuilding(item.build.cfgId);
            if (binfo == null)
            {
                continue;
            }

            TroopBuildingInfo tbinfo = binfo as TroopBuildingInfo;
            if (tbinfo != null)
            {
                // TODO 暂时只处理兵营数据,将来再处理校场,校场含有士兵等级数据
                binfo.Deserialize(item.build);

                SoldierInfo info = new SoldierInfo();
                info.ConfigID = tbinfo.SoldierConfigID;
                SoldierList.Add(info);
            }


            if (binfo.BuildingType == CityBuildingType.TRAIN)
            {
                // 校场,持有士兵等级数据
            }
            else if (binfo.BuildingType == CityBuildingType.TROOP)
            {
                // 兵营
            }
        }
    }
Пример #13
0
    public int GetFightScore()
    {
        int fightScore = 0;

        foreach (var item in BuildingList)
        {
            TroopBuildingInfo info = item as TroopBuildingInfo;
            if (info != null)
            {
                fightScore += info.GetFightScore();
            }
        }
        return(fightScore);
    }
Пример #14
0
    private void SetInfo(BuildingInfo info)
    {
        _currentInfo = info as TroopBuildingInfo;
        if (_currentInfo == null)
        {
            return;
        }

        int           cfgID = _currentInfo.SoldierConfigID;
        SoldierConfig cfg   = SoldierConfigLoader.GetConfig(cfgID);
        int           level = Mathf.Max(CityManager.Instance.GetSoldierLevel(cfgID), 1);

        SoldierLevelConfig cfgLevel = SoldierLevelConfigLoader.GetConfig(cfgID, level);

        _title.text          = cfg.SoldierName + " Lv" + level;
        _soldierImage.sprite = ResourceManager.Instance.GetSoldierImage(cfgID);
        _textDesc.text       = cfg.SoldierDescription;

        _soldierIcon1.sprite = ResourceManager.Instance.GetSoldierIcon(cfgID);
        _soldierIcon2.sprite = ResourceManager.Instance.GetSoldierIcon(cfgID);
        _soldierCount1.text  = _currentInfo.SoldierCount.ToString();

        int addCount = _currentInfo.GetMaxSoldierCount(cfgID) - _currentInfo.SoldierCount;

        if (addCount > 0)
        {
            _soldierCount2.text = addCount.ToString();
            _textCost.text      = (addCount * cfgLevel.ProduceCost).ToString();
            _textTime.text      = Utils.GetCountDownString(addCount * Utils.GetSeconds(_currentInfo.SoldierCfg.Producetime));

            _soldierIcon2.gameObject.SetActive(true);
            _textCost.gameObject.SetActive(true);
            _textTime.gameObject.SetActive(true);
            _text3.gameObject.SetActive(true);
            _imageCostFlag.gameObject.SetActive(true);
            _imageTimeFlag.gameObject.SetActive(true);
            _btnAddSoldier.gameObject.SetActive(true);
        }
        else
        {
            // 兵营满了,不需要补充
            _soldierIcon2.gameObject.SetActive(false);
            _textCost.gameObject.SetActive(false);
            _textTime.gameObject.SetActive(false);
            _text3.gameObject.SetActive(false);
            _imageCostFlag.gameObject.SetActive(false);
            _imageTimeFlag.gameObject.SetActive(false);
            _btnAddSoldier.gameObject.SetActive(false);
        }
    }
Пример #15
0
    private void SetInfo(BuildingInfo info)
    {
        _currentInfo = info;
        if (_currentInfo == null)
        {
            return;
        }

        if (_currentInfo.IsInBuilding())
        {
            // 建筑正在升级
            _leftIcon.sprite = _levelUpIcon;
            _cost.text       = _currentInfo.GetQuickLevelUpCost(true).ToString();
        }
        else if (_currentInfo.BuildingType == CityBuildingType.TROOP)
        {
            // 如果是兵营的话
            TroopBuildingInfo tbinfo = _currentInfo as TroopBuildingInfo;
            if (tbinfo != null && tbinfo.IsProducingSoldier())
            {
                // 如果正在生产士兵,则显示士兵头像
                _leftIcon.sprite = ResourceManager.Instance.GetSoldierIcon(tbinfo.SoldierConfigID);
                _cost.text       = tbinfo.GetQuickProducingCost().ToString();
            }
        }
        else if (_currentInfo.BuildingType == CityBuildingType.TRAIN)
        {
            TrainBuildingInfo tbinfo = _currentInfo as TrainBuildingInfo;
            if (tbinfo != null && tbinfo.IsTrainingSoldier())
            {
                _leftIcon.sprite = ResourceManager.Instance.GetSoldierIcon(tbinfo.TrainSoldierCfgID);
                _cost.text       = tbinfo.GetQuickTrainCost().ToString();
            }
        }

        RectTransform rc = _imgFlag.transform as RectTransform;

        if (rc)
        {
            rc.anchoredPosition = new Vector2(-(_imgFlag.preferredWidth + _cost.preferredWidth) / 2 - 2, rc.anchoredPosition.y);
        }

        InvokeRepeating("UpdateTime", 0, 1);
    }
Пример #16
0
    // 点击兵营
    private void OnClickTroop()
    {
        TroopBuildingInfo tbinfo = _currentInfo as TroopBuildingInfo;

        if (tbinfo == null)
        {
            return;
        }

        if (tbinfo.SoldierCount <= 0)
        {
            // 没有士兵,直接打开选择士兵的界面
            UIManager.Instance.OpenWindow <UICitySoldierSelectView>(_currentInfo);
        }
        else
        {
            // 有士兵,打开切换士兵的界面
            UIManager.Instance.OpenWindow <UICitySoldierSwitchView>(_currentInfo);
        }
    }
Пример #17
0
    public void SetInfo(BuildingInfo info)
    {
        _info = info as TroopBuildingInfo;
        if (_info == null)
        {
            return;
        }

        if (_info.SoldierConfigID == 0 || _info.IsProducingSoldier() || _info.IsInBuilding())
        {
            gameObject.SetActive(false);
        }
        else
        {
            _imageIcon.sprite = ResourceManager.Instance.GetSoldierTypeIcon(_info.SoldierConfigID);

            if (_info.SoldierConfigID != 0)
            {
                _txtNumber.text = string.Format("X {0}/{1}", _info.SoldierCount, _info.GetMaxSoldierCount(_info.SoldierConfigID));
            }
            gameObject.SetActive(true);
        }
    }
Пример #18
0
    //    private void OnDrawGizmos()
    //    {
    //        Gizmos.color = Color.green;
    //        Gizmos.DrawSphere(transform.position, 1);
    //    }

    public void Refresh()
    {
        BuildingInfo info = CityManager.Instance.GetBuildingByConfigID(_buildingCfgID);

        _currentInfo = info;

        if (_currentInfo != null)
        {
            EntityID = _currentInfo.EntityID;
            if (_currentInfo.IsInBuilding())
            {
                AddBuildingEffect();
            }
            else
            {
                RemoveBulidingEffect();
            }

            if (_hasLock)
            {
                MeshRenderer render = GetComponent <MeshRenderer>();
                if (render != null)
                {
                    render.material.shader = Shader.Find("Mobile/Diffuse");
                }
            }

            TroopBuildingInfo tbinfo = _currentInfo as TroopBuildingInfo;
            if (tbinfo != null)
            {
                if (tbinfo.SoldierConfigID != 0 && tbinfo.SoldierCount > 0)
                {
                    if (_goSoldier == null)
                    {
                        GameObject prefab = null;
                        if (tbinfo.SoldierConfigID == 1)
                        {
                            prefab = Resources.Load <GameObject>("Effect/bingying_daobing");
                        }
                        else if (tbinfo.SoldierConfigID == 2)
                        {
                            prefab = Resources.Load <GameObject>("Effect/bingying_qibing");
                        }
                        else if (tbinfo.SoldierConfigID == 3)
                        {
                            prefab = Resources.Load <GameObject>("Effect/bingying_daobing");
                        }
                        else if (tbinfo.SoldierConfigID == 4)
                        {
                            prefab = Resources.Load <GameObject>("Effect/bingying_gongbing");
                        }
                        if (prefab != null)
                        {
                            _goSoldier = Instantiate(prefab);
                            _goSoldier.transform.position = transform.position;
                        }
                    }
                }
                else
                {
                    if (_goSoldier != null)
                    {
                        Destroy(_goSoldier);
                        _goSoldier = null;
                    }
                }
            }
        }
        else
        {
            if (!_hasLock)
            {
                _hasLock = true;
                MeshRenderer render = GetComponent <MeshRenderer>();
                if (render != null)
                {
                    Material mat = new Material(render.material);
                    mat.shader      = Shader.Find("Shader/GrayScale");
                    render.material = mat;
                }
            }
        }
    }
Пример #19
0
    public void OnClick()
    {
        if (_currentInfo == null)
        {
            // 如果尚未获得此建筑,建筑尚未解锁,则提示解锁等级
            BuildingConstConfig cfg = BuildingConstConfigLoader.GetConfig(_buildingCfgID);
            if (cfg != null)
            {
                UIUtil.ShowMsgFormat("MSG_CITY_BUILDING_UNLOCK", cfg.UnlockHomeLevelDemand);
            }
        }
        else
        {
            if (_currentInfo.IsInBuilding())
            {
                UIManager.Instance.OpenWindow <UICityBuildingMenuView>(_currentInfo, this, Parent);
                return;
            }

            if (_currentInfo.BuildingType == CityBuildingType.TRAIN)
            {
                TrainBuildingInfo tbinfo = _currentInfo as TrainBuildingInfo;
                if (tbinfo != null && tbinfo.IsTrainingSoldier())
                {
                    // 校场正在训练士兵
                    UIManager.Instance.OpenWindow <UICityTrainMenuView>(_currentInfo, this, Parent);
                    return;
                }
            }
            else if (_currentInfo.BuildingType == CityBuildingType.TROOP)
            {
                // 兵营正在生产士兵
                TroopBuildingInfo tbinfo = _currentInfo as TroopBuildingInfo;
                if (tbinfo != null && tbinfo.IsProducingSoldier())
                {
                    UIManager.Instance.OpenWindow <UICityBuildingMenuView>(_currentInfo, this, Parent);
                    return;
                }
            }

            // 正常逻辑
            switch (_currentInfo.BuildingType)
            {
            case CityBuildingType.HOUSE:
            case CityBuildingType.WOOD:
            case CityBuildingType.STONE:
                OnClickProduce();
                break;

            case CityBuildingType.MONEY_STORAGE:
            case CityBuildingType.STONE_STORAGE:
            case CityBuildingType.WOOD_STORAGE:
                OnClickBuilding();
                break;

            case CityBuildingType.PALACE:
                OnClickPalace();
                break;

            case CityBuildingType.TRAIN:
                OnClickTrain();
                break;

            case CityBuildingType.TROOP:
                OnClickTroop();
                break;

            case CityBuildingType.SMITHY:
                OnClickSmithy();
                break;

            case CityBuildingType.COLLEGE:
                OnClickCollege();
                break;
            }
        }
    }