Zepheus.Zone.Game.ZoneCharacter.Update C# (CSharp) Method

Update() public method

public Update ( DateTime date ) : void
date DateTime
return void
        public override void Update(DateTime date)
        {
            if (AttackingSequence != null)
            {
                AttackingSequence.Update(date);
                if (AttackingSequence.State == AttackSequence.AnimationState.Ended)
                {
                    AttackingSequence = null;
                }
            }

            if (SelectedObject != null)
            {
                if (SelectedObject is Mob)
                {
                    if ((SelectedObject as Mob).IsDead) SelectedObject = null; // Stop the reference ffs
                }
            }

            if (State == PlayerState.Resting)
            {
                if (date >= NextHPRest)
                {
                    HealHP((uint)(MaxHP / 1000 * House.Info.HPRecovery));
                    //TODO: also show this to people who have me selected.
                    NextHPRest = date.AddMilliseconds(House.Info.HPTick);
                }
                if (date >= NextSPRest)
                {
                    HealSP((uint)(MaxSP / 1000 * House.Info.SPRecovery));
                    //TODO: also show this to people who have me selected.
                    NextSPRest = date.AddMilliseconds(House.Info.SPTick);
                }
            }
        }