mirror of
https://github.com/jorenchik/testing-spring-2024.git
synced 2026-02-04 06:42:02 +00:00
refactor(modules): move files to modules dir
This commit is contained in:
@@ -1 +1 @@
|
||||
add_library(ccunit ccunit.cc ccunit.hh)
|
||||
add_library(cppunit cppunit.cc cppunit.hh)
|
||||
|
||||
@@ -1 +1 @@
|
||||
#include "validation.hh"
|
||||
#include "./validation.hh"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "lib.hh"
|
||||
#include "./lib.hh"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
14
src/modules/CMakeLists.txt
Normal file
14
src/modules/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
add_library(
|
||||
modules
|
||||
action.cc
|
||||
action.hh
|
||||
event.cc
|
||||
event.hh
|
||||
player.cc
|
||||
player.hh
|
||||
role.cc
|
||||
role.hh
|
||||
room.cc
|
||||
room.hh
|
||||
time.cc
|
||||
time.hh)
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "action.hh"
|
||||
#include "./action.hh"
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "event.hh"
|
||||
#include "./event.hh"
|
||||
|
||||
#include "action.hh"
|
||||
#include "time.hh"
|
||||
#include "./action.hh"
|
||||
#include "./time.hh"
|
||||
|
||||
#include <initializer_list>
|
||||
#include <string>
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EVENT_HH
|
||||
#define EVENT_HH
|
||||
|
||||
#include "action.hh"
|
||||
#include "./action.hh"
|
||||
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
@@ -16,7 +16,7 @@ namespace event {
|
||||
RoomStateChange,
|
||||
PlayerStateChange,
|
||||
};
|
||||
}
|
||||
} // namespace event
|
||||
|
||||
struct Event {
|
||||
std::string title;
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "player.hh"
|
||||
#include "./player.hh"
|
||||
|
||||
#include "role.hh"
|
||||
#include "./role.hh"
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef PLAYER_HH
|
||||
#define PLAYER_HH
|
||||
|
||||
#include "role.hh"
|
||||
#include "./role.hh"
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
@@ -13,7 +13,7 @@ namespace player {
|
||||
Dead,
|
||||
VotedOut,
|
||||
};
|
||||
}
|
||||
} // namespace player
|
||||
|
||||
struct Player {
|
||||
uint32_t id;
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "role.hh"
|
||||
#include "./role.hh"
|
||||
|
||||
#include <initializer_list>
|
||||
#include <vector>
|
||||
@@ -1,15 +1,15 @@
|
||||
#ifndef ROLE_HH
|
||||
#define ROLE_HH
|
||||
|
||||
#include "action.hh"
|
||||
#include "./action.hh"
|
||||
|
||||
#include <initializer_list>
|
||||
#include <vector>
|
||||
|
||||
struct Role {
|
||||
std::vector<Action> actions;
|
||||
Role(std::initializer_list<Action> actions);
|
||||
Role(std::vector<Action> actions);
|
||||
Role(std::initializer_list<Action> actions);
|
||||
};
|
||||
|
||||
#endif // !ROLE_HH
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "room.hh"
|
||||
#include "./room.hh"
|
||||
|
||||
#include "time.hh"
|
||||
#include "./time.hh"
|
||||
|
||||
#include <cstdint>
|
||||
#include <initializer_list>
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef ROOM_HH
|
||||
#define ROOM_HH
|
||||
|
||||
#include "player.hh"
|
||||
#include "./player.hh"
|
||||
|
||||
#include <cstdint>
|
||||
#include <ctime>
|
||||
@@ -16,7 +16,7 @@ namespace room {
|
||||
Stopped,
|
||||
Ended,
|
||||
};
|
||||
}
|
||||
} // namespace room
|
||||
|
||||
struct Room {
|
||||
uint32_t id;
|
||||
@@ -1 +0,0 @@
|
||||
add_library(prepLib prep.cc prep.hh timeUtils.cc timeUtils.hh)
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "validation.hh"
|
||||
#include "./validation.hh"
|
||||
|
||||
#include "room.hh"
|
||||
#include "modules/room.hh"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#ifndef VALIDATION_HH
|
||||
#define VALIDATION_HH
|
||||
|
||||
#include "event.hh"
|
||||
#include "player.hh"
|
||||
#include "room.hh"
|
||||
#include "modules/event.hh"
|
||||
#include "modules/player.hh"
|
||||
#include "modules/room.hh"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace validation {
|
||||
enum Status {
|
||||
@@ -19,7 +21,7 @@ namespace validation {
|
||||
NoRelatedEvents,
|
||||
ActionValid,
|
||||
};
|
||||
}
|
||||
} // namespace validation
|
||||
|
||||
int validateAction(Player *actor, const Action *action, Room *room, std::vector<Event> *relatedEvents, Player *target);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user