Compare commits
	
		
			1 Commits 
		
	
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								
								 | 
						666cee6c62 | 
| 
						 | 
				
			
			@ -14,7 +14,7 @@ project ("mazzGame")
 | 
			
		|||
aux_source_directory(${PROJECT_SOURCE_DIR}/src sourceCodeList)
 | 
			
		||||
 | 
			
		||||
# 将源代码添加到此项目的可执行文件。
 | 
			
		||||
add_executable (mazzGame ${sourceCodeList} "src/Maze.cpp")
 | 
			
		||||
add_executable (mazzGame ${sourceCodeList})
 | 
			
		||||
 | 
			
		||||
if (CMAKE_VERSION VERSION_GREATER 3.12)
 | 
			
		||||
  set_property(TARGET mazzGame PROPERTY CXX_STANDARD 20)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,7 +58,7 @@ bool ConfigReader::load(std::string &path)
 | 
			
		|||
        if (section == "Symbols")
 | 
			
		||||
        {
 | 
			
		||||
            if (key == "Wall")
 | 
			
		||||
                symbols.setWall(value[0]);
 | 
			
		||||
                m_data.setWall(value[0]);
 | 
			
		||||
            else if (key == "Empty")
 | 
			
		||||
                symbols.setEmpty(value[0]);
 | 
			
		||||
            else if (key == "Player")
 | 
			
		||||
| 
						 | 
				
			
			@ -73,14 +73,14 @@ bool ConfigReader::load(std::string &path)
 | 
			
		|||
        else if (section == "Difficulty")
 | 
			
		||||
        {
 | 
			
		||||
            if (key == "MonsterAI")
 | 
			
		||||
                difficulty = std::stoi(value);
 | 
			
		||||
                m_difficulty = std::stoi(value);
 | 
			
		||||
        }
 | 
			
		||||
        else if (section == "Maze")
 | 
			
		||||
        {
 | 
			
		||||
            if (key == "Width")
 | 
			
		||||
                mazeWidth = std::stoi(value);
 | 
			
		||||
                m_mazeWidth = std::stoi(value);
 | 
			
		||||
            else if (key == "Height")
 | 
			
		||||
                mazeHeight = std::stoi(value);
 | 
			
		||||
                m_mazeHeight = std::stoi(value);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,8 +18,6 @@ private:
 | 
			
		|||
    std::string trim(const std::string &s);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    MazeData symbols;   // 存放迷宫符号
 | 
			
		||||
    int difficulty = 0; // 怪物AI难度
 | 
			
		||||
    int mazeWidth = 21;
 | 
			
		||||
    int mazeHeight = 21;
 | 
			
		||||
    MazeData m_data;   // 存放迷宫符号
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,7 @@
 | 
			
		|||
#include "Game.h"
 | 
			
		||||
 | 
			
		||||
#include <iostream>
 | 
			
		||||
 | 
			
		||||
Game::Game()
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -19,3 +21,8 @@ void Game::initMaze()
 | 
			
		|||
void Game::run()
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Game::printConfig()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,6 +18,7 @@ public:
 | 
			
		|||
    ~Game();
 | 
			
		||||
 | 
			
		||||
    void loadConfig(const std::string &filePath, MazeData &data);
 | 
			
		||||
    void printConfig(MazeData &data);
 | 
			
		||||
    void initMaze();
 | 
			
		||||
    void run();
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue