Exemplo n.º 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));
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public abstract void SetNextInChain(AbstractField Next);
Exemplo n.º 4
0
 public abstract bool MoveHero(HeroInterface Hero, AbstractField Previous);
Exemplo n.º 5
0
 public override void SetNextInChain(AbstractField Next)
 {
     this.NextInChain = Next;
 }
Exemplo n.º 6
0
 public override void SetNextInChain(AbstractField Next)
 {
 }