/in/game.cpp:265:12: error: using typedef-name 'GameState' after 'enum'
enum class GameState { EMPTY, FOOD, Ghost };
^~~~~~~~~
In file included from /in/game.cpp:5:0:
/in/lab6.h:16:50: note: 'GameState' has a previous declaration here
typedef enum gameState{losing, onGoing, winning} GameState;
^~~~~~~~~
/in/game.cpp:271:12: error: using typedef-name 'Direction' after 'enum'
enum class Direction { UP, DOWN, LEFT, RIGHT };
^~~~~~~~~
In file included from /in/game.cpp:5:0:
/in/lab6.h:17:53: note: 'Direction' has a previous declaration here
typedef enum direction{up, down, left, right, idle} Direction;
^~~~~~~~~
/in/game.cpp: In function 'bool AddGhost(Game*, int, int, Direction)':
/in/game.cpp:282:21: error: 'UP' is not a member of 'Direction {aka direction}'
case Direction::UP:
^~
/in/game.cpp:286:21: error: 'DOWN' is not a member of 'Direction {aka direction}'
case Direction::DOWN:
^~~~
/in/game.cpp:290:21: error: 'LEFT' is not a member of 'Direction {aka direction}'
case Direction::LEFT:
^~~~
/in/game.cpp:294:21: error: 'RIGHT' is not a member of 'Direction {aka direction}'
case Direction::RIGHT:
^~~~~
/in/game.cpp:302:54: error: 'FOOD' is not a member of 'GameState {aka gameState}'
if (game->grid[next_r][next_c] == GameState::FOOD) {
^~~~
/in/game.cpp:303:53: error: 'Ghost' is not a member of 'GameState {aka gameState}'
game->grid[next_r][next_c] = GameState::Ghost; // ����ʳ��
^~~~~
/in/game.cpp:305:59: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
else if (game->grid[next_r][next_c] == GameState::EMPTY) {
^~~~~
/in/game.cpp:306:53: error: 'Ghost' is not a member of 'GameState {aka gameState}'
game->grid[next_r][next_c] = GameState::Ghost; // �ڿ�λ�����ӹ���
^~~~~
/in/game.cpp:311:39: error: 'Ghost' is not a member of 'GameState {aka gameState}'
game->grid[r][c] = GameState::Ghost; // �ڵ�ǰλ�����ӹ���
^~~~~
/in/game.cpp: In function 'void MoveGhosts(Game*)':
/in/game.cpp:340:48: error: 'Ghost' is not a member of 'GameState {aka gameState}'
if (game->grid[r][c] == GameState::Ghost) {
^~~~~
/in/game.cpp:342:66: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
if (r > 0 && (game->grid[r - 1][c] == GameState::EMPTY || game->grid[r - 1][c] == GameState::FOOD)) {
^~~~~
/in/game.cpp:342:110: error: 'FOOD' is not a member of 'GameState {aka gameState}'
if (r > 0 && (game->grid[r - 1][c] == GameState::EMPTY || game->grid[r - 1][c] == GameState::FOOD)) {
^~~~
/in/game.cpp:344:51: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
game->grid[r][c] = GameState::EMPTY; // �����Ƴ���ǰλ��
^~~~~
/in/game.cpp:345:55: error: 'Ghost' is not a member of 'GameState {aka gameState}'
game->grid[r - 1][c] = GameState::Ghost; // �����Ƶ��Ϸ�λ��
^~~~~
/in/game.cpp:348:73: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
if (r < rows - 1 && (game->grid[r + 1][c] == GameState::EMPTY || game->grid[r + 1][c] == GameState::FOOD)) {
^~~~~
/in/game.cpp:348:117: error: 'FOOD' is not a member of 'GameState {aka gameState}'
if (r < rows - 1 && (game->grid[r + 1][c] == GameState::EMPTY || game->grid[r + 1][c] == GameState::FOOD)) {
^~~~
/in/game.cpp:350:51: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
game->grid[r][c] = GameState::EMPTY; // �����Ƴ���ǰλ��
^~~~~
/in/game.cpp:351:55: error: 'Ghost' is not a member of 'GameState {aka gameState}'
game->grid[r + 1][c] = GameState::Ghost; // �����Ƶ��·�λ��
^~~~~
/in/game.cpp:354:66: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
if (c > 0 && (game->grid[r][c - 1] == GameState::EMPTY || game->grid[r][c - 1] == GameState::FOOD)) {
^~~~~
/in/game.cpp:354:110: error: 'FOOD' is not a member of 'GameState {aka gameState}'
if (c > 0 && (game->grid[r][c - 1] == GameState::EMPTY || game->grid[r][c - 1] == GameState::FOOD)) {
^~~~
/in/game.cpp:356:51: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
game->grid[r][c] = GameState::EMPTY; // �����Ƴ���ǰλ��
^~~~~
/in/game.cpp:357:55: error: 'Ghost' is not a member of 'GameState {aka gameState}'
game->grid[r][c - 1] = GameState::Ghost; // �����Ƶ����λ��
^~~~~
/in/game.cpp:360:73: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
if (c < cols - 1 && (game->grid[r][c + 1] == GameState::EMPTY || game->grid[r][c + 1] == GameState::FOOD)) {
^~~~~
/in/game.cpp:360:117: error: 'FOOD' is not a member of 'GameState {aka gameState}'
if (c < cols - 1 && (game->grid[r][c + 1] == GameState::EMPTY || game->grid[r][c + 1] == GameState::FOOD)) {
^~~~
/in/game.cpp:362:51: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
game->grid[r][c] = GameState::EMPTY; // �����Ƴ���ǰλ��
^~~~~
/in/game.cpp:363:55: error: 'Ghost' is not a member of 'GameState {aka gameState}'
game->grid[r][c + 1] = GameState::Ghost; // �����Ƶ��ұ�λ��
^~~~~
/in/game.cpp: In function 'bool AddCapsule(Game*, int, int)':
/in/game.cpp:397:40: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
if (game->grid[r][c] != GameState::EMPTY && game->grid[r][c] != GameState::FOOD) {
^~~~~
/in/game.cpp:397:80: error: 'FOOD' is not a member of 'GameState {aka gameState}'
if (game->grid[r][c] != GameState::EMPTY && game->grid[r][c] != GameState::FOOD) {
^~~~
/in/game.cpp:402:35: error: 'CAPSULE' is not a member of 'GameState {aka gameState}'
game->grid[r][c] = GameState::CAPSULE;
^~~~~~~
/in/game.cpp:406:11: error: 'Game {aka struct game}' has no member named 'superpowerTimer'
game->superpowerTimer = 10;
^~~~~~~~~~~~~~~
/in/game.cpp:410:48: error: 'Ghost' is not a member of 'GameState {aka gameState}'
if (game->grid[i][j] == GameState::Ghost) {
^~~~~
/in/game.cpp:411:47: error: 'EMPTY' is not a member of 'GameState {aka gameState}'
game->grid[i][j] = GameState::EMPTY; // ���ֱ�Ϊ��λ
^~~~~