コード例 #1
0
ファイル: MazeGenerator.cs プロジェクト: Vinna/aura-old
        private bool MakeMove(int direction)
        {
            if (this.IsRoomInDirectionFree(_currentPos, direction))
            {
                var nextPos     = _currentPos.GetBiasedPosition(direction);
                var currentRoom = this.GetRoom(_currentPos);
                var nextRoom    = this.GetRoom(nextPos);
                var move        = new MazeMove(_currentPos, nextPos, direction);

                this.CriticalPath.Add(move);

                _counter++;

                nextRoom.VisitedCount     = _counter;
                nextRoom.IsOnCriticalPath = true;

                currentRoom.Directions[direction] = 1;
                nextRoom.Directions[Direction.GetOppositeDirection(direction)] = 2;

                _currentPos = nextPos;

                return(true);
            }

            return(false);
        }
コード例 #2
0
ファイル: MazeGenerator.cs プロジェクト: tkiapril/aura
		private bool MakeMove(int direction)
		{
			if (this.IsRoomInDirectionFree(_currentPos, direction))
			{
				var nextPos = _currentPos.GetBiasedPosition(direction);
				var currentRoom = this.GetRoom(_currentPos);
				var nextRoom = this.GetRoom(nextPos);
				var move = new MazeMove(_currentPos, nextPos, direction);

				this.CriticalPath.Add(move);

				_counter++;

				nextRoom.VisitedCount = _counter;
				nextRoom.IsOnCriticalPath = true;

				currentRoom.Directions[direction] = 1;
				nextRoom.Directions[Direction.GetOppositeDirection(direction)] = 2;

				_currentPos = nextPos;

				return true;
			}

			return false;
		}