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)); } }
public override bool MoveHero(HeroInterface Hero, AbstractField Previous) { bool Result = false; if (Previous != null && Hero != null) { Previous.SetHero(Hero); Result = true; } return(Result); }
public abstract void SetNextInChain(AbstractField Next);
public abstract bool MoveHero(HeroInterface Hero, AbstractField Previous);
public override void SetNextInChain(AbstractField Next) { this.NextInChain = Next; }
public override void SetNextInChain(AbstractField Next) { }