Esempio n. 1
0
        private void InitializeSettings()
        {
            // Get and set the player name
            var playerName = _handleInput.GetPlayerName();

            _loadPlayer.GetPlayerInstance().Name = playerName;

            // Get size of the maze matrix
            _sizeOfMaze = _handleInput.GetSizeOfMaze();
            _mazeIntegration.BuildMaze(_sizeOfMaze);

            // Set player on the entrance room
            _loadPlayer.GetPlayerInstance().CurrentRoom =
                _loadMaze.GetMazeMapInstance().mazeRooms.Where(r => r.IsEntrance).FirstOrDefault();
            _loadPlayer.GetPlayerInstance().HitPoints = _sizeOfMaze / 2;
        }
Esempio n. 2
0
        public void CheckCurrentRoom()
        {
            Console.WriteLine(Constants.RoomConstants.CheckForTreasure);
            Console.WriteLine(_mazeIntegration.GetDescription(_loadPlayer.GetPlayerInstance().CurrentRoom.Id));

            if (_mazeIntegration.CausesInjury(_loadPlayer.GetPlayerInstance().CurrentRoom.Id))
            {
                Console.WriteLine(Constants.RoomConstants.TrapRoomEvent);
            }
            if (_mazeIntegration.HasTreasure(_loadPlayer.GetPlayerInstance().CurrentRoom.Id))
            {
                Console.WriteLine($"{Constants.RoomConstants.TreasureRoomEvent} {_loadPlayer.GetPlayerInstance().StepsMade}");
                _loadPlayer.GetPlayerInstance().FoundTreasure = true;
            }
        }