示例#1
0
        public override bool MoveHero(HeroInterface Hero, AbstractField Previous)
        {
            if (NextInChain == null || Hero == null)
            {
                return(false);
            }
            if (!this.State.EnterField(this, Hero))
            {
                if (Previous != null)
                {
                    Previous.SetHero(Hero);
                }
                return(false);
            }

            Thread.Sleep(1000);

            this.Notify();

            this.Hero = null;

            if (Hero.IsDead())
            {
                Console.WriteLine("Field::Hero died");
                return(true);
            }
            else
            {
                return(this.NextInChain.MoveHero(Hero, this));
            }
        }
示例#2
0
        public override bool MoveHero(HeroInterface Hero, AbstractField Previous)
        {
            bool Result = false;

            if (Previous != null && Hero != null)
            {
                Previous.SetHero(Hero);
                Result = true;
            }
            return(Result);
        }
示例#3
0
 public abstract void SetNextInChain(AbstractField Next);
示例#4
0
 public abstract bool MoveHero(HeroInterface Hero, AbstractField Previous);
示例#5
0
 public override void SetNextInChain(AbstractField Next)
 {
     this.NextInChain = Next;
 }
示例#6
0
 public override void SetNextInChain(AbstractField Next)
 {
 }