Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        public override void Dispose()
        {
            Fight     = null;
            Team      = null;
            Cell      = null;
            Invocator = null;

            if (SpellManager != null)
            {
                SpellManager.Dispose();
                SpellManager = null;
            }
            if (StateManager != null)
            {
                StateManager.Dispose();
                StateManager = null;
            }
            if (BuffManager != null)
            {
                BuffManager.Dispose();
                BuffManager = null;
            }

            base.Dispose();
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        public virtual void EndFight(bool win = false)
        {
            if (!IsSpectating)
            {
                Team.RemoveFighter(this);
                Team.RemoveUpdatable(this);
                Team.RemoveHandler(Dispatch);

                Fight.TurnProcessor.RemoveFighter(this);

                Statistics.ClearDons();
            }

            SetChatChannel(ChatChannelEnum.CHANNEL_TEAM, () => null);
            SetChatChannel(ChatChannelEnum.CHANNEL_GENERAL, () => MovementHandler == null ? default(Action <string>) : MovementHandler.Dispatch);
            StopAction(GameActionTypeEnum.FIGHT);

            if (SpellManager != null)
            {
                SpellManager.Dispose();
                SpellManager = null;
            }
            if (StateManager != null)
            {
                StateManager.Dispose();
                StateManager = null;
            }
            if (BuffManager != null)
            {
                BuffManager.Dispose();
                BuffManager = null;
            }

            SetCell(null);
            Team           = null;
            Fight          = null;
            IsSpectating   = false;
            IsDisconnected = false;
            TurnPass       = false;
            TurnReady      = false;
            Invocator      = null;
        }