public void Move(Direction direction) { var obj = _currentCell[direction]; if (obj is IComplexModelBase nextCell) { nextCell.Content = _hero; _currentCell.Content = null; _currentCell = nextCell; } }
public MoveEngine(IHero hero, IMaze maze) { _hero = hero; _maze = maze; _currentCell = _maze.GetEnumerable().First(el => el.Content.ElementName == Keys.HeroKey); }