private bool MoveCore(IGameEngineCore engine, Direction direction, Monster monster) { if (engine.Move(monster, direction)) return true; Point position = PointDirectionUtils.ConvertDirectionToDestinationPoint(monster.Position, direction); if (monster.Intelligent && engine.Operate(monster, position)) return true; return false; }
protected bool WanderRandomly(IGameEngineCore engine, Monster monster) { foreach (Direction d in DirectionUtils.GenerateRandomDirectionList()) { if (engine.Move(monster, d)) return true; } // If nothing else, 'wait' engine.Wait(monster); return false; }