From e7dcc170e6a4ceea56035a587af6de62330efb09 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 4 Oct 2016 23:12:58 +0300 Subject: Move beingtype into enums directory. --- src/CMakeLists.txt | 2 +- src/Makefile.am | 2 +- src/enums/net/beingtype.h | 42 ++++++++++++++++++++++++++++++++++++++++ src/net/eathena/beingrecv.cpp | 18 ++++++++--------- src/net/eathena/beingrecv.h | 4 ++-- src/net/eathena/beingtype.h | 45 ------------------------------------------- 6 files changed, 55 insertions(+), 58 deletions(-) create mode 100644 src/enums/net/beingtype.h delete mode 100644 src/net/eathena/beingtype.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9127ac46e..e145e1322 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1476,7 +1476,7 @@ SET(SRCS net/eathena/buyingstorehandler.h net/eathena/buyingstorerecv.cpp net/eathena/buyingstorerecv.h - net/eathena/beingtype.h + enums/net/beingtype.h net/eathena/buysellhandler.cpp net/eathena/buysellhandler.h net/eathena/buysellrecv.cpp diff --git a/src/Makefile.am b/src/Makefile.am index d7c0022ff..0b70f89bd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1681,7 +1681,7 @@ manaplus_SOURCES += gui/windows/bankwindow.cpp \ net/eathena/buyingstorehandler.h \ net/eathena/buyingstorerecv.cpp \ net/eathena/buyingstorerecv.h \ - net/eathena/beingtype.h \ + enums/net/beingtype.h \ net/eathena/buysellhandler.cpp \ net/eathena/buysellhandler.h \ net/eathena/buysellrecv.cpp \ diff --git a/src/enums/net/beingtype.h b/src/enums/net/beingtype.h new file mode 100644 index 000000000..e760a7714 --- /dev/null +++ b/src/enums/net/beingtype.h @@ -0,0 +1,42 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2016 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef ENUMS_NET_BEINGTYPE_H +#define ENUMS_NET_BEINGTYPE_H + +#include "enums/simpletypes/enumdefines.h" + +enumStart(BeingType) +{ + PC = 0, + NPC = 1, + ITEM = 2, + SKILL = 3, + CHAT = 4, + MONSTER = 5, + NPC_EVENT = 6, + PET = 7, + HOMUN = 8, + MERSOL = 9, + ELEMENTAL = 10 +} +enumEnd(BeingType); + +#endif // ENUMS_NET_BEINGTYPE_H diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index cc744e18d..9f8736a03 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -296,11 +296,11 @@ void BeingRecv::processBeingVisible(Net::MessageIn &msg) return; // need set type based on id - BeingType::BeingType type = BeingType::MONSTER; + BeingTypeT type = BeingType::MONSTER; if (msg.getVersion() >= 20091103) { msg.readInt16("len"); - type = static_cast( + type = static_cast( msg.readUInt8("object type")); } @@ -516,10 +516,10 @@ void BeingRecv::processBeingMove(Net::MessageIn &msg) if (msg.getVersion() >= 20091103) msg.readInt16("len"); - BeingType::BeingType type; + BeingTypeT type; if (msg.getVersion() >= 20071106) { - type = static_cast( + type = static_cast( msg.readUInt8("object type")); } else @@ -741,11 +741,11 @@ void BeingRecv::processBeingSpawn(Net::MessageIn &msg) return; // need get type from id - BeingType::BeingType type = BeingType::MONSTER; + BeingTypeT type = BeingType::MONSTER; if (msg.getVersion() >= 20091103) { msg.readInt16("len"); - type = static_cast( + type = static_cast( msg.readUInt8("object type")); } @@ -1611,7 +1611,7 @@ void BeingRecv::processBeingFakeName(Net::MessageIn &msg) msg.skip(3, "unused"); return; } - const BeingType::BeingType type = static_cast( + const BeingTypeT type = static_cast( msg.readUInt8("object type")); const BeingId id = msg.readBeingId("npc id"); msg.skip(8, "unused"); @@ -1953,7 +1953,7 @@ void BeingRecv::processNameResponse2(Net::MessageIn &msg) Being *BeingRecv::createBeing2(Net::MessageIn &msg, const BeingId id, const int32_t job, - const BeingType::BeingType beingType) + const BeingTypeT beingType) { if (!actorManager) return nullptr; @@ -1992,7 +1992,7 @@ Being *BeingRecv::createBeing2(Net::MessageIn &msg, break; case BeingType::CHAT: default: - UNIMPLIMENTEDPACKETFIELD(beingType); + UNIMPLIMENTEDPACKETFIELD(CAST_S32(beingType)); type = ActorType::Monster; logger->log("not supported object type: %d, job: %d", CAST_S32(beingType), CAST_S32(job)); diff --git a/src/net/eathena/beingrecv.h b/src/net/eathena/beingrecv.h index b1802ffa0..e5e9b2b25 100644 --- a/src/net/eathena/beingrecv.h +++ b/src/net/eathena/beingrecv.h @@ -23,7 +23,7 @@ #ifndef NET_EATHENA_BEINGRECV_H #define NET_EATHENA_BEINGRECV_H -#include "net/eathena/beingtype.h" +#include "enums/net/beingtype.h" #include "enums/resources/skill/skilltype2.h" @@ -116,7 +116,7 @@ namespace EAthena Being *createBeing2(Net::MessageIn &msg, const BeingId id, const int32_t job, - const BeingType::BeingType beingType); + const BeingTypeT beingType); void applyPlayerAction(Net::MessageIn &msg, Being *const being, const uint8_t type); diff --git a/src/net/eathena/beingtype.h b/src/net/eathena/beingtype.h deleted file mode 100644 index d02f6f57c..000000000 --- a/src/net/eathena/beingtype.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2016 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef NET_EATHENA_BEINGTYPE_H -#define NET_EATHENA_BEINGTYPE_H - -namespace EAthena -{ - namespace BeingType - { - enum BeingType - { - PC = 0, - NPC = 1, - ITEM = 2, - SKILL = 3, - CHAT = 4, - MONSTER = 5, - NPC_EVENT = 6, - PET = 7, - HOMUN = 8, - MERSOL = 9, - ELEMENTAL = 10 - }; - } // namespace BeingType -} // namespace EAthena - -#endif // NET_EATHENA_BEINGTYPE_H -- cgit v1.2.3-60-g2f50