[General] Change "enum ACTOR_ACTION" to "enum class Action"

sol2-server-rewrite
Koncord 7 years ago
parent ef0384b296
commit 35922e4898

@ -239,7 +239,7 @@ void ActorController::sendList(std::shared_ptr<Player> player, std::vector<std::
{
actorList.cell = player->cell;
actorList.guid = player->guid;
actorList.action = mwmp::BaseActorList::SET;
actorList.action = mwmp::BaseActorList::Action::Set;
for (auto &actor : actors)
{
@ -257,7 +257,7 @@ void ActorController::requestList(std::shared_ptr<Player> player, const ESM::Cel
{
actorList.cell = player->cell;
actorList.guid = player->guid;
actorList.action = mwmp::BaseActorList::REQUEST;
actorList.action = mwmp::BaseActorList::Action::Request;
auto packet = mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_LIST);
packet->setActorList(&actorList);
@ -270,9 +270,9 @@ std::vector<std::shared_ptr<Actor>> ActorController::getActors(std::shared_ptr<P
std::vector<std::shared_ptr<Actor>> actorList;
for (auto actor : serverCell->getActorList()->baseActors)
for (const auto &actor : serverCell->getActorList()->baseActors)
{
Actor *a = new Actor;
auto a = new Actor;
a->actor = actor;
actorList.emplace_back(a);
}

@ -172,7 +172,7 @@ void ActorList::sendActorsInCell(MWWorld::CellStore* cellStore)
{
reset();
cell = *cellStore->getCell();
action = BaseActorList::SET;
action = BaseActorList::Action::Set;
auto createActor = [](const MWWorld::Ptr &ptr){
BaseActor *actor = new BaseActor;

@ -23,10 +23,10 @@ namespace mwmp
if (!ptrCellStore) return;
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s about %s", strPacketID.c_str(), actorList.cell.getDescription().c_str());
LOG_APPEND(Log::LOG_VERBOSE, "- action: %i", actorList.action);
LOG_APPEND(Log::LOG_VERBOSE, "- action: %i", (int) actorList.action);
// If we've received a request for information, comply with it
if (actorList.action == mwmp::BaseActorList::REQUEST)
if (actorList.action == mwmp::BaseActorList::Action::Request)
{
MechanicsHelper::spawnLeveledCreatures(ptrCellStore);
actorList.sendActorsInCell(ptrCellStore);

@ -46,12 +46,12 @@ namespace mwmp
cell.blank();
}
enum ACTOR_ACTION
enum class Action: uint8_t
{
SET = 0,
ADD = 1,
REMOVE = 2,
REQUEST = 3
Set = 0,
Add,
Remsove,
Request
};
RakNet::RakNetGUID guid;
@ -60,7 +60,7 @@ namespace mwmp
ESM::Cell cell;
unsigned char action; // 0 - Clear and set in entirety, 1 - Add item, 2 - Remove item, 3 - Request items
Action action;
bool isValid;
};

@ -21,7 +21,7 @@ namespace mwmp
{
struct Chat
{
enum class Action : uint8_t {
enum class Action: uint8_t {
print = 0,
clear,
addchannel,
@ -46,7 +46,7 @@ namespace mwmp
{
std::string quest;
int index;
enum class Type
enum class Type: uint8_t
{
Entry = 0,
Index = 1
@ -85,7 +85,7 @@ namespace mwmp
{
std::string itemId;
enum class Type : uint8_t
enum class Type: uint8_t
{
Item = 0,
Magic,

Loading…
Cancel
Save