示例#1
0
        /// <summary>
        ///     Destructs this instance.
        /// </summary>
        public void Destruct()
        {
            if (this._level != null)
            {
                this._level.Destruct();
                this._level = null;
            }

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

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

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

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

            this._configuration = null;
        }
示例#2
0
        public void LoadNpcDuelState(LogicClientHome home, LogicAvatar homeOwnerAvatar, LogicAvatar visitorAvatar, int currentTimestamp, int secondsSinceLastSave)
        {
            if (this.m_state != 0)
            {
                Debugger.Error("loadNpcDuelState called from invalid state");
            }
            else
            {
                this.m_state          = 2;
                this.m_startTimestamp = currentTimestamp;
                this.m_configuration.Load((LogicJSONObject)LogicJSONParser.Parse(home.GetGlobalJSON()));
                this.m_calendar.Load(home.GetCalendarJSON(), currentTimestamp);

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

                this.m_level.SetMatchType(9, null);
                this.m_level.SetVillageType(1);
                this.m_level.SetHome(home, false);
                this.m_level.SetHomeOwnerAvatar(homeOwnerAvatar);
                this.m_level.SetVisitorAvatar(visitorAvatar);
                this.m_level.FastForwardTime(secondsSinceLastSave);
                this.m_level.LoadingFinished();

                this.m_replay = new LogicReplay(this.m_level);
            }
        }
示例#3
0
        public void LoadDirectAttackState(LogicClientHome home, LogicAvatar homeOwnerAvatar, LogicAvatar visitorAvatar, int secondsSinceLastSave, bool war, bool village2,
                                          int currentTimestamp)
        {
            if (this.m_state != 0)
            {
                Debugger.Error("loadAttackState called from invalid state");
            }

            this.m_state          = 2;
            this.m_startTimestamp = currentTimestamp;
            this.m_configuration.Load((LogicJSONObject)LogicJSONParser.Parse(home.GetGlobalJSON()));
            this.m_calendar.Load(home.GetCalendarJSON(), currentTimestamp);

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

            this.m_battleTimer = new LogicTimer();
            this.m_battleTimer.StartTimer(
                LogicDataTables.GetGlobals().GetAttackLengthSecs() + (village2
                    ? LogicDataTables.GetGlobals().GetAttackVillage2PreparationLengthSecs()
                    : LogicDataTables.GetGlobals().GetAttackPreparationLengthSecs()),
                this.m_level.GetLogicTime(), false, -1);

            if (!homeOwnerAvatar.IsClientAvatar())
            {
                Debugger.Error("loadDirectAttackState called and home owner is not client avatar");
            }

            this.m_level.SetMatchType(village2 ? 8 : war ? 7 : 3, null);

            if (village2)
            {
                this.m_level.SetVillageType(1);
            }

            this.m_level.SetHome(home, false);
            this.m_level.SetHomeOwnerAvatar(homeOwnerAvatar);

            homeOwnerAvatar.SetLevel(this.m_level);

            this.m_level.SetVisitorAvatar(visitorAvatar);
            this.m_level.FastForwardTime(secondsSinceLastSave);
            this.m_level.LoadingFinished();
            this.m_replay = new LogicReplay(this.m_level);
        }
示例#4
0
        public void Destruct()
        {
            this.m_level.Destruct();
            this.m_commandManager.Destruct();
            this.m_calendar.Destruct();

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

            if (this.m_replay != null)
            {
                this.m_replay.Destruct();
                this.m_replay = null;
            }
        }
示例#5
0
 public void Dispose()
 {
     Replay   = null;
     Defender = null;
 }