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); }