コード例 #1
0
        public void Move(Direction direction)
        {
            var obj = _currentCell[direction];

            if (obj is IComplexModelBase nextCell)
            {
                nextCell.Content     = _hero;
                _currentCell.Content = null;
                _currentCell         = nextCell;
            }
        }
コード例 #2
0
 public MoveEngine(IHero hero, IMaze maze)
 {
     _hero        = hero;
     _maze        = maze;
     _currentCell = _maze.GetEnumerable().First(el => el.Content.ElementName == Keys.HeroKey);
 }