示例#1
0
        public void ProductionCompleted()
        {
            this.m_unit.SetCount(this.GetMaxUnitsInCamp((LogicCharacterData)this.m_unit.GetData()));

            if (this.m_productionTimer != null)
            {
                this.m_productionTimer.Destruct();
                this.m_productionTimer = null;
            }

            LogicAvatar         homeOwnerAvatar = this.m_parent.GetLevel().GetHomeOwnerAvatar();
            LogicCombatItemData combatItemData  = (LogicCombatItemData)this.m_unit.GetData();

            int unitCount = this.m_parent.GetLevel().GetMissionManager().IsVillage2TutorialOpen()
                ? this.m_unit.GetCount() - homeOwnerAvatar.GetUnitCountVillage2(combatItemData)
                : this.m_unit.GetCount();

            homeOwnerAvatar.CommodityCountChangeHelper(7, this.m_unit.GetData(), unitCount);

            if (this.m_parent.GetLevel().GetGameListener() != null)
            {
                // ?
            }

            int state = this.m_parent.GetLevel().GetState();

            if (state == 1)
            {
                if (this.m_parent.GetListener() != null)
                {
                    // ?
                }
            }
        }
        /// <summary>
        ///     Called when the training of the unit is finished.
        /// </summary>
        public void TrainingFinished()
        {
            this._unit.SetCount(this.GetMaxCapacity());

            if (this._trainingTimer != null)
            {
                this._trainingTimer.Destruct();
                this._trainingTimer = null;
            }

            LogicAvatar         homeOwnerAvatar = this._parent.GetLevel().GetHomeOwnerAvatar();
            LogicCombatItemData combatItemData  = (LogicCombatItemData)this._unit.GetData();

            int unitCount = this._parent.GetLevel().GetMissionManager().IsVillage2TutorialOpen()
                ? this._unit.GetCount() - homeOwnerAvatar.GetUnitCountVillage2(combatItemData)
                : this._unit.GetCount();

            homeOwnerAvatar.CommodityCountChangeHelper(7, this._unit.GetData(), unitCount);

            if (this._parent.GetLevel().GetGameListener() != null)
            {
                // ?
            }

            int state = this._parent.GetLevel().GetState();

            if (state == 1)
            {
                if (this._parent.GetListener() != null)
                {
                    // ?
                }
            }
        }