Пример #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)
 {
 }