mirror of
https://github.com/jorenchik/testing-spring-2024.git
synced 2025-10-21 20:10:36 +00:00
refactor: use pragma once
This commit is contained in:
parent
a343dcbe78
commit
c62cd4c413
@ -1,5 +1,4 @@
|
|||||||
#ifndef ACTION_HH
|
#pragma once
|
||||||
#define ACTION_HH
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
struct Action {
|
struct Action {
|
||||||
@ -9,5 +8,3 @@ struct Action {
|
|||||||
Action(std::string name, bool has_target);
|
Action(std::string name, bool has_target);
|
||||||
bool operator==(const Action &other) const;
|
bool operator==(const Action &other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !ACTION_HH
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#ifndef EVENT_HH
|
#pragma once
|
||||||
#define EVENT_HH
|
|
||||||
|
|
||||||
#include "./action.hh"
|
#include "./action.hh"
|
||||||
|
|
||||||
@ -42,5 +41,3 @@ struct Event {
|
|||||||
std::initializer_list<Action> prohibits,
|
std::initializer_list<Action> prohibits,
|
||||||
std::initializer_list<Action> allows);
|
std::initializer_list<Action> allows);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !EVENT_HH
|
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
#ifndef PLAYER_HH
|
#pragma once
|
||||||
#define PLAYER_HH
|
|
||||||
|
|
||||||
#include "./role.hh"
|
#include "./role.hh"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -24,5 +22,3 @@ struct Player {
|
|||||||
Player(uint32_t id, std::string username, Role role, player::Status status);
|
Player(uint32_t id, std::string username, Role role, player::Status status);
|
||||||
bool operator==(const Player &other) const;
|
bool operator==(const Player &other) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !PLAYER_HH
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#ifndef ROLE_HH
|
#pragma once
|
||||||
#define ROLE_HH
|
|
||||||
|
|
||||||
#include "./action.hh"
|
#include "./action.hh"
|
||||||
|
|
||||||
@ -11,5 +10,3 @@ struct Role {
|
|||||||
explicit Role(std::vector<Action> actions);
|
explicit Role(std::vector<Action> actions);
|
||||||
Role(std::initializer_list<Action> actions);
|
Role(std::initializer_list<Action> actions);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !ROLE_HH
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
#ifndef ROOM_HH
|
#pragma once
|
||||||
#define ROOM_HH
|
|
||||||
|
|
||||||
#include "./player.hh"
|
#include "./player.hh"
|
||||||
|
|
||||||
@ -29,5 +28,3 @@ struct Room {
|
|||||||
Room(
|
Room(
|
||||||
uint32_t id, std::string title, uint32_t created_at, room::Status status, std::initializer_list<Player> players);
|
uint32_t id, std::string title, uint32_t created_at, room::Status status, std::initializer_list<Player> players);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !ROOM_HH
|
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
#ifndef TIME_HH
|
#pragma once
|
||||||
#define TIME_HH
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
std::tm *create_utc_timestamp(uint32_t timestamp);
|
std::tm *create_utc_timestamp(uint32_t timestamp);
|
||||||
|
|
||||||
#endif // !TIME_HH
|
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
#ifndef VALIDATION_HH
|
#pragma once
|
||||||
#define VALIDATION_HH
|
|
||||||
|
|
||||||
#include "modules/event.hh"
|
#include "modules/event.hh"
|
||||||
#include "modules/player.hh"
|
#include "modules/player.hh"
|
||||||
#include "modules/room.hh"
|
#include "modules/room.hh"
|
||||||
@ -24,5 +22,3 @@ namespace validation {
|
|||||||
} // namespace validation
|
} // namespace validation
|
||||||
|
|
||||||
int validate_action(Player *actor, const Action *action, Room *room, std::vector<Event> *relatedEvents, Player *target);
|
int validate_action(Player *actor, const Action *action, Room *room, std::vector<Event> *relatedEvents, Player *target);
|
||||||
|
|
||||||
#endif // !VALIDATION_HH
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user