Move to pragma once

This commit is contained in:
Patricia Aas 2021-06-10 14:42:51 +02:00
parent 9644229061
commit 27b8d47dec
10 changed files with 10 additions and 40 deletions

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_BOARD_H
#define PACMAN_BOARD_H
#pragma once
#include "Direction.hpp"
#include "Position.hpp"
@ -26,5 +25,3 @@ public:
private:
uint8_t board_state[ROWS][COLUMNS]{};
};
#endif //PACMAN_BOARD_H

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_DIRECTION_H
#define PACMAN_DIRECTION_H
#pragma once
enum class Direction {
NONE,
@ -8,5 +7,3 @@ enum class Direction {
UP,
DOWN
};
#endif //PACMAN_DIRECTION_H

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_GAME_H
#define PACMAN_GAME_H
#pragma once
#include "Board.hpp"
#include "GameWindow.hpp"
@ -28,5 +27,3 @@ private:
[[nodiscard]] static auto now();
};
#endif //PACMAN_GAME_H

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_GAMEWINDOW_H
#define PACMAN_GAMEWINDOW_H
#pragma once
#include <memory>
#include <string>
@ -79,5 +78,3 @@ private:
void renderTexture(SDL_Texture * texture, SDL_Rect * texture_rect, SDL_Rect * target_rect) const;
};
#endif //PACMAN_GAMEWINDOW_H

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_INPUTSTATE_H
#define PACMAN_INPUTSTATE_H
#pragma once
class InputState {
public:
@ -9,5 +8,3 @@ public:
bool left = false;
bool right = false;
};
#endif //PACMAN_INPUTSTATE_H

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_PACMAN_H
#define PACMAN_PACMAN_H
#pragma once
#include "Direction.hpp"
#include "Position.hpp"
@ -34,5 +33,3 @@ private:
void updateMazePosition(std::chrono::milliseconds time_delta, const Board & board);
};
#endif //PACMAN_PACMAN_H

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_PACMAN_ANIMATION_HPP
#define PACMAN_PACMAN_ANIMATION_HPP
#pragma once
#include "Board.hpp"
#include "Direction.hpp"
@ -33,5 +32,3 @@ private:
const SDL_Rect right_animation[4]{right_wide, right_narrow, closed, right_narrow};
const SDL_Rect up_animation[4]{up_wide, up_narrow, closed, up_narrow};
};
#endif //PACMAN_PACMAN_ANIMATION_HPP

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_PELLETS_HPP
#define PACMAN_PELLETS_HPP
#pragma once
#include "Position.hpp"
#include "Board.hpp"
@ -22,5 +21,3 @@ private:
const SDL_Rect sprite = {1 * 32, 9 * 32, 32, 32};
std::vector<SDL_Point> positions;
};
#endif //PACMAN_PELLETS_HPP

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_POSITION_H
#define PACMAN_POSITION_H
#pragma once
#include <cmath>
@ -7,5 +6,3 @@ struct Position {
float x;
float y;
};
#endif //PACMAN_POSITION_H

View file

@ -1,5 +1,4 @@
#ifndef PACMAN_SUPERPELLETS_HPP
#define PACMAN_SUPERPELLETS_HPP
#pragma once
#include "Position.hpp"
#include "Board.hpp"
@ -22,5 +21,3 @@ private:
const SDL_Rect sprite = {0 * 32, 9 * 32, 32, 32};
std::vector<SDL_Point> positions;
};
#endif //PACMAN_SUPERPELLETS_HPP