Beispiel #1
0
        public int GetTotalSeconds()
        {
            LogicUnitProductionSlot slot = null;

            for (int i = 0; i < this.m_slots.Size(); i++)
            {
                LogicUnitProductionSlot tmp = this.m_slots[i];

                if (!tmp.IsTerminate())
                {
                    slot = tmp;
                    break;
                }
            }

            if (slot != null)
            {
                LogicAvatar         homeOwnerAvatar = this.m_level.GetHomeOwnerAvatar();
                LogicCombatItemData data            = (LogicCombatItemData)slot.GetData();

                return(data.GetTrainingTime(homeOwnerAvatar.GetUnitUpgradeLevel(data), this.m_level, 0));
            }

            return(0);
        }
        /// <summary>
        ///     Speed up the unit production.
        /// </summary>
        public void SpeedUp()
        {
            LogicAvatar           homeOwnerAvatar  = this._level.GetHomeOwnerAvatar();
            LogicComponentManager componentManager = this._level.GetComponentManagerAt(this._villageType);
            Int32 totalMaxHousing   = componentManager.GetTotalMaxHousing(this._unitProductionType != 3 ? 1 : 0);
            Int32 totalUsedCapacity = this._unitProductionType == 3 ? homeOwnerAvatar.GetUnitsTotalCapacity() : homeOwnerAvatar.GetSpellsTotalCapacity();
            Int32 freeCapacity      = totalMaxHousing - totalUsedCapacity;

            while (this._slots.Count > 0)
            {
                LogicUnitProductionSlot slot = this._slots[0];
                LogicCombatItemData     data = (LogicCombatItemData)slot.GetData();
                Int32 count = slot.GetCount();

                if (count > 0)
                {
                    do
                    {
                        freeCapacity -= data.GetHousingSpace();

                        if (freeCapacity < 0)
                        {
                            return;
                        }

                        this.ProductionCompleted(true);
                    } while (--count > 0);
                }
                else
                {
                    break;
                }
            }
        }
Beispiel #3
0
        public bool TrainingFinished()
        {
            bool success = false;

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

            if (this.m_slots.Size() > 0)
            {
                LogicUnitProductionSlot prodSlot = this.GetCurrentlyTrainedSlot();
                int prodIdx = this.GetCurrentlyTrainedIndex();

                if (prodSlot != null)
                {
                    if (prodSlot.GetCount() == 1)
                    {
                        prodSlot.SetTerminate(true);
                    }
                    else
                    {
                        prodSlot.SetCount(prodSlot.GetCount() - 1);

                        LogicUnitProductionSlot previousSlot = this.m_slots[LogicMath.Max(prodIdx - 1, 0)];

                        if (previousSlot != null &&
                            previousSlot.IsTerminate() &&
                            previousSlot.GetData().GetGlobalID() == prodSlot.GetData().GetGlobalID())
                        {
                            previousSlot.SetCount(previousSlot.GetCount() + 1);
                        }
                        else
                        {
                            this.m_slots.Add(prodIdx, new LogicUnitProductionSlot(prodSlot.GetData(), 1, true));
                        }
                    }
                }

                if (this.m_slots.Size() > 0)
                {
                    LogicCombatItemData nextProductionData = this.GetCurrentlyTrainedUnit();

                    if (nextProductionData != null && this.m_timer == null)
                    {
                        this.m_timer = new LogicTimer();
                        this.m_timer.StartTimer(nextProductionData.GetTrainingTime(this.m_level.GetHomeOwnerAvatar().GetUnitUpgradeLevel(nextProductionData), this.m_level, 0),
                                                this.m_level.GetLogicTime(), false, -1);
                        success = true;
                    }
                }
            }

            this.MergeSlots();

            return(success);
        }
        /// <summary>
        ///     Tries to merge slots.
        /// </summary>
        public void MergeSlots()
        {
            LogicAvatar homeOwnerAvatar = this._level.GetHomeOwnerAvatar();

            if (this._slots.Count > 0)
            {
                if (this._slots.Count > 1)
                {
                    for (int i = 1; i < this._slots.Count; i++)
                    {
                        LogicUnitProductionSlot slot1 = this._slots[i];
                        LogicUnitProductionSlot slot2 = this._slots[i - 1];

                        if (slot1.GetData() == slot2.GetData())
                        {
                            if (slot1.IsTerminate() == slot2.IsTerminate())
                            {
                                this._slots.Remove(i--);
                                slot2.SetCount(slot2.GetCount() + slot1.GetCount());
                                slot1.Destruct();
                                slot1 = null;
                            }
                        }
                    }
                }
            }

            LogicComponentManager componentManager = this._level.GetComponentManagerAt(this._villageType);
            Int32 totalCapcity = componentManager.GetTotalMaxHousing(this._unitProductionType != 3 ? 1 : 0);
            Int32 usedCapacity = this._unitProductionType == 25 ? homeOwnerAvatar.GetSpellsTotalCapacity() : homeOwnerAvatar.GetUnitsTotalCapacity();
            Int32 freeCapacity = totalCapcity - usedCapacity;

            for (int i = 0; i < this._slots.Count; i++)
            {
                LogicUnitProductionSlot slot = this._slots[i];
                LogicCombatItemData     data = (LogicCombatItemData)slot.GetData();

                int housingSpace = data.GetHousingSpace() * slot.GetCount();

                if (freeCapacity < housingSpace)
                {
                    if (slot.GetCount() > 0 && housingSpace / data.GetHousingSpace() > 0)
                    {
                        if (slot.GetCount() > housingSpace / data.GetHousingSpace())
                        {
                            this._slots.Add(i + 1, new LogicUnitProductionSlot(data, slot.GetCount() - housingSpace / data.GetHousingSpace(), slot.IsTerminate()));
                        }
                    }

                    break;
                }

                freeCapacity -= housingSpace;
            }
        }
Beispiel #5
0
        public LogicCombatItemData GetWaitingForSpaceUnit()
        {
            if (this.m_slots.Size() > 0)
            {
                LogicUnitProductionSlot slot = this.m_slots[0];

                if (slot.IsTerminate() || this.m_timer != null && this.m_timer.GetRemainingSeconds(this.m_level.GetLogicTime()) == 0)
                {
                    return((LogicCombatItemData)slot.GetData());
                }
            }

            return(null);
        }
Beispiel #6
0
        public int GetTotalCount()
        {
            int count = 0;

            for (int i = 0; i < this.m_slots.Size(); i++)
            {
                LogicUnitProductionSlot slot = this.m_slots[i];
                LogicCombatItemData     data = (LogicCombatItemData)slot.GetData();

                count += data.GetHousingSpace() * slot.GetCount();
            }

            return(count);
        }
Beispiel #7
0
        public int AddUnitToQueue(LogicCombatItemData data)
        {
            if (data != null)
            {
                if (this.CanAddUnitToQueue(data, false))
                {
                    LogicAvatar homeOwnerAvatar = this.m_level.GetHomeOwnerAvatar();

                    for (int i = this.m_slots.Size() - 1; i >= 0; i--)
                    {
                        LogicUnitProductionSlot tmp = this.m_slots[i];

                        if (tmp != null)
                        {
                            if (tmp.GetData() == data)
                            {
                                tmp.SetCount(tmp.GetCount() + 1);
                                this.MergeSlots();

                                return(i);
                            }

                            break;
                        }
                    }

                    this.m_slots.Add(new LogicUnitProductionSlot(data, 1, false));
                    this.MergeSlots();

                    if (this.m_slots.Size() > 0)
                    {
                        LogicCombatItemData productionData = this.GetCurrentlyTrainedUnit();

                        if (productionData != null && this.m_timer == null)
                        {
                            this.m_timer = new LogicTimer();
                            this.m_timer.StartTimer(productionData.GetTrainingTime(homeOwnerAvatar.GetUnitUpgradeLevel(productionData), this.m_level, 0),
                                                    this.m_level.GetLogicTime(), false, -1);
                        }
                    }
                }
            }
            else
            {
                Debugger.Error("LogicUnitProduction - Trying to add NULL character!");
            }

            return(-1);
        }
Beispiel #8
0
        public void Save(LogicJSONObject root)
        {
            LogicJSONObject jsonObject = new LogicJSONObject();

            if (this.m_timer != null)
            {
                jsonObject.Put("t", new LogicJSONNumber(this.m_timer.GetRemainingSeconds(this.m_level.GetLogicTime())));
            }

            if (this.m_slots.Size() > 0)
            {
                LogicJSONArray slotArray = new LogicJSONArray();

                for (int i = 0; i < this.m_slots.Size(); i++)
                {
                    LogicUnitProductionSlot slot = this.m_slots[i];

                    if (slot != null)
                    {
                        LogicJSONObject slotObject = new LogicJSONObject();

                        slotObject.Put("id", new LogicJSONNumber(slot.GetData().GetGlobalID()));
                        slotObject.Put("cnt", new LogicJSONNumber(slot.GetCount()));

                        if (slot.IsTerminate())
                        {
                            slotObject.Put("t", new LogicJSONBoolean(true));
                        }

                        slotArray.Add(slotObject);
                    }
                }

                jsonObject.Put("slots", slotArray);
            }

            if (this.m_boostTimer != null)
            {
                jsonObject.Put("boost_t", new LogicJSONNumber(this.m_boostTimer.GetRemainingSeconds(this.m_level.GetLogicTime())));
            }

            if (this.m_boostPause)
            {
                jsonObject.Put("boost_pause", new LogicJSONBoolean(true));
            }

            root.Put("unit_prod", jsonObject);
        }
Beispiel #9
0
        public bool DragSlot(int slotIdx, int dragIdx)
        {
            this.m_locked = false;

            if (slotIdx > -1 && slotIdx < this.m_slots.Size())
            {
                LogicCombatItemData     productionData = this.GetCurrentlyTrainedUnit();
                LogicUnitProductionSlot slot           = this.m_slots[slotIdx];

                this.m_slots.Remove(slotIdx);

                if (slot != null)
                {
                    if (slotIdx <= dragIdx)
                    {
                        dragIdx -= 1;
                    }

                    if (dragIdx >= 0 && dragIdx <= this.m_slots.Size())
                    {
                        this.m_slots.Add(dragIdx, slot);
                        this.MergeSlots();

                        LogicCombatItemData prodData = this.GetCurrentlyTrainedUnit();
                        int prodIdx = this.GetCurrentlyTrainedIndex();

                        if (productionData != prodData && (dragIdx >= prodIdx || prodIdx == slotIdx || prodIdx == dragIdx + 1))
                        {
                            if (this.m_timer != null)
                            {
                                this.m_timer.Destruct();
                                this.m_timer = null;
                            }

                            LogicAvatar homeOwnerAvatar = this.m_level.GetHomeOwnerAvatar();

                            this.m_timer = new LogicTimer();
                            this.m_timer.StartTimer(prodData.GetTrainingTime(homeOwnerAvatar.GetUnitUpgradeLevel(prodData), this.m_level, 0),
                                                    this.m_level.GetLogicTime(), false, -1);
                        }
                    }

                    return(true);
                }
            }

            return(false);
        }
Beispiel #10
0
        public int GetTotalRemainingSeconds()
        {
            LogicAvatar           homeOwnerAvatar  = this.m_level.GetHomeOwnerAvatar();
            LogicComponentManager componentManager = this.m_level.GetComponentManagerAt(this.m_villageType);

            int totalMaxHousing   = componentManager.GetTotalMaxHousing(this.m_unitProductionType != LogicDataType.CHARACTER ? 1 : 0);
            int totalUsedCapacity = this.m_unitProductionType == LogicDataType.CHARACTER ? homeOwnerAvatar.GetUnitsTotalCapacity() : homeOwnerAvatar.GetSpellsTotalCapacity();
            int freeCapacity      = totalMaxHousing - totalUsedCapacity;
            int remainingSecs     = 0;

            for (int i = 0; i < this.m_slots.Size(); i++)
            {
                LogicUnitProductionSlot slot = this.m_slots[i];
                LogicCombatItemData     data = (LogicCombatItemData)slot.GetData();
                int housingSpace             = data.GetHousingSpace();
                int count = slot.GetCount();

                if (count > 0)
                {
                    if (i == 0)
                    {
                        if (!slot.IsTerminate() && freeCapacity - housingSpace >= 0)
                        {
                            if (this.m_timer != null)
                            {
                                remainingSecs += this.m_timer.GetRemainingSeconds(this.m_level.GetLogicTime());
                            }
                        }

                        freeCapacity -= housingSpace;
                        count        -= 1;
                    }

                    for (int j = 0; j < count; j++)
                    {
                        if (!slot.IsTerminate() && freeCapacity - housingSpace >= 0)
                        {
                            remainingSecs += data.GetTrainingTime(homeOwnerAvatar.GetUnitUpgradeLevel(data), this.m_level, 0);
                        }

                        freeCapacity -= housingSpace;
                    }
                }
            }

            return(remainingSecs);
        }
Beispiel #11
0
        public int GetWaitingForSpaceUnitCount(LogicCombatItemData data)
        {
            int count = 0;

            for (int i = 0; i < this.m_slots.Size(); i++)
            {
                LogicUnitProductionSlot slot = this.m_slots[i];

                if (slot.GetData() == data)
                {
                    if (slot.IsTerminate())
                    {
                        count += slot.GetCount();
                    }
                }
            }

            return(count);
        }
Beispiel #12
0
        public void RemoveTrainedUnit(LogicCombatItemData data)
        {
            int idx = -1;

            for (int i = 0; i < this.m_slots.Size(); i++)
            {
                if (this.m_slots[i].GetData() == data)
                {
                    if (this.m_slots[i].IsTerminate())
                    {
                        idx = i;
                        break;
                    }
                }
            }

            if (idx != -1)
            {
                LogicUnitProductionSlot slot = this.m_slots[idx];

                if (slot.GetCount() > 1)
                {
                    slot.SetCount(slot.GetCount() - 1);
                }
                else
                {
                    this.m_slots.Remove(idx);

                    slot.Destruct();
                    slot = null;
                }

                this.MergeSlots();

                if (this.GetWaitingForSpaceUnit() != null)
                {
                    this.ProductionCompleted(false);
                }
            }
        }
Beispiel #13
0
        public void SpeedUp()
        {
            LogicAvatar           homeOwnerAvatar  = this.m_level.GetHomeOwnerAvatar();
            LogicComponentManager componentManager = this.m_level.GetComponentManagerAt(this.m_villageType);

            int totalMaxHousing   = componentManager.GetTotalMaxHousing(this.m_unitProductionType != LogicDataType.CHARACTER ? 1 : 0);
            int totalUsedCapacity = this.m_unitProductionType == LogicDataType.CHARACTER ? homeOwnerAvatar.GetUnitsTotalCapacity() : homeOwnerAvatar.GetSpellsTotalCapacity();
            int freeCapacity      = totalMaxHousing - totalUsedCapacity;

            bool armyCampFull = false;

            while (!armyCampFull && this.m_slots.Size() > 0)
            {
                LogicUnitProductionSlot slot = this.m_slots[0];
                LogicCombatItemData     data = (LogicCombatItemData)slot.GetData();

                int count = slot.GetCount();

                if (count <= 0)
                {
                    break;
                }

                armyCampFull = true;

                do
                {
                    freeCapacity -= data.GetHousingSpace();

                    if (freeCapacity >= 0)
                    {
                        this.ProductionCompleted(true);
                        armyCampFull = false;
                    }
                } while (--count > 0);
            }
        }
Beispiel #14
0
        public void FastForwardTime(int secs)
        {
            if (this.m_boostTimer != null && !this.m_boostPause)
            {
                int remainingSecs = this.m_boostTimer.GetRemainingSeconds(this.m_level.GetLogicTime());

                if (remainingSecs <= secs)
                {
                    this.m_boostTimer.Destruct();
                    this.m_boostTimer = null;
                }
                else
                {
                    this.m_boostTimer.StartTimer(remainingSecs - secs, this.m_level.GetLogicTime(), false, -1);
                }
            }

            if (this.GetRemainingBoostTimeSecs() > 0)
            {
                if (this.GetBoostMultiplier() >= 2 && !this.IsBoostPaused())
                {
                    secs = LogicMath.Min(secs, this.GetRemainingBoostTimeSecs()) * (this.GetBoostMultiplier() - 1) + secs;
                }

                if (this.m_timer != null)
                {
                    if (!this.IsBoostPaused())
                    {
                        this.m_timer.FastForwardSubticks(4 * this.GetBoostMultiplier() - 4);
                    }
                }
            }

            do
            {
                if (secs <= 0)
                {
                    break;
                }

                LogicUnitProductionSlot productionSlot = this.GetCurrentlyTrainedSlot();

                if (productionSlot == null)
                {
                    break;
                }

                if (this.m_timer == null)
                {
                    LogicCombatItemData productionData = (LogicCombatItemData)productionSlot.GetData();

                    this.m_timer = new LogicTimer();
                    this.m_timer.StartTimer(productionData.GetTrainingTime(this.m_level.GetHomeOwnerAvatar().GetUnitUpgradeLevel(productionData), this.m_level, 0),
                                            this.m_level.GetLogicTime(), false, -1);
                }

                int remainingSecs = this.m_timer.GetRemainingSeconds(this.m_level.GetLogicTime());

                if (secs < remainingSecs)
                {
                    this.m_timer.StartTimer(remainingSecs - secs, this.m_level.GetLogicTime(), false, -1);
                    break;
                }

                secs -= remainingSecs;
                this.m_timer.StartTimer(0, this.m_level.GetLogicTime(), false, -1);
            } while (this.ProductionCompleted(false));
        }
Beispiel #15
0
        public void MergeSlots()
        {
            LogicAvatar homeOwnerAvatar = this.m_level.GetHomeOwnerAvatar();

            if (this.m_slots.Size() > 0)
            {
                if (this.m_slots.Size() > 1)
                {
                    for (int i = 1; i < this.m_slots.Size(); i++)
                    {
                        LogicUnitProductionSlot slot1 = this.m_slots[i];
                        LogicUnitProductionSlot slot2 = this.m_slots[i - 1];

                        if (slot1.GetData() == slot2.GetData())
                        {
                            if (slot1.IsTerminate() == slot2.IsTerminate())
                            {
                                this.m_slots.Remove(i--);

                                slot2.SetCount(slot2.GetCount() + slot1.GetCount());
                                slot1.Destruct();
                                slot1 = null;
                            }
                        }
                    }
                }
            }

            LogicComponentManager componentManager = this.m_level.GetComponentManagerAt(this.m_villageType);

            int usedCapacity  = this.m_unitProductionType == LogicDataType.SPELL ? homeOwnerAvatar.GetSpellsTotalCapacity() : homeOwnerAvatar.GetUnitsTotalCapacity();
            int totalCapacity = componentManager.GetTotalMaxHousing(this.m_unitProductionType != LogicDataType.CHARACTER ? 1 : 0);
            int freeCapacity  = totalCapacity - usedCapacity;

            for (int i = 0, j = freeCapacity; i < this.m_slots.Size(); i++)
            {
                LogicUnitProductionSlot slot = this.m_slots[i];
                LogicCombatItemData     data = (LogicCombatItemData)slot.GetData();

                int count        = slot.GetCount();
                int housingSpace = data.GetHousingSpace() * count;

                if (j < housingSpace)
                {
                    if (count > 1)
                    {
                        int maxInProduction = j / data.GetHousingSpace();

                        if (maxInProduction > 0)
                        {
                            int inQueue = count - maxInProduction;

                            if (inQueue > 0)
                            {
                                slot.SetCount(maxInProduction);
                                this.m_slots.Add(i + 1, new LogicUnitProductionSlot(data, inQueue, slot.IsTerminate()));
                            }
                        }
                    }

                    break;
                }

                j -= housingSpace;
            }
        }
Beispiel #16
0
        public bool RemoveUnit(LogicCombatItemData data, int index)
        {
            LogicUnitProductionSlot slot = null;
            bool removed = false;

            if (index > -1 &&
                this.m_slots.Size() > index &&
                this.m_slots[index].GetData() == data)
            {
                slot = this.m_slots[index];
            }
            else
            {
                index = -1;

                for (int i = 0; i < this.m_slots.Size(); i++)
                {
                    LogicUnitProductionSlot tmp = this.m_slots[i];

                    if (tmp.GetData() == data)
                    {
                        index = i;
                        break;
                    }
                }

                if (index == -1)
                {
                    return(false);
                }

                slot = this.m_slots[index];
            }

            int count = slot.GetCount();

            if (count > 0)
            {
                removed = true;
                slot.SetCount(count - 1);

                if (count == 1)
                {
                    int prodIdx = this.GetCurrentlyTrainedIndex();

                    if (prodIdx == index)
                    {
                        if (this.m_timer != null)
                        {
                            this.m_timer.Destruct();
                            this.m_timer = null;
                        }
                    }

                    this.m_slots[index].Destruct();
                    this.m_slots.Remove(index);
                }
            }

            if (this.m_slots.Size() > 0)
            {
                LogicUnitProductionSlot productionSlot = this.GetCurrentlyTrainedSlot();

                if (productionSlot == null || this.m_timer != null)
                {
                    if (!removed)
                    {
                        return(false);
                    }

                    this.MergeSlots();
                }
                else
                {
                    LogicAvatar         homeOwnerAvatar = this.m_level.GetHomeOwnerAvatar();
                    LogicCombatItemData productionData  = (LogicCombatItemData)productionSlot.GetData();

                    this.m_timer = new LogicTimer();
                    this.m_timer.StartTimer(productionData.GetTrainingTime(homeOwnerAvatar.GetUnitUpgradeLevel(productionData), this.m_level, 0), this.m_level.GetLogicTime(),
                                            false,
                                            -1);

                    if (removed)
                    {
                        this.MergeSlots();
                    }
                }
            }
            else
            {
                if (!removed)
                {
                    return(false);
                }

                this.MergeSlots();
            }

            return(true);
        }
Beispiel #17
0
        public void Load(LogicJSONObject root)
        {
            if (this.m_timer != null)
            {
                this.m_timer.Destruct();
                this.m_timer = null;
            }

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

            for (int i = this.m_slots.Size() - 1; i >= 0; i--)
            {
                this.m_slots[i].Destruct();
                this.m_slots.Remove(i);
            }

            LogicJSONObject jsonObject = root.GetJSONObject("unit_prod");

            if (jsonObject != null)
            {
                LogicJSONArray slotArray = jsonObject.GetJSONArray("slots");

                if (slotArray != null)
                {
                    for (int i = 0; i < slotArray.Size(); i++)
                    {
                        LogicJSONObject slotObject = slotArray.GetJSONObject(i);

                        if (slotObject != null)
                        {
                            LogicJSONNumber dataObject = slotObject.GetJSONNumber("id");

                            if (dataObject != null)
                            {
                                LogicData data = LogicDataTables.GetDataById(dataObject.GetIntValue());

                                if (data != null)
                                {
                                    LogicJSONNumber  countObject   = slotObject.GetJSONNumber("cnt");
                                    LogicJSONBoolean termineObject = slotObject.GetJSONBoolean("t");

                                    if (countObject != null)
                                    {
                                        if (countObject.GetIntValue() > 0)
                                        {
                                            LogicUnitProductionSlot slot = new LogicUnitProductionSlot(data, countObject.GetIntValue(), false);

                                            if (termineObject != null)
                                            {
                                                slot.SetTerminate(termineObject.IsTrue());
                                            }

                                            this.m_slots.Add(slot);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                if (this.m_slots.Size() > 0)
                {
                    LogicUnitProductionSlot slot = this.GetCurrentlyTrainedSlot();

                    if (slot != null)
                    {
                        LogicJSONNumber timeObject = jsonObject.GetJSONNumber("t");

                        if (timeObject != null)
                        {
                            this.m_timer = new LogicTimer();
                            this.m_timer.StartTimer(timeObject.GetIntValue(), this.m_level.GetLogicTime(), false, -1);
                        }
                        else
                        {
                            LogicCombatItemData combatItemData = (LogicCombatItemData)slot.GetData();
                            LogicAvatar         avatar         = this.m_level.GetHomeOwnerAvatar();
                            int upgradeLevel = 0;

                            if (avatar != null)
                            {
                                upgradeLevel = avatar.GetUnitUpgradeLevel(combatItemData);
                            }

                            this.m_timer = new LogicTimer();
                            this.m_timer.StartTimer(combatItemData.GetTrainingTime(upgradeLevel, this.m_level, 0), this.m_level.GetLogicTime(), false, -1);

                            Debugger.Print("LogicUnitProduction::load null timer, restart: " + this.m_timer.GetRemainingSeconds(this.m_level.GetLogicTime()));
                        }
                    }
                }

                LogicJSONNumber boostTimeObject = jsonObject.GetJSONNumber("boost_t");

                if (boostTimeObject != null)
                {
                    this.m_boostTimer = new LogicTimer();
                    this.m_boostTimer.StartTimer(boostTimeObject.GetIntValue(), this.m_level.GetLogicTime(), false, -1);
                }

                LogicJSONBoolean boostPauseObject = jsonObject.GetJSONBoolean("boost_pause");

                if (boostPauseObject != null)
                {
                    this.m_boostPause = boostPauseObject.IsTrue();
                }
            }
            else
            {
                Debugger.Warning("LogicUnitProduction::load - Component wasn't found from the JSON");
            }
        }