From 89d9b200fc4a939b57cf81daaa2051c935e39427 Mon Sep 17 00:00:00 2001 From: DragonAura Date: Sat, 25 Mar 2023 14:49:46 +0800 Subject: [PATCH] feat(CAPI): :sparkles: update get info interface --- CAPI/cpp/API/include/API.h | 12 + CAPI/cpp/API/include/logic.h | 2 + CAPI/cpp/API/include/structures.h | 57 ++- CAPI/cpp/API/include/utils.hpp | 53 ++- CAPI/cpp/API/src/AI.cpp | 4 +- CAPI/cpp/API/src/API.cpp | 20 + CAPI/cpp/API/src/DebugAPI.cpp | 30 +- CAPI/cpp/API/src/logic.cpp | 62 ++- CAPI/cpp/proto/Message2Clients.pb.cc | 530 ++++++++++--------------- CAPI/cpp/proto/Message2Clients.pb.h | 338 +++++----------- CAPI/cpp/proto/MessageType.pb.cc | 73 ++-- CAPI/cpp/proto/MessageType.pb.h | 25 +- CAPI/python/PyAPI/Communication.py | 60 ++- CAPI/python/PyAPI/State.py | 9 +- CAPI/python/PyAPI/logic.py | 91 +++-- CAPI/python/PyAPI/structures.py | 104 ++++- CAPI/python/PyAPI/utils.py | 171 +++++--- dependency/proto/Message2Clients.proto | 3 +- 18 files changed, 854 insertions(+), 790 deletions(-) diff --git a/CAPI/cpp/API/include/API.h b/CAPI/cpp/API/include/API.h index 3c1d85c..e9f65d7 100644 --- a/CAPI/cpp/API/include/API.h +++ b/CAPI/cpp/API/include/API.h @@ -45,6 +45,8 @@ public: [[nodiscard]] virtual int32_t GetChestProgress(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetGateProgress(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual bool IsDoorOpen(int32_t cellX, int32_t cellY) const = 0; + [[nodiscard]] virtual THUAI6::HiddenGateState GetHiddenGateState(int32_t cellX, int32_t cellY) const = 0; + [[nodiscard]] virtual int32_t GetDoorProgress(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual std::shared_ptr GetGameInfo() const = 0; @@ -130,6 +132,8 @@ public: [[nodiscard]] virtual int32_t GetChestProgress(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetGateProgress(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const = 0; + [[nodiscard]] virtual THUAI6::HiddenGateState GetHiddenGateState(int32_t cellX, int32_t cellY) const = 0; + [[nodiscard]] virtual int32_t GetDoorProgress(int32_t cellX, int32_t cellY) const = 0; [[nodiscard]] virtual std::shared_ptr GetGameInfo() const = 0; @@ -245,6 +249,8 @@ public: [[nodiscard]] int32_t GetChestProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetGateProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] THUAI6::HiddenGateState GetHiddenGateState(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] int32_t GetDoorProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] std::shared_ptr GetGameInfo() const override; @@ -325,6 +331,8 @@ public: [[nodiscard]] int32_t GetChestProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetGateProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] int32_t GetDoorProgress(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] THUAI6::HiddenGateState GetHiddenGateState(int32_t cellX, int32_t cellY) const override; [[nodiscard]] std::shared_ptr GetGameInfo() const override; @@ -397,6 +405,8 @@ public: [[nodiscard]] int32_t GetChestProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetGateProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] int32_t GetDoorProgress(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] THUAI6::HiddenGateState GetHiddenGateState(int32_t cellX, int32_t cellY) const override; [[nodiscard]] std::shared_ptr GetGameInfo() const override; @@ -464,6 +474,8 @@ public: [[nodiscard]] int32_t GetChestProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetGateProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] int32_t GetDoorProgress(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] THUAI6::HiddenGateState GetHiddenGateState(int32_t cellX, int32_t cellY) const override; [[nodiscard]] std::shared_ptr GetGameInfo() const override; diff --git a/CAPI/cpp/API/include/logic.h b/CAPI/cpp/API/include/logic.h index 41cf9bb..b4b0f20 100644 --- a/CAPI/cpp/API/include/logic.h +++ b/CAPI/cpp/API/include/logic.h @@ -96,11 +96,13 @@ private: [[nodiscard]] std::vector> GetProps() const override; [[nodiscard]] std::shared_ptr StudentGetSelfInfo() const override; [[nodiscard]] std::shared_ptr TrickerGetSelfInfo() const override; + [[nodiscard]] THUAI6::HiddenGateState GetHiddenGateState(int32_t cellX, int32_t cellY) const override; [[nodiscard]] std::vector> GetFullMap() const override; [[nodiscard]] THUAI6::PlaceType GetPlaceType(int32_t cellX, int32_t cellY) const override; [[nodiscard]] bool IsDoorOpen(int32_t cellX, int32_t cellY) const override; + [[nodiscard]] int32_t GetDoorProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetClassroomProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetChestProgress(int32_t cellX, int32_t cellY) const override; [[nodiscard]] int32_t GetGateProgress(int32_t cellX, int32_t cellY) const override; diff --git a/CAPI/cpp/API/include/structures.h b/CAPI/cpp/API/include/structures.h index 32542e3..d5bc1c1 100644 --- a/CAPI/cpp/API/include/structures.h +++ b/CAPI/cpp/API/include/structures.h @@ -30,8 +30,10 @@ namespace THUAI6 Gate = 5, HiddenGate = 6, Window = 7, - Door = 8, - Chest = 9, + Door3 = 8, + Door5 = 9, + Door6 = 10, + Chest = 11, }; // 形状标志 @@ -46,17 +48,17 @@ namespace THUAI6 enum class PropType : unsigned char { NullPropType = 0, - PropType1 = 1, - PropType2 = 2, - PropType3 = 3, + Key3 = 1, + Key5 = 2, + Key6 = 3, PropType4 = 4, }; enum class BulletType : unsigned char { NullBulletType = 0, - LineBullet = 1, - CommonBullet = 2, + FlyingKnife = 1, + CommonAttackOfTricker = 2, FastBullet = 3, OrdinaryBullet = 4, AtomBomb = 5, @@ -74,7 +76,7 @@ namespace THUAI6 enum class StudentType : unsigned char { NullStudentType = 0, - StudentType1 = 1, + Athlete = 1, StudentType2 = 2, StudentType3 = 3, StudentType4 = 4, @@ -84,7 +86,7 @@ namespace THUAI6 enum class TrickerType : unsigned char { NullTrickerType = 0, - TrickerType1 = 1, + Assassin = 1, TrickerType2 = 2, TrickerType3 = 3, TrickerType4 = 4, @@ -128,6 +130,9 @@ namespace THUAI6 Locking = 13, Rummaging = 14, Climbing = 15, + OpeningAChest = 16, + UsingSpecialSkill = 17, + OpeningAGate = 18, }; enum class MessageOfObj : unsigned char @@ -147,6 +152,13 @@ namespace THUAI6 HiddenGateMessage = 12, }; + enum class HiddenGateState : unsigned char + { + Null = 0, + Refreshed = 1, + Opened = 2, + }; + // 玩家类 struct Player { @@ -186,7 +198,6 @@ namespace THUAI6 struct Tricker : public Player { - int32_t damage; double trickDesire; double classVolume; TrickerType trickerType; // 捣蛋鬼类型 @@ -220,12 +231,10 @@ namespace THUAI6 { int32_t x; int32_t y; - int32_t size; int64_t guid; PropType type; PlaceType place; double facingDirection; // 朝向 - bool isMoving; }; struct GameMap @@ -235,11 +244,12 @@ namespace THUAI6 std::map, int32_t> gateState; std::map, bool> doorState; - std::map, int32_t> doorNumber; + + std::map, int32_t> doorProgress; std::map, int32_t> chestState; - std::map, bool> hiddenGateState; + std::map, HiddenGateState> hiddenGateState; }; struct GameInfo @@ -282,6 +292,9 @@ namespace THUAI6 {PlayerState::Locking, "Locking"}, {PlayerState::Rummaging, "Rummaging"}, {PlayerState::Climbing, "Climbing"}, + {PlayerState::OpeningAChest, "OpeningAChest"}, + {PlayerState::UsingSpecialSkill, "UsingSpecialSkill"}, + {PlayerState::OpeningAGate, "OpeningAGate"}, }; inline std::map playerTypeDict{ @@ -298,14 +311,28 @@ namespace THUAI6 {PlaceType::ClassRoom, "ClassRoom"}, {PlaceType::Gate, "Gate"}, {PlaceType::HiddenGate, "HiddenGate"}, - {PlaceType::Door, "Door"}, + {PlaceType::Door3, "Door3"}, + {PlaceType::Door5, "Door5"}, + {PlaceType::Door6, "Door6"}, {PlaceType::Window, "Window"}, {PlaceType::Chest, "Chest"}, }; inline std::map propTypeDict{ {PropType::NullPropType, "NullPropType"}, + {PropType::Key3, "Key3"}, + {PropType::Key5, "Key5"}, + {PropType::Key6, "Key6"}, + + }; + inline std::map bulletTypeDict{ + {BulletType::NullBulletType, "NullBulletType"}, + {BulletType::FlyingKnife, "FlyingKnife"}, + {BulletType::CommonAttackOfTricker, "CommonAttackOfTricker"}, + {BulletType::FastBullet, "FastBullet"}, + {BulletType::OrdinaryBullet, "OrdinaryBullet"}, + {BulletType::AtomBomb, "AtomBomb"}, }; inline std::map studentBuffDict{ diff --git a/CAPI/cpp/API/include/utils.hpp b/CAPI/cpp/API/include/utils.hpp index 919d6c5..82ba41e 100644 --- a/CAPI/cpp/API/include/utils.hpp +++ b/CAPI/cpp/API/include/utils.hpp @@ -70,7 +70,9 @@ namespace Proto2THUAI6 {protobuf::PlaceType::GATE, THUAI6::PlaceType::Gate}, {protobuf::PlaceType::HIDDEN_GATE, THUAI6::PlaceType::HiddenGate}, {protobuf::PlaceType::WINDOW, THUAI6::PlaceType::Window}, - {protobuf::PlaceType::DOOR, THUAI6::PlaceType::Door}, + {protobuf::PlaceType::DOOR3, THUAI6::PlaceType::Door3}, + {protobuf::PlaceType::DOOR5, THUAI6::PlaceType::Door5}, + {protobuf::PlaceType::DOOR6, THUAI6::PlaceType::Door6}, {protobuf::PlaceType::CHEST, THUAI6::PlaceType::Chest}, }; @@ -82,9 +84,9 @@ namespace Proto2THUAI6 inline std::map propTypeDict{ {protobuf::PropType::NULL_PROP_TYPE, THUAI6::PropType::NullPropType}, - {protobuf::PropType::PTYPE1, THUAI6::PropType::PropType1}, - {protobuf::PropType::PTYPE2, THUAI6::PropType::PropType2}, - {protobuf::PropType::PTYPE3, THUAI6::PropType::PropType3}, + {protobuf::PropType::KEY3, THUAI6::PropType::Key3}, + {protobuf::PropType::KEY5, THUAI6::PropType::Key5}, + {protobuf::PropType::KEY6, THUAI6::PropType::Key6}, {protobuf::PropType::PTYPE4, THUAI6::PropType::PropType4}, }; @@ -96,7 +98,7 @@ namespace Proto2THUAI6 inline std::map studentTypeDict{ {protobuf::StudentType::NULL_STUDENT_TYPE, THUAI6::StudentType::NullStudentType}, - {protobuf::StudentType::STUDENTTYPE1, THUAI6::StudentType::StudentType1}, + {protobuf::StudentType::ATHLETE, THUAI6::StudentType::Athlete}, {protobuf::StudentType::STUDENTTYPE2, THUAI6::StudentType::StudentType2}, {protobuf::StudentType::STUDENTTYPE3, THUAI6::StudentType::StudentType3}, {protobuf::StudentType::STUDENTTYPE4, THUAI6::StudentType::StudentType4}, @@ -104,7 +106,7 @@ namespace Proto2THUAI6 inline std::map trickerTypeDict{ {protobuf::TrickerType::NULL_TRICKER_TYPE, THUAI6::TrickerType::NullTrickerType}, - {protobuf::TrickerType::TRICKERTYPE1, THUAI6::TrickerType::TrickerType1}, + {protobuf::TrickerType::ASSASSIN, THUAI6::TrickerType::Assassin}, {protobuf::TrickerType::TRICKERTYPE2, THUAI6::TrickerType::TrickerType2}, {protobuf::TrickerType::TRICKERTYPE3, THUAI6::TrickerType::TrickerType3}, {protobuf::TrickerType::TRICKERTYPE4, THUAI6::TrickerType::TrickerType4}, @@ -138,6 +140,14 @@ namespace Proto2THUAI6 {protobuf::PlayerState::STUNNED, THUAI6::PlayerState::Stunned}, {protobuf::PlayerState::RESCUING, THUAI6::PlayerState::Rescuing}, {protobuf::PlayerState::TREATING, THUAI6::PlayerState::Treating}, + {protobuf::PlayerState::SWINGING, THUAI6::PlayerState::Swinging}, + {protobuf::PlayerState::ATTACKING, THUAI6::PlayerState::Attacking}, + {protobuf::PlayerState::LOCKING, THUAI6::PlayerState::Locking}, + {protobuf::PlayerState::RUMMAGING, THUAI6::PlayerState::Rummaging}, + {protobuf::PlayerState::CLIMBING, THUAI6::PlayerState::Climbing}, + {protobuf::PlayerState::OPENING_A_CHEST, THUAI6::PlayerState::OpeningAChest}, + {protobuf::PlayerState::USING_SPECIAL_SKILL, THUAI6::PlayerState::UsingSpecialSkill}, + {protobuf::PlayerState::OPENING_A_GATE, THUAI6::PlayerState::OpeningAGate}, }; inline std::map gameStateDict{ @@ -149,9 +159,9 @@ namespace Proto2THUAI6 inline std::map bulletTypeDict{ {protobuf::BulletType::NULL_BULLET_TYPE, THUAI6::BulletType::NullBulletType}, - {protobuf::BulletType::COMMON_BULLET, THUAI6::BulletType::CommonBullet}, + {protobuf::BulletType::FLYING_KNIFE, THUAI6::BulletType::FlyingKnife}, + {protobuf::BulletType::COMMON_ATTACK_OF_TRICKER, THUAI6::BulletType::CommonAttackOfTricker}, {protobuf::BulletType::FAST_BULLET, THUAI6::BulletType::FastBullet}, - {protobuf::BulletType::LINE_BULLET, THUAI6::BulletType::LineBullet}, {protobuf::BulletType::ORDINARY_BULLET, THUAI6::BulletType::OrdinaryBullet}, {protobuf::BulletType::ATOM_BOMB, THUAI6::BulletType::AtomBomb}, }; @@ -185,7 +195,6 @@ namespace Proto2THUAI6 tricker->bulletType = bulletTypeDict[trickerMsg.bullet_type()]; tricker->trickDesire = trickerMsg.trick_desire(); tricker->classVolume = trickerMsg.class_volume(); - tricker->damage = trickerMsg.damage(); for (int i = 0; i < trickerMsg.time_until_skill_available().size(); i++) tricker->timeUntilSkillAvailable.push_back(trickerMsg.time_until_skill_available(i)); tricker->place = placeTypeDict[trickerMsg.place()]; @@ -227,7 +236,7 @@ namespace Proto2THUAI6 for (int i = 0; i < studentMsg.prop().size(); i++) student->props.push_back(propTypeDict[studentMsg.prop(i)]); student->place = placeTypeDict[studentMsg.place()]; - student->playerState = playerStateDict[studentMsg.state()]; + student->playerState = playerStateDict[studentMsg.player_state()]; student->determination = studentMsg.determination(); student->addiction = studentMsg.addiction(); student->studentType = studentTypeDict[studentMsg.student_type()]; @@ -245,9 +254,7 @@ namespace Proto2THUAI6 prop->type = propTypeDict[propMsg.type()]; prop->place = placeTypeDict[propMsg.place()]; prop->guid = propMsg.guid(); - prop->size = propMsg.size(); prop->facingDirection = propMsg.facing_direction(); - prop->isMoving = propMsg.is_moving(); return prop; } @@ -293,6 +300,14 @@ namespace Proto2THUAI6 return bombedBullet; } + inline THUAI6::HiddenGateState Bool2HiddenGateState(bool gateMsg) + { + if (gateMsg) + return THUAI6::HiddenGateState::Opened; + else + return THUAI6::HiddenGateState::Refreshed; + } + } // namespace Proto2THUAI6 namespace THUAI62Proto @@ -306,7 +321,9 @@ namespace THUAI62Proto {THUAI6::PlaceType::ClassRoom, protobuf::PlaceType::CLASSROOM}, {THUAI6::PlaceType::Gate, protobuf::PlaceType::GATE}, {THUAI6::PlaceType::HiddenGate, protobuf::PlaceType::HIDDEN_GATE}, - {THUAI6::PlaceType::Door, protobuf::PlaceType::DOOR}, + {THUAI6::PlaceType::Door3, protobuf::PlaceType::DOOR3}, + {THUAI6::PlaceType::Door5, protobuf::PlaceType::DOOR5}, + {THUAI6::PlaceType::Door6, protobuf::PlaceType::DOOR6}, {THUAI6::PlaceType::Window, protobuf::PlaceType::WINDOW}, }; @@ -318,9 +335,9 @@ namespace THUAI62Proto inline std::map propTypeDict{ {THUAI6::PropType::NullPropType, protobuf::PropType::NULL_PROP_TYPE}, - {THUAI6::PropType::PropType1, protobuf::PropType::PTYPE1}, - {THUAI6::PropType::PropType2, protobuf::PropType::PTYPE2}, - {THUAI6::PropType::PropType3, protobuf::PropType::PTYPE3}, + {THUAI6::PropType::Key3, protobuf::PropType::KEY3}, + {THUAI6::PropType::Key5, protobuf::PropType::KEY5}, + {THUAI6::PropType::Key6, protobuf::PropType::KEY6}, {THUAI6::PropType::PropType4, protobuf::PropType::PTYPE4}, }; @@ -332,7 +349,7 @@ namespace THUAI62Proto inline std::map studentTypeDict{ {THUAI6::StudentType::NullStudentType, protobuf::StudentType::NULL_STUDENT_TYPE}, - {THUAI6::StudentType::StudentType1, protobuf::StudentType::STUDENTTYPE1}, + {THUAI6::StudentType::Athlete, protobuf::StudentType::ATHLETE}, {THUAI6::StudentType::StudentType2, protobuf::StudentType::STUDENTTYPE2}, {THUAI6::StudentType::StudentType3, protobuf::StudentType::STUDENTTYPE3}, {THUAI6::StudentType::StudentType4, protobuf::StudentType::STUDENTTYPE4}, @@ -348,7 +365,7 @@ namespace THUAI62Proto inline std::map trickerTypeDict{ {THUAI6::TrickerType::NullTrickerType, protobuf::TrickerType::NULL_TRICKER_TYPE}, - {THUAI6::TrickerType::TrickerType1, protobuf::TrickerType::TRICKERTYPE1}, + {THUAI6::TrickerType::Assassin, protobuf::TrickerType::ASSASSIN}, {THUAI6::TrickerType::TrickerType2, protobuf::TrickerType::TRICKERTYPE2}, {THUAI6::TrickerType::TrickerType3, protobuf::TrickerType::TRICKERTYPE3}, {THUAI6::TrickerType::TrickerType4, protobuf::TrickerType::TRICKERTYPE4}, diff --git a/CAPI/cpp/API/src/AI.cpp b/CAPI/cpp/API/src/AI.cpp index fcdad3b..01f1354 100644 --- a/CAPI/cpp/API/src/AI.cpp +++ b/CAPI/cpp/API/src/AI.cpp @@ -9,9 +9,9 @@ extern const bool asynchronous = false; extern const THUAI6::PlayerType playerType = THUAI6::PlayerType::StudentPlayer; // 选手需要将两个都定义,本份代码中不选择的阵营任意定义即可 -extern const THUAI6::TrickerType trickerType = THUAI6::TrickerType::TrickerType1; +extern const THUAI6::TrickerType trickerType = THUAI6::TrickerType::Assassin; -extern const THUAI6::StudentType studentType = THUAI6::StudentType::StudentType1; +extern const THUAI6::StudentType studentType = THUAI6::StudentType::Athlete; // 选手只需写一个即可,为了调试方便写了两个的话也不会有影响 diff --git a/CAPI/cpp/API/src/API.cpp b/CAPI/cpp/API/src/API.cpp index a68705f..d2d5459 100644 --- a/CAPI/cpp/API/src/API.cpp +++ b/CAPI/cpp/API/src/API.cpp @@ -319,6 +319,26 @@ int32_t TrickerAPI::GetGateProgress(int32_t cellX, int32_t cellY) const return logic.GetGateProgress(cellX, cellY); } +int32_t StudentAPI::GetDoorProgress(int32_t cellX, int32_t cellY) const +{ + return logic.GetDoorProgress(cellX, cellY); +} + +int32_t TrickerAPI::GetDoorProgress(int32_t cellX, int32_t cellY) const +{ + return logic.GetDoorProgress(cellX, cellY); +} + +THUAI6::HiddenGateState StudentAPI::GetHiddenGateState(int32_t cellX, int32_t cellY) const +{ + return logic.GetHiddenGateState(cellX, cellY); +} + +THUAI6::HiddenGateState TrickerAPI::GetHiddenGateState(int32_t cellX, int32_t cellY) const +{ + return logic.GetHiddenGateState(cellX, cellY); +} + std::shared_ptr StudentAPI::GetGameInfo() const { return logic.GetGameInfo(); diff --git a/CAPI/cpp/API/src/DebugAPI.cpp b/CAPI/cpp/API/src/DebugAPI.cpp index bdf0e74..ddf7c72 100644 --- a/CAPI/cpp/API/src/DebugAPI.cpp +++ b/CAPI/cpp/API/src/DebugAPI.cpp @@ -440,6 +440,26 @@ int32_t TrickerDebugAPI::GetChestProgress(int32_t cellX, int32_t cellY) const return logic.GetChestProgress(cellX, cellY); } +int32_t StudentDebugAPI::GetDoorProgress(int32_t cellX, int32_t cellY) const +{ + return logic.GetDoorProgress(cellX, cellY); +} + +int32_t TrickerDebugAPI::GetDoorProgress(int32_t cellX, int32_t cellY) const +{ + return logic.GetDoorProgress(cellX, cellY); +} + +THUAI6::HiddenGateState StudentDebugAPI::GetHiddenGateState(int32_t cellX, int32_t cellY) const +{ + return logic.GetHiddenGateState(cellX, cellY); +} + +THUAI6::HiddenGateState TrickerDebugAPI::GetHiddenGateState(int32_t cellX, int32_t cellY) const +{ + return logic.GetHiddenGateState(cellX, cellY); +} + int32_t StudentDebugAPI::GetGateProgress(int32_t cellX, int32_t cellY) const { return logic.GetGateProgress(cellX, cellY); @@ -595,7 +615,7 @@ void StudentDebugAPI::PrintTricker() const logger->info("******Tricker Info******"); logger->info("playerID={}, GUID={}, x={}, y={}", tricker->playerID, tricker->guid, tricker->x, tricker->y); logger->info("speed={}, view range={}, place={}", tricker->speed, tricker->viewRange, THUAI6::placeTypeDict[tricker->place]); - logger->info("damage={}, state={}", tricker->damage, THUAI6::playerStateDict[tricker->playerState]); + logger->info("state={}", THUAI6::playerStateDict[tricker->playerState]); std::string skillTime = "skill time="; for (const auto& time : tricker->timeUntilSkillAvailable) skillTime += std::to_string(time) + ", "; @@ -619,7 +639,7 @@ void TrickerDebugAPI::PrintTricker() const logger->info("******Tricker Info******"); logger->info("playerID={}, GUID={}, x={}, y={}", tricker->playerID, tricker->guid, tricker->x, tricker->y); logger->info("speed={}, view range={}, place={}", tricker->speed, tricker->viewRange, THUAI6::placeTypeDict[tricker->place]); - logger->info("damage={}, state={}", tricker->damage, THUAI6::playerStateDict[tricker->playerState]); + logger->info("state={}", THUAI6::playerStateDict[tricker->playerState]); std::string skillTime = "skill time="; for (const auto& time : tricker->timeUntilSkillAvailable) skillTime += std::to_string(time) + ", "; @@ -641,7 +661,7 @@ void StudentDebugAPI::PrintProp() const for (auto prop : logic.GetProps()) { logger->info("******Prop Info******"); - logger->info("GUID={}, x={}, y={}, place={}, is moving={}", prop->guid, prop->x, prop->y, THUAI6::placeTypeDict[prop->place], prop->isMoving); + logger->info("GUID={}, x={}, y={}, place={}", prop->guid, prop->x, prop->y, THUAI6::placeTypeDict[prop->place]); logger->info("*********************"); } } @@ -651,7 +671,7 @@ void TrickerDebugAPI::PrintProp() const for (auto prop : logic.GetProps()) { logger->info("******Prop Info******"); - logger->info("GUID={}, x={}, y={}, place={}, is moving={}", prop->guid, prop->x, prop->y, THUAI6::placeTypeDict[prop->place], prop->isMoving); + logger->info("GUID={}, x={}, y={}, place={}", prop->guid, prop->x, prop->y, THUAI6::placeTypeDict[prop->place]); logger->info("*********************"); } } @@ -684,7 +704,7 @@ void TrickerDebugAPI::PrintSelfInfo() const logger->info("******Self Info******"); logger->info("playerID={}, GUID={}, x={}, y={}", self->playerID, self->guid, self->x, self->y); logger->info("speed={}, view range={}, place={}", self->speed, self->viewRange, THUAI6::placeTypeDict[self->place]); - logger->info("damage={}, state={}", self->damage, THUAI6::playerStateDict[self->playerState]); + logger->info("state={}", THUAI6::playerStateDict[self->playerState]); std::string skillTime = "skill time="; for (const auto& time : self->timeUntilSkillAvailable) skillTime += std::to_string(time) + ", "; diff --git a/CAPI/cpp/API/src/logic.cpp b/CAPI/cpp/API/src/logic.cpp index 857441e..08164ca 100644 --- a/CAPI/cpp/API/src/logic.cpp +++ b/CAPI/cpp/API/src/logic.cpp @@ -81,18 +81,38 @@ bool Logic::IsDoorOpen(int32_t cellX, int32_t cellY) const logger->debug("Called IsDoorOpen"); auto pos = std::make_pair(cellX, cellY); if (currentState->mapInfo->doorState.count(pos) == 0) + { + logger->warn("Door not found"); return false; + } else return currentState->mapInfo->doorState[pos]; } +int32_t Logic::GetDoorProgress(int32_t cellX, int32_t cellY) const +{ + std::unique_lock lock(mtxState); + logger->debug("Called GetDoorProgress"); + auto pos = std::make_pair(cellX, cellY); + if (currentState->mapInfo->doorProgress.count(pos) == 0) + { + logger->warn("Door not found"); + return -1; + } + else + return currentState->mapInfo->doorProgress[pos]; +} + int32_t Logic::GetClassroomProgress(int32_t cellX, int32_t cellY) const { std::unique_lock lock(mtxState); logger->debug("Called GetClassroomProgress"); auto pos = std::make_pair(cellX, cellY); if (currentState->mapInfo->classRoomState.count(pos) == 0) - return 0; + { + logger->warn("Classroom not found"); + return -1; + } else return currentState->mapInfo->classRoomState[pos]; } @@ -103,7 +123,10 @@ int32_t Logic::GetChestProgress(int32_t cellX, int32_t cellY) const logger->debug("Called GetChestProgress"); auto pos = std::make_pair(cellX, cellY); if (currentState->mapInfo->chestState.count(pos) == 0) - return 0; + { + logger->warn("Chest not found"); + return -1; + } else return currentState->mapInfo->chestState[pos]; } @@ -114,11 +137,28 @@ int32_t Logic::GetGateProgress(int32_t cellX, int32_t cellY) const logger->debug("Called GetGateProgress"); auto pos = std::make_pair(cellX, cellY); if (currentState->mapInfo->gateState.count(pos) == 0) - return 0; + { + logger->warn("Gate not found"); + return -1; + } else return currentState->mapInfo->gateState[pos]; } +THUAI6::HiddenGateState Logic::GetHiddenGateState(int32_t cellX, int32_t cellY) const +{ + std::unique_lock lock(mtxState); + logger->debug("Called GetHiddenGateState"); + auto pos = std::make_pair(cellX, cellY); + if (currentState->mapInfo->hiddenGateState.count(pos) == 0) + { + logger->warn("HiddenGate not found"); + return THUAI6::HiddenGateState::Null; + } + else + return currentState->mapInfo->hiddenGateState[pos]; +} + std::shared_ptr Logic::GetGameInfo() const { std::unique_lock lock(mtxState); @@ -415,13 +455,13 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message) if (bufferState->mapInfo->doorState.count(pos) == 0) { bufferState->mapInfo->doorState.emplace(pos, item.door_message().is_open()); - bufferState->mapInfo->doorNumber.emplace(pos, item.door_message().number()); + bufferState->mapInfo->doorProgress.emplace(pos, item.door_message().progress()); logger->debug("Add Door!"); } else { bufferState->mapInfo->doorState[pos] = item.door_message().is_open(); - bufferState->mapInfo->doorNumber[pos] = item.door_message().number(); + bufferState->mapInfo->doorProgress[pos] = item.door_message().progress(); logger->debug("Update Door!"); } } @@ -434,12 +474,12 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message) auto pos = std::make_pair(item.hidden_gate_message().x(), item.hidden_gate_message().y()); if (bufferState->mapInfo->hiddenGateState.count(pos) == 0) { - bufferState->mapInfo->hiddenGateState.emplace(pos, item.hidden_gate_message().opened()); + bufferState->mapInfo->hiddenGateState.emplace(pos, Proto2THUAI6::Bool2HiddenGateState(item.hidden_gate_message().opened())); logger->debug("Add HiddenGate!"); } else { - bufferState->mapInfo->hiddenGateState[pos] = item.hidden_gate_message().opened(); + bufferState->mapInfo->hiddenGateState[pos] = Proto2THUAI6::Bool2HiddenGateState(item.hidden_gate_message().opened()); logger->debug("Update HiddenGate!"); } } @@ -551,13 +591,13 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message) if (bufferState->mapInfo->doorState.count(pos) == 0) { bufferState->mapInfo->doorState.emplace(pos, item.door_message().is_open()); - bufferState->mapInfo->doorNumber.emplace(pos, item.door_message().number()); + bufferState->mapInfo->doorProgress.emplace(pos, item.door_message().progress()); logger->debug("Add Door!"); } else { bufferState->mapInfo->doorState[pos] = item.door_message().is_open(); - bufferState->mapInfo->doorNumber[pos] = item.door_message().number(); + bufferState->mapInfo->doorProgress[pos] = item.door_message().progress(); logger->debug("Update Door!"); } } @@ -570,12 +610,12 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message) auto pos = std::make_pair(item.hidden_gate_message().x(), item.hidden_gate_message().y()); if (bufferState->mapInfo->hiddenGateState.count(pos) == 0) { - bufferState->mapInfo->hiddenGateState.emplace(pos, item.hidden_gate_message().opened()); + bufferState->mapInfo->hiddenGateState.emplace(pos, Proto2THUAI6::Bool2HiddenGateState(item.hidden_gate_message().opened())); logger->debug("Add HiddenGate!"); } else { - bufferState->mapInfo->hiddenGateState[pos] = item.hidden_gate_message().opened(); + bufferState->mapInfo->hiddenGateState[pos] = Proto2THUAI6::Bool2HiddenGateState(item.hidden_gate_message().opened()); logger->debug("Update HiddenGate!"); } } diff --git a/CAPI/cpp/proto/Message2Clients.pb.cc b/CAPI/cpp/proto/Message2Clients.pb.cc index 20b7ee8..12828f7 100644 --- a/CAPI/cpp/proto/Message2Clients.pb.cc +++ b/CAPI/cpp/proto/Message2Clients.pb.cc @@ -26,7 +26,7 @@ namespace protobuf ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.time_until_skill_available_)*/ {}, /*decltype(_impl_.prop_)*/ {}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, /*decltype(_impl_.buff_)*/ {}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.speed_)*/ 0, /*decltype(_impl_.determination_)*/ 0, /*decltype(_impl_.addiction_)*/ 0, /*decltype(_impl_.place_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.player_state_)*/ 0, /*decltype(_impl_.state_)*/ 0, /*decltype(_impl_.bullet_type_)*/ 0, /*decltype(_impl_.learning_speed_)*/ 0, /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.treat_speed_)*/ 0, /*decltype(_impl_.view_range_)*/ 0, /*decltype(_impl_.radius_)*/ 0, /*decltype(_impl_.score_)*/ 0, /*decltype(_impl_.danger_alert_)*/ 0, /*decltype(_impl_.treat_progress_)*/ 0, /*decltype(_impl_.rescue_progress_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_.student_type_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.time_until_skill_available_)*/ {}, /*decltype(_impl_.prop_)*/ {}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, /*decltype(_impl_.buff_)*/ {}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.speed_)*/ 0, /*decltype(_impl_.determination_)*/ 0, /*decltype(_impl_.addiction_)*/ 0, /*decltype(_impl_.place_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.player_state_)*/ 0, /*decltype(_impl_.bullet_type_)*/ 0, /*decltype(_impl_.learning_speed_)*/ 0, /*decltype(_impl_.treat_speed_)*/ 0, /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.view_range_)*/ 0, /*decltype(_impl_.radius_)*/ 0, /*decltype(_impl_.danger_alert_)*/ 0, /*decltype(_impl_.score_)*/ 0, /*decltype(_impl_.treat_progress_)*/ 0, /*decltype(_impl_.rescue_progress_)*/ 0, /*decltype(_impl_.student_type_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } struct MessageOfStudentDefaultTypeInternal @@ -48,7 +48,7 @@ namespace protobuf ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.time_until_skill_available_)*/ {}, /*decltype(_impl_.prop_)*/ {}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, /*decltype(_impl_.buff_)*/ {}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.speed_)*/ 0, /*decltype(_impl_.damage_)*/ 0, /*decltype(_impl_.place_)*/ 0, /*decltype(_impl_.tricker_type_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.score_)*/ 0, /*decltype(_impl_.view_range_)*/ 0, /*decltype(_impl_.radius_)*/ 0, /*decltype(_impl_.player_state_)*/ 0, /*decltype(_impl_.trick_desire_)*/ 0, /*decltype(_impl_.class_volume_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_.bullet_type_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.time_until_skill_available_)*/ {}, /*decltype(_impl_.prop_)*/ {}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, /*decltype(_impl_.buff_)*/ {}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.speed_)*/ 0, /*decltype(_impl_.place_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.tricker_type_)*/ 0, /*decltype(_impl_.score_)*/ 0, /*decltype(_impl_.player_id_)*/ int64_t{0}, /*decltype(_impl_.view_range_)*/ 0, /*decltype(_impl_.radius_)*/ 0, /*decltype(_impl_.trick_desire_)*/ 0, /*decltype(_impl_.class_volume_)*/ 0, /*decltype(_impl_.player_state_)*/ 0, /*decltype(_impl_.bullet_type_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } struct MessageOfTrickerDefaultTypeInternal @@ -114,7 +114,7 @@ namespace protobuf ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.type_)*/ 0, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.place_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.size_)*/ 0, /*decltype(_impl_.is_moving_)*/ false, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.type_)*/ 0, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.place_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_._cached_size_)*/ {}} { } struct MessageOfPropDefaultTypeInternal @@ -224,7 +224,7 @@ namespace protobuf ::_pbi::ConstantInitialized ) : _impl_{ - /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.is_open_)*/ false, /*decltype(_impl_.number_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.is_open_)*/ false, /*decltype(_impl_.progress_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } struct MessageOfDoorDefaultTypeInternal @@ -462,7 +462,6 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.prop_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.player_state_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.guid_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.state_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.bullet_type_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.learning_speed_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.treat_speed_), @@ -485,7 +484,6 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.x_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.y_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.speed_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.damage_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.time_until_skill_available_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.place_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.prop_), @@ -540,8 +538,6 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfProp, _impl_.facing_direction_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfProp, _impl_.guid_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfProp, _impl_.place_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfProp, _impl_.size_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfProp, _impl_.is_moving_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfPickedProp, _internal_metadata_), ~0u, // no _extensions_ @@ -589,7 +585,7 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfDoor, _impl_.x_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfDoor, _impl_.y_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfDoor, _impl_.is_open_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfDoor, _impl_.number_), + PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfDoor, _impl_.progress_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfChest, _internal_metadata_), ~0u, // no _extensions_ @@ -684,24 +680,24 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { {0, -1, -1, sizeof(::protobuf::MessageOfStudent)}, - {30, -1, -1, sizeof(::protobuf::MessageOfTricker)}, - {55, -1, -1, sizeof(::protobuf::MessageOfBullet)}, - {70, -1, -1, sizeof(::protobuf::MessageOfBombedBullet)}, - {82, -1, -1, sizeof(::protobuf::MessageOfProp)}, - {96, -1, -1, sizeof(::protobuf::MessageOfPickedProp)}, - {107, -1, -1, sizeof(::protobuf::MessageOfClassroom)}, - {116, -1, -1, sizeof(::protobuf::MessageOfGate)}, - {125, -1, -1, sizeof(::protobuf::MessageOfHiddenGate)}, - {134, -1, -1, sizeof(::protobuf::MessageOfDoor)}, - {144, -1, -1, sizeof(::protobuf::MessageOfChest)}, - {153, -1, -1, sizeof(::protobuf::MessageOfMap_Row)}, - {160, -1, -1, sizeof(::protobuf::MessageOfMap)}, - {167, -1, -1, sizeof(::protobuf::MessageOfNews)}, - {176, -1, -1, sizeof(::protobuf::MessageOfObj)}, - {195, -1, -1, sizeof(::protobuf::MessageOfAll)}, - {210, -1, -1, sizeof(::protobuf::MessageToClient)}, - {219, -1, -1, sizeof(::protobuf::MoveRes)}, - {228, -1, -1, sizeof(::protobuf::BoolRes)}, + {29, -1, -1, sizeof(::protobuf::MessageOfTricker)}, + {53, -1, -1, sizeof(::protobuf::MessageOfBullet)}, + {68, -1, -1, sizeof(::protobuf::MessageOfBombedBullet)}, + {80, -1, -1, sizeof(::protobuf::MessageOfProp)}, + {92, -1, -1, sizeof(::protobuf::MessageOfPickedProp)}, + {103, -1, -1, sizeof(::protobuf::MessageOfClassroom)}, + {112, -1, -1, sizeof(::protobuf::MessageOfGate)}, + {121, -1, -1, sizeof(::protobuf::MessageOfHiddenGate)}, + {130, -1, -1, sizeof(::protobuf::MessageOfDoor)}, + {140, -1, -1, sizeof(::protobuf::MessageOfChest)}, + {149, -1, -1, sizeof(::protobuf::MessageOfMap_Row)}, + {156, -1, -1, sizeof(::protobuf::MessageOfMap)}, + {163, -1, -1, sizeof(::protobuf::MessageOfNews)}, + {172, -1, -1, sizeof(::protobuf::MessageOfObj)}, + {191, -1, -1, sizeof(::protobuf::MessageOfAll)}, + {206, -1, -1, sizeof(::protobuf::MessageToClient)}, + {215, -1, -1, sizeof(::protobuf::MoveRes)}, + {224, -1, -1, sizeof(::protobuf::BoolRes)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -728,94 +724,92 @@ static const ::_pb::Message* const file_default_instances[] = { const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = "\n\025Message2Clients.proto\022\010protobuf\032\021Messa" - "geType.proto\"\201\005\n\020MessageOfStudent\022\t\n\001x\030\001" + "geType.proto\"\333\004\n\020MessageOfStudent\022\t\n\001x\030\001" " \001(\005\022\t\n\001y\030\002 \001(\005\022\r\n\005speed\030\003 \001(\005\022\025\n\rdeterm" "ination\030\004 \001(\005\022\021\n\taddiction\030\005 \001(\005\022\"\n\032time" "_until_skill_available\030\006 \003(\001\022\"\n\005place\030\007 " "\001(\0162\023.protobuf.PlaceType\022 \n\004prop\030\010 \003(\0162\022" ".protobuf.PropType\022+\n\014player_state\030\t \001(\016" - "2\025.protobuf.PlayerState\022\014\n\004guid\030\n \001(\003\022$\n" - "\005state\030\013 \001(\0162\025.protobuf.PlayerState\022)\n\013b" - "ullet_type\030\014 \001(\0162\024.protobuf.BulletType\022\026" - "\n\016learning_speed\030\r \001(\005\022\023\n\013treat_speed\030\016 " - "\001(\005\022\021\n\tplayer_id\030\017 \001(\003\022\022\n\nview_range\030\020 \001" - "(\005\022\016\n\006radius\030\021 \001(\005\022\024\n\014danger_alert\030\023 \001(\001" - "\022\r\n\005score\030\024 \001(\005\022\026\n\016treat_progress\030\025 \001(\005\022" - "\027\n\017rescue_progress\030\026 \001(\005\022+\n\014student_type" - "\030\027 \001(\0162\025.protobuf.StudentType\022\030\n\020facing_" - "direction\030\030 \001(\001\022\'\n\004buff\030\031 \003(\0162\031.protobuf" - ".StudentBuffType\"\371\003\n\020MessageOfTricker\022\t\n" - "\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\r\n\005speed\030\003 \001(\005\022\016\n\006da" - "mage\030\004 \001(\005\022\"\n\032time_until_skill_available" - "\030\005 \003(\001\022\"\n\005place\030\006 \001(\0162\023.protobuf.PlaceTy" - "pe\022 \n\004prop\030\007 \003(\0162\022.protobuf.PropType\022+\n\014" - "tricker_type\030\010 \001(\0162\025.protobuf.TrickerTyp" - "e\022\014\n\004guid\030\t \001(\003\022\r\n\005score\030\n \001(\005\022\021\n\tplayer" - "_id\030\013 \001(\003\022\022\n\nview_range\030\014 \001(\005\022\016\n\006radius\030" - "\r \001(\005\022+\n\014player_state\030\016 \001(\0162\025.protobuf.P" - "layerState\022\024\n\014trick_desire\030\017 \001(\001\022\024\n\014clas" - "s_volume\030\020 \001(\001\022\030\n\020facing_direction\030\021 \001(\001" - "\022)\n\013bullet_type\030\022 \001(\0162\024.protobuf.BulletT" - "ype\022\'\n\004buff\030\023 \003(\0162\031.protobuf.TrickerBuff" - "Type\"\336\001\n\017MessageOfBullet\022\"\n\004type\030\001 \001(\0162\024" - ".protobuf.BulletType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001" - "(\005\022\030\n\020facing_direction\030\004 \001(\001\022\014\n\004guid\030\005 \001" - "(\003\022\"\n\004team\030\006 \001(\0162\024.protobuf.PlayerType\022\"" - "\n\005place\030\007 \001(\0162\023.protobuf.PlaceType\022\022\n\nbo" - "mb_range\030\010 \001(\001\022\r\n\005speed\030\t \001(\005\"\223\001\n\025Messag" - "eOfBombedBullet\022\"\n\004type\030\001 \001(\0162\024.protobuf" - ".BulletType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020fac" - "ing_direction\030\004 \001(\001\022\022\n\nmapping_id\030\005 \001(\003\022" - "\022\n\nbomb_range\030\006 \001(\001\"\264\001\n\rMessageOfProp\022 \n" - "\004type\030\001 \001(\0162\022.protobuf.PropType\022\t\n\001x\030\002 \001" - "(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020facing_direction\030\004 \001(\001\022" - "\014\n\004guid\030\005 \001(\003\022\"\n\005place\030\006 \001(\0162\023.protobuf." - "PlaceType\022\014\n\004size\030\007 \001(\005\022\021\n\tis_moving\030\010 \001" - "(\010\"{\n\023MessageOfPickedProp\022 \n\004type\030\001 \001(\0162" - "\022.protobuf.PropType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(" - "\005\022\030\n\020facing_direction\030\004 \001(\001\022\022\n\nmapping_i" - "d\030\005 \001(\003\"<\n\022MessageOfClassroom\022\t\n\001x\030\001 \001(\005" - "\022\t\n\001y\030\002 \001(\005\022\020\n\010progress\030\003 \001(\005\"7\n\rMessage" - "OfGate\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\020\n\010progress" - "\030\003 \001(\005\";\n\023MessageOfHiddenGate\022\t\n\001x\030\001 \001(\005" - "\022\t\n\001y\030\002 \001(\005\022\016\n\006opened\030\003 \001(\010\"F\n\rMessageOf" - "Door\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\017\n\007is_open\030\003 " - "\001(\010\022\016\n\006number\030\004 \001(\005\"8\n\016MessageOfChest\022\t\n" - "\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\020\n\010progress\030\003 \001(\005\"`\n" - "\014MessageOfMap\022\'\n\003row\030\002 \003(\0132\032.protobuf.Me" - "ssageOfMap.Row\032\'\n\003Row\022 \n\003col\030\001 \003(\0162\023.pro" - "tobuf.PlaceType\"=\n\rMessageOfNews\022\014\n\004news" - "\030\001 \001(\t\022\017\n\007from_id\030\002 \001(\003\022\r\n\005to_id\030\003 \001(\003\"\244" - "\005\n\014MessageOfObj\0225\n\017student_message\030\001 \001(\013" - "2\032.protobuf.MessageOfStudentH\000\0225\n\017tricke" - "r_message\030\002 \001(\0132\032.protobuf.MessageOfTric" - "kerH\000\022/\n\014prop_message\030\003 \001(\0132\027.protobuf.M" - "essageOfPropH\000\0223\n\016bullet_message\030\004 \001(\0132\031" - ".protobuf.MessageOfBulletH\000\022@\n\025bombed_bu" - "llet_message\030\005 \001(\0132\037.protobuf.MessageOfB" - "ombedBulletH\000\0229\n\021classroom_message\030\006 \001(\013" - "2\034.protobuf.MessageOfClassroomH\000\022/\n\014door" - "_message\030\007 \001(\0132\027.protobuf.MessageOfDoorH" - "\000\022/\n\014gate_message\030\010 \001(\0132\027.protobuf.Messa" - "geOfGateH\000\0221\n\rchest_message\030\t \001(\0132\030.prot" - "obuf.MessageOfChestH\000\022<\n\023hidden_gate_mes" - "sage\030\n \001(\0132\035.protobuf.MessageOfHiddenGat" - "eH\000\022/\n\014news_message\030\013 \001(\0132\027.protobuf.Mes" - "sageOfNewsH\000\022-\n\013map_message\030\014 \001(\0132\026.prot" - "obuf.MessageOfMapH\000B\020\n\016message_of_obj\"\350\001" - "\n\014MessageOfAll\022\021\n\tgame_time\030\001 \001(\005\022\024\n\014sub" - "ject_left\030\002 \001(\005\022\031\n\021student_graduated\030\003 \001" - "(\005\022\026\n\016student_quited\030\004 \001(\005\022\025\n\rstudent_sc" - "ore\030\005 \001(\005\022\025\n\rtricker_score\030\006 \001(\005\022\023\n\013gate" - "_opened\030\007 \001(\010\022\035\n\025hidden_gate_refreshed\030\010" - " \001(\010\022\032\n\022hidden_gate_opened\030\t \001(\010\"\224\001\n\017Mes" - "sageToClient\022+\n\013obj_message\030\001 \003(\0132\026.prot" - "obuf.MessageOfObj\022\'\n\ngame_state\030\002 \001(\0162\023." - "protobuf.GameState\022+\n\013all_message\030\003 \001(\0132" - "\026.protobuf.MessageOfAll\"J\n\007MoveRes\022\024\n\014ac" - "tual_speed\030\001 \001(\003\022\024\n\014actual_angle\030\002 \001(\001\022\023" - "\n\013act_success\030\003 \001(\010\"\036\n\007BoolRes\022\023\n\013act_su" - "ccess\030\001 \001(\010b\006proto3"; + "2\025.protobuf.PlayerState\022\014\n\004guid\030\n \001(\003\022)\n" + "\013bullet_type\030\014 \001(\0162\024.protobuf.BulletType" + "\022\026\n\016learning_speed\030\r \001(\005\022\023\n\013treat_speed\030" + "\016 \001(\005\022\021\n\tplayer_id\030\017 \001(\003\022\022\n\nview_range\030\020" + " \001(\005\022\016\n\006radius\030\021 \001(\005\022\024\n\014danger_alert\030\023 \001" + "(\001\022\r\n\005score\030\024 \001(\005\022\026\n\016treat_progress\030\025 \001(" + "\005\022\027\n\017rescue_progress\030\026 \001(\005\022+\n\014student_ty" + "pe\030\027 \001(\0162\025.protobuf.StudentType\022\030\n\020facin" + "g_direction\030\030 \001(\001\022\'\n\004buff\030\031 \003(\0162\031.protob" + "uf.StudentBuffType\"\351\003\n\020MessageOfTricker\022" + "\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\r\n\005speed\030\003 \001(\005\022\"\n\032" + "time_until_skill_available\030\005 \003(\001\022\"\n\005plac" + "e\030\006 \001(\0162\023.protobuf.PlaceType\022 \n\004prop\030\007 \003" + "(\0162\022.protobuf.PropType\022+\n\014tricker_type\030\010" + " \001(\0162\025.protobuf.TrickerType\022\014\n\004guid\030\t \001(" + "\003\022\r\n\005score\030\n \001(\005\022\021\n\tplayer_id\030\013 \001(\003\022\022\n\nv" + "iew_range\030\014 \001(\005\022\016\n\006radius\030\r \001(\005\022+\n\014playe" + "r_state\030\016 \001(\0162\025.protobuf.PlayerState\022\024\n\014" + "trick_desire\030\017 \001(\001\022\024\n\014class_volume\030\020 \001(\001" + "\022\030\n\020facing_direction\030\021 \001(\001\022)\n\013bullet_typ" + "e\030\022 \001(\0162\024.protobuf.BulletType\022\'\n\004buff\030\023 " + "\003(\0162\031.protobuf.TrickerBuffType\"\336\001\n\017Messa" + "geOfBullet\022\"\n\004type\030\001 \001(\0162\024.protobuf.Bull" + "etType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020facing_d" + "irection\030\004 \001(\001\022\014\n\004guid\030\005 \001(\003\022\"\n\004team\030\006 \001" + "(\0162\024.protobuf.PlayerType\022\"\n\005place\030\007 \001(\0162" + "\023.protobuf.PlaceType\022\022\n\nbomb_range\030\010 \001(\001" + "\022\r\n\005speed\030\t \001(\005\"\223\001\n\025MessageOfBombedBulle" + "t\022\"\n\004type\030\001 \001(\0162\024.protobuf.BulletType\022\t\n" + "\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020facing_direction\030" + "\004 \001(\001\022\022\n\nmapping_id\030\005 \001(\003\022\022\n\nbomb_range\030" + "\006 \001(\001\"\223\001\n\rMessageOfProp\022 \n\004type\030\001 \001(\0162\022." + "protobuf.PropType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022" + "\030\n\020facing_direction\030\004 \001(\001\022\014\n\004guid\030\005 \001(\003\022" + "\"\n\005place\030\006 \001(\0162\023.protobuf.PlaceType\"{\n\023M" + "essageOfPickedProp\022 \n\004type\030\001 \001(\0162\022.proto" + "buf.PropType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020fa" + "cing_direction\030\004 \001(\001\022\022\n\nmapping_id\030\005 \001(\003" + "\"<\n\022MessageOfClassroom\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002" + " \001(\005\022\020\n\010progress\030\003 \001(\005\"7\n\rMessageOfGate\022" + "\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\020\n\010progress\030\003 \001(\005\"" + ";\n\023MessageOfHiddenGate\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002" + " \001(\005\022\016\n\006opened\030\003 \001(\010\"H\n\rMessageOfDoor\022\t\n" + "\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\017\n\007is_open\030\003 \001(\010\022\020\n\010" + "progress\030\004 \001(\005\"8\n\016MessageOfChest\022\t\n\001x\030\001 " + "\001(\005\022\t\n\001y\030\002 \001(\005\022\020\n\010progress\030\003 \001(\005\"`\n\014Mess" + "ageOfMap\022\'\n\003row\030\002 \003(\0132\032.protobuf.Message" + "OfMap.Row\032\'\n\003Row\022 \n\003col\030\001 \003(\0162\023.protobuf" + ".PlaceType\"=\n\rMessageOfNews\022\014\n\004news\030\001 \001(" + "\t\022\017\n\007from_id\030\002 \001(\003\022\r\n\005to_id\030\003 \001(\003\"\244\005\n\014Me" + "ssageOfObj\0225\n\017student_message\030\001 \001(\0132\032.pr" + "otobuf.MessageOfStudentH\000\0225\n\017tricker_mes" + "sage\030\002 \001(\0132\032.protobuf.MessageOfTrickerH\000" + "\022/\n\014prop_message\030\003 \001(\0132\027.protobuf.Messag" + "eOfPropH\000\0223\n\016bullet_message\030\004 \001(\0132\031.prot" + "obuf.MessageOfBulletH\000\022@\n\025bombed_bullet_" + "message\030\005 \001(\0132\037.protobuf.MessageOfBombed" + "BulletH\000\0229\n\021classroom_message\030\006 \001(\0132\034.pr" + "otobuf.MessageOfClassroomH\000\022/\n\014door_mess" + "age\030\007 \001(\0132\027.protobuf.MessageOfDoorH\000\022/\n\014" + "gate_message\030\010 \001(\0132\027.protobuf.MessageOfG" + "ateH\000\0221\n\rchest_message\030\t \001(\0132\030.protobuf." + "MessageOfChestH\000\022<\n\023hidden_gate_message\030" + "\n \001(\0132\035.protobuf.MessageOfHiddenGateH\000\022/" + "\n\014news_message\030\013 \001(\0132\027.protobuf.MessageO" + "fNewsH\000\022-\n\013map_message\030\014 \001(\0132\026.protobuf." + "MessageOfMapH\000B\020\n\016message_of_obj\"\350\001\n\014Mes" + "sageOfAll\022\021\n\tgame_time\030\001 \001(\005\022\024\n\014subject_" + "left\030\002 \001(\005\022\031\n\021student_graduated\030\003 \001(\005\022\026\n" + "\016student_quited\030\004 \001(\005\022\025\n\rstudent_score\030\005" + " \001(\005\022\025\n\rtricker_score\030\006 \001(\005\022\023\n\013gate_open" + "ed\030\007 \001(\010\022\035\n\025hidden_gate_refreshed\030\010 \001(\010\022" + "\032\n\022hidden_gate_opened\030\t \001(\010\"\224\001\n\017MessageT" + "oClient\022+\n\013obj_message\030\001 \003(\0132\026.protobuf." + "MessageOfObj\022\'\n\ngame_state\030\002 \001(\0162\023.proto" + "buf.GameState\022+\n\013all_message\030\003 \001(\0132\026.pro" + "tobuf.MessageOfAll\"J\n\007MoveRes\022\024\n\014actual_" + "speed\030\001 \001(\003\022\024\n\014actual_angle\030\002 \001(\001\022\023\n\013act" + "_success\030\003 \001(\010\"\036\n\007BoolRes\022\023\n\013act_success" + "\030\001 \001(\010b\006proto3"; static const ::_pbi::DescriptorTable* const descriptor_table_Message2Clients_2eproto_deps[1] = { &::descriptor_table_MessageType_2eproto, }; @@ -823,7 +817,7 @@ static ::_pbi::once_flag descriptor_table_Message2Clients_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_Message2Clients_2eproto = { false, false, - 3539, + 3454, descriptor_table_protodef_Message2Clients_2eproto, "Message2Clients.proto", &descriptor_table_Message2Clients_2eproto_once, @@ -866,10 +860,10 @@ namespace protobuf MessageOfStudent* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.time_until_skill_available_){from._impl_.time_until_skill_available_}, decltype(_impl_.prop_){from._impl_.prop_}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, decltype(_impl_.buff_){from._impl_.buff_}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.speed_){}, decltype(_impl_.determination_){}, decltype(_impl_.addiction_){}, decltype(_impl_.place_){}, decltype(_impl_.guid_){}, decltype(_impl_.player_state_){}, decltype(_impl_.state_){}, decltype(_impl_.bullet_type_){}, decltype(_impl_.learning_speed_){}, decltype(_impl_.player_id_){}, decltype(_impl_.treat_speed_){}, decltype(_impl_.view_range_){}, decltype(_impl_.radius_){}, decltype(_impl_.score_){}, decltype(_impl_.danger_alert_){}, decltype(_impl_.treat_progress_){}, decltype(_impl_.rescue_progress_){}, decltype(_impl_.facing_direction_){}, decltype(_impl_.student_type_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.time_until_skill_available_){from._impl_.time_until_skill_available_}, decltype(_impl_.prop_){from._impl_.prop_}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, decltype(_impl_.buff_){from._impl_.buff_}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.speed_){}, decltype(_impl_.determination_){}, decltype(_impl_.addiction_){}, decltype(_impl_.place_){}, decltype(_impl_.guid_){}, decltype(_impl_.player_state_){}, decltype(_impl_.bullet_type_){}, decltype(_impl_.learning_speed_){}, decltype(_impl_.treat_speed_){}, decltype(_impl_.player_id_){}, decltype(_impl_.view_range_){}, decltype(_impl_.radius_){}, decltype(_impl_.danger_alert_){}, decltype(_impl_.score_){}, decltype(_impl_.treat_progress_){}, decltype(_impl_.rescue_progress_){}, decltype(_impl_.student_type_){}, decltype(_impl_.facing_direction_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.student_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.student_type_)); + ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.facing_direction_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.facing_direction_)); // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfStudent) } @@ -880,7 +874,7 @@ namespace protobuf (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.time_until_skill_available_){arena}, decltype(_impl_.prop_){arena}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, decltype(_impl_.buff_){arena}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.speed_){0}, decltype(_impl_.determination_){0}, decltype(_impl_.addiction_){0}, decltype(_impl_.place_){0}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.player_state_){0}, decltype(_impl_.state_){0}, decltype(_impl_.bullet_type_){0}, decltype(_impl_.learning_speed_){0}, decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.treat_speed_){0}, decltype(_impl_.view_range_){0}, decltype(_impl_.radius_){0}, decltype(_impl_.score_){0}, decltype(_impl_.danger_alert_){0}, decltype(_impl_.treat_progress_){0}, decltype(_impl_.rescue_progress_){0}, decltype(_impl_.facing_direction_){0}, decltype(_impl_.student_type_){0}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.time_until_skill_available_){arena}, decltype(_impl_.prop_){arena}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, decltype(_impl_.buff_){arena}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.speed_){0}, decltype(_impl_.determination_){0}, decltype(_impl_.addiction_){0}, decltype(_impl_.place_){0}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.player_state_){0}, decltype(_impl_.bullet_type_){0}, decltype(_impl_.learning_speed_){0}, decltype(_impl_.treat_speed_){0}, decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.view_range_){0}, decltype(_impl_.radius_){0}, decltype(_impl_.danger_alert_){0}, decltype(_impl_.score_){0}, decltype(_impl_.treat_progress_){0}, decltype(_impl_.rescue_progress_){0}, decltype(_impl_.student_type_){0}, decltype(_impl_.facing_direction_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } MessageOfStudent::~MessageOfStudent() @@ -917,7 +911,7 @@ namespace protobuf _impl_.time_until_skill_available_.Clear(); _impl_.prop_.Clear(); _impl_.buff_.Clear(); - ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.student_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.student_type_)); + ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.facing_direction_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.facing_direction_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -1045,17 +1039,6 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.PlayerState state = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 88)) - { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_state(static_cast<::protobuf::PlayerState>(val)); - } - else - goto handle_unusual; - continue; // .protobuf.BulletType bullet_type = 12; case 12: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 96)) @@ -1305,15 +1288,6 @@ namespace protobuf target = ::_pbi::WireFormatLite::WriteInt64ToArray(10, this->_internal_guid(), target); } - // .protobuf.PlayerState state = 11; - if (this->_internal_state() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 11, this->_internal_state(), target - ); - } - // .protobuf.BulletType bullet_type = 12; if (this->_internal_bullet_type() != 0) { @@ -1542,13 +1516,6 @@ namespace protobuf ::_pbi::WireFormatLite::EnumSize(this->_internal_player_state()); } - // .protobuf.PlayerState state = 11; - if (this->_internal_state() != 0) - { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_state()); - } - // .protobuf.BulletType bullet_type = 12; if (this->_internal_bullet_type() != 0) { @@ -1562,18 +1529,18 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_learning_speed()); } - // int64 player_id = 15; - if (this->_internal_player_id() != 0) - { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_player_id()); - } - // int32 treat_speed = 14; if (this->_internal_treat_speed() != 0) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_treat_speed()); } + // int64 player_id = 15; + if (this->_internal_player_id() != 0) + { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_player_id()); + } + // int32 view_range = 16; if (this->_internal_view_range() != 0) { @@ -1592,15 +1559,6 @@ namespace protobuf ); } - // int32 score = 20; - if (this->_internal_score() != 0) - { - total_size += 2 + - ::_pbi::WireFormatLite::Int32Size( - this->_internal_score() - ); - } - // double danger_alert = 19; static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_danger_alert = this->_internal_danger_alert(); @@ -1611,6 +1569,15 @@ namespace protobuf total_size += 2 + 8; } + // int32 score = 20; + if (this->_internal_score() != 0) + { + total_size += 2 + + ::_pbi::WireFormatLite::Int32Size( + this->_internal_score() + ); + } + // int32 treat_progress = 21; if (this->_internal_treat_progress() != 0) { @@ -1629,6 +1596,13 @@ namespace protobuf ); } + // .protobuf.StudentType student_type = 23; + if (this->_internal_student_type() != 0) + { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_student_type()); + } + // double facing_direction = 24; static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_facing_direction = this->_internal_facing_direction(); @@ -1639,13 +1613,6 @@ namespace protobuf total_size += 2 + 8; } - // .protobuf.StudentType student_type = 23; - if (this->_internal_student_type() != 0) - { - total_size += 2 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_student_type()); - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -1701,10 +1668,6 @@ namespace protobuf { _this->_internal_set_player_state(from._internal_player_state()); } - if (from._internal_state() != 0) - { - _this->_internal_set_state(from._internal_state()); - } if (from._internal_bullet_type() != 0) { _this->_internal_set_bullet_type(from._internal_bullet_type()); @@ -1713,14 +1676,14 @@ namespace protobuf { _this->_internal_set_learning_speed(from._internal_learning_speed()); } - if (from._internal_player_id() != 0) - { - _this->_internal_set_player_id(from._internal_player_id()); - } if (from._internal_treat_speed() != 0) { _this->_internal_set_treat_speed(from._internal_treat_speed()); } + if (from._internal_player_id() != 0) + { + _this->_internal_set_player_id(from._internal_player_id()); + } if (from._internal_view_range() != 0) { _this->_internal_set_view_range(from._internal_view_range()); @@ -1729,10 +1692,6 @@ namespace protobuf { _this->_internal_set_radius(from._internal_radius()); } - if (from._internal_score() != 0) - { - _this->_internal_set_score(from._internal_score()); - } static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_danger_alert = from._internal_danger_alert(); uint64_t raw_danger_alert; @@ -1741,6 +1700,10 @@ namespace protobuf { _this->_internal_set_danger_alert(from._internal_danger_alert()); } + if (from._internal_score() != 0) + { + _this->_internal_set_score(from._internal_score()); + } if (from._internal_treat_progress() != 0) { _this->_internal_set_treat_progress(from._internal_treat_progress()); @@ -1749,6 +1712,10 @@ namespace protobuf { _this->_internal_set_rescue_progress(from._internal_rescue_progress()); } + if (from._internal_student_type() != 0) + { + _this->_internal_set_student_type(from._internal_student_type()); + } static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_facing_direction = from._internal_facing_direction(); uint64_t raw_facing_direction; @@ -1757,10 +1724,6 @@ namespace protobuf { _this->_internal_set_facing_direction(from._internal_facing_direction()); } - if (from._internal_student_type() != 0) - { - _this->_internal_set_student_type(from._internal_student_type()); - } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -1786,7 +1749,7 @@ namespace protobuf _impl_.prop_.InternalSwap(&other->_impl_.prop_); _impl_.buff_.InternalSwap(&other->_impl_.buff_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfStudent, _impl_.student_type_) + sizeof(MessageOfStudent::_impl_.student_type_) - PROTOBUF_FIELD_OFFSET(MessageOfStudent, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfStudent, _impl_.facing_direction_) + sizeof(MessageOfStudent::_impl_.facing_direction_) - PROTOBUF_FIELD_OFFSET(MessageOfStudent, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); @@ -1818,10 +1781,10 @@ namespace protobuf MessageOfTricker* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.time_until_skill_available_){from._impl_.time_until_skill_available_}, decltype(_impl_.prop_){from._impl_.prop_}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, decltype(_impl_.buff_){from._impl_.buff_}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.speed_){}, decltype(_impl_.damage_){}, decltype(_impl_.place_){}, decltype(_impl_.tricker_type_){}, decltype(_impl_.guid_){}, decltype(_impl_.player_id_){}, decltype(_impl_.score_){}, decltype(_impl_.view_range_){}, decltype(_impl_.radius_){}, decltype(_impl_.player_state_){}, decltype(_impl_.trick_desire_){}, decltype(_impl_.class_volume_){}, decltype(_impl_.facing_direction_){}, decltype(_impl_.bullet_type_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.time_until_skill_available_){from._impl_.time_until_skill_available_}, decltype(_impl_.prop_){from._impl_.prop_}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, decltype(_impl_.buff_){from._impl_.buff_}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.speed_){}, decltype(_impl_.place_){}, decltype(_impl_.guid_){}, decltype(_impl_.tricker_type_){}, decltype(_impl_.score_){}, decltype(_impl_.player_id_){}, decltype(_impl_.view_range_){}, decltype(_impl_.radius_){}, decltype(_impl_.trick_desire_){}, decltype(_impl_.class_volume_){}, decltype(_impl_.player_state_){}, decltype(_impl_.bullet_type_){}, decltype(_impl_.facing_direction_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.bullet_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.bullet_type_)); + ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.facing_direction_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.facing_direction_)); // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfTricker) } @@ -1832,7 +1795,7 @@ namespace protobuf (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.time_until_skill_available_){arena}, decltype(_impl_.prop_){arena}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, decltype(_impl_.buff_){arena}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.speed_){0}, decltype(_impl_.damage_){0}, decltype(_impl_.place_){0}, decltype(_impl_.tricker_type_){0}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.score_){0}, decltype(_impl_.view_range_){0}, decltype(_impl_.radius_){0}, decltype(_impl_.player_state_){0}, decltype(_impl_.trick_desire_){0}, decltype(_impl_.class_volume_){0}, decltype(_impl_.facing_direction_){0}, decltype(_impl_.bullet_type_){0}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.time_until_skill_available_){arena}, decltype(_impl_.prop_){arena}, /*decltype(_impl_._prop_cached_byte_size_)*/ {0}, decltype(_impl_.buff_){arena}, /*decltype(_impl_._buff_cached_byte_size_)*/ {0}, decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.speed_){0}, decltype(_impl_.place_){0}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.tricker_type_){0}, decltype(_impl_.score_){0}, decltype(_impl_.player_id_){int64_t{0}}, decltype(_impl_.view_range_){0}, decltype(_impl_.radius_){0}, decltype(_impl_.trick_desire_){0}, decltype(_impl_.class_volume_){0}, decltype(_impl_.player_state_){0}, decltype(_impl_.bullet_type_){0}, decltype(_impl_.facing_direction_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } MessageOfTricker::~MessageOfTricker() @@ -1869,7 +1832,7 @@ namespace protobuf _impl_.time_until_skill_available_.Clear(); _impl_.prop_.Clear(); _impl_.buff_.Clear(); - ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.bullet_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.bullet_type_)); + ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.facing_direction_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.facing_direction_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -1914,16 +1877,6 @@ namespace protobuf else goto handle_unusual; continue; - // int32 damage = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) - { - _impl_.damage_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } - else - goto handle_unusual; - continue; // repeated double time_until_skill_available = 5; case 5: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) @@ -2150,13 +2103,6 @@ namespace protobuf target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_speed(), target); } - // int32 damage = 4; - if (this->_internal_damage() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_damage(), target); - } - // repeated double time_until_skill_available = 5; if (this->_internal_time_until_skill_available_size() > 0) { @@ -2378,12 +2324,6 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_speed()); } - // int32 damage = 4; - if (this->_internal_damage() != 0) - { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_damage()); - } - // .protobuf.PlaceType place = 6; if (this->_internal_place() != 0) { @@ -2391,6 +2331,12 @@ namespace protobuf ::_pbi::WireFormatLite::EnumSize(this->_internal_place()); } + // int64 guid = 9; + if (this->_internal_guid() != 0) + { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_guid()); + } + // .protobuf.TrickerType tricker_type = 8; if (this->_internal_tricker_type() != 0) { @@ -2398,10 +2344,10 @@ namespace protobuf ::_pbi::WireFormatLite::EnumSize(this->_internal_tricker_type()); } - // int64 guid = 9; - if (this->_internal_guid() != 0) + // int32 score = 10; + if (this->_internal_score() != 0) { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_guid()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_score()); } // int64 player_id = 11; @@ -2410,12 +2356,6 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_player_id()); } - // int32 score = 10; - if (this->_internal_score() != 0) - { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_score()); - } - // int32 view_range = 12; if (this->_internal_view_range() != 0) { @@ -2428,13 +2368,6 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_radius()); } - // .protobuf.PlayerState player_state = 14; - if (this->_internal_player_state() != 0) - { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_player_state()); - } - // double trick_desire = 15; static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_trick_desire = this->_internal_trick_desire(); @@ -2455,14 +2388,11 @@ namespace protobuf total_size += 2 + 8; } - // double facing_direction = 17; - static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); - double tmp_facing_direction = this->_internal_facing_direction(); - uint64_t raw_facing_direction; - memcpy(&raw_facing_direction, &tmp_facing_direction, sizeof(tmp_facing_direction)); - if (raw_facing_direction != 0) + // .protobuf.PlayerState player_state = 14; + if (this->_internal_player_state() != 0) { - total_size += 2 + 8; + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_player_state()); } // .protobuf.BulletType bullet_type = 18; @@ -2472,6 +2402,16 @@ namespace protobuf ::_pbi::WireFormatLite::EnumSize(this->_internal_bullet_type()); } + // double facing_direction = 17; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_facing_direction = this->_internal_facing_direction(); + uint64_t raw_facing_direction; + memcpy(&raw_facing_direction, &tmp_facing_direction, sizeof(tmp_facing_direction)); + if (raw_facing_direction != 0) + { + total_size += 2 + 8; + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -2507,30 +2447,26 @@ namespace protobuf { _this->_internal_set_speed(from._internal_speed()); } - if (from._internal_damage() != 0) - { - _this->_internal_set_damage(from._internal_damage()); - } if (from._internal_place() != 0) { _this->_internal_set_place(from._internal_place()); } - if (from._internal_tricker_type() != 0) - { - _this->_internal_set_tricker_type(from._internal_tricker_type()); - } if (from._internal_guid() != 0) { _this->_internal_set_guid(from._internal_guid()); } - if (from._internal_player_id() != 0) + if (from._internal_tricker_type() != 0) { - _this->_internal_set_player_id(from._internal_player_id()); + _this->_internal_set_tricker_type(from._internal_tricker_type()); } if (from._internal_score() != 0) { _this->_internal_set_score(from._internal_score()); } + if (from._internal_player_id() != 0) + { + _this->_internal_set_player_id(from._internal_player_id()); + } if (from._internal_view_range() != 0) { _this->_internal_set_view_range(from._internal_view_range()); @@ -2539,10 +2475,6 @@ namespace protobuf { _this->_internal_set_radius(from._internal_radius()); } - if (from._internal_player_state() != 0) - { - _this->_internal_set_player_state(from._internal_player_state()); - } static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_trick_desire = from._internal_trick_desire(); uint64_t raw_trick_desire; @@ -2559,6 +2491,14 @@ namespace protobuf { _this->_internal_set_class_volume(from._internal_class_volume()); } + if (from._internal_player_state() != 0) + { + _this->_internal_set_player_state(from._internal_player_state()); + } + if (from._internal_bullet_type() != 0) + { + _this->_internal_set_bullet_type(from._internal_bullet_type()); + } static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_facing_direction = from._internal_facing_direction(); uint64_t raw_facing_direction; @@ -2567,10 +2507,6 @@ namespace protobuf { _this->_internal_set_facing_direction(from._internal_facing_direction()); } - if (from._internal_bullet_type() != 0) - { - _this->_internal_set_bullet_type(from._internal_bullet_type()); - } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -2596,7 +2532,7 @@ namespace protobuf _impl_.prop_.InternalSwap(&other->_impl_.prop_); _impl_.buff_.InternalSwap(&other->_impl_.buff_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfTricker, _impl_.bullet_type_) + sizeof(MessageOfTricker::_impl_.bullet_type_) - PROTOBUF_FIELD_OFFSET(MessageOfTricker, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfTricker, _impl_.facing_direction_) + sizeof(MessageOfTricker::_impl_.facing_direction_) - PROTOBUF_FIELD_OFFSET(MessageOfTricker, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); @@ -3471,10 +3407,10 @@ namespace protobuf MessageOfProp* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.type_){}, decltype(_impl_.x_){}, decltype(_impl_.facing_direction_){}, decltype(_impl_.y_){}, decltype(_impl_.place_){}, decltype(_impl_.guid_){}, decltype(_impl_.size_){}, decltype(_impl_.is_moving_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.type_){}, decltype(_impl_.x_){}, decltype(_impl_.facing_direction_){}, decltype(_impl_.y_){}, decltype(_impl_.place_){}, decltype(_impl_.guid_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.type_, &from._impl_.type_, static_cast(reinterpret_cast(&_impl_.is_moving_) - reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.is_moving_)); + ::memcpy(&_impl_.type_, &from._impl_.type_, static_cast(reinterpret_cast(&_impl_.guid_) - reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.guid_)); // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfProp) } @@ -3485,7 +3421,7 @@ namespace protobuf (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.type_){0}, decltype(_impl_.x_){0}, decltype(_impl_.facing_direction_){0}, decltype(_impl_.y_){0}, decltype(_impl_.place_){0}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.size_){0}, decltype(_impl_.is_moving_){false}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.type_){0}, decltype(_impl_.x_){0}, decltype(_impl_.facing_direction_){0}, decltype(_impl_.y_){0}, decltype(_impl_.place_){0}, decltype(_impl_.guid_){int64_t{0}}, /*decltype(_impl_._cached_size_)*/ {}}; } MessageOfProp::~MessageOfProp() @@ -3516,7 +3452,7 @@ namespace protobuf // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; - ::memset(&_impl_.type_, 0, static_cast(reinterpret_cast(&_impl_.is_moving_) - reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.is_moving_)); + ::memset(&_impl_.type_, 0, static_cast(reinterpret_cast(&_impl_.guid_) - reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.guid_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -3593,26 +3529,6 @@ namespace protobuf else goto handle_unusual; continue; - // int32 size = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) - { - _impl_.size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } - else - goto handle_unusual; - continue; - // bool is_moving = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) - { - _impl_.is_moving_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } - else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -3697,20 +3613,6 @@ namespace protobuf ); } - // int32 size = 7; - if (this->_internal_size() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(7, this->_internal_size(), target); - } - - // bool is_moving = 8; - if (this->_internal_is_moving() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_is_moving(), target); - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -3772,18 +3674,6 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_guid()); } - // int32 size = 7; - if (this->_internal_size() != 0) - { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_size()); - } - - // bool is_moving = 8; - if (this->_internal_is_moving() != 0) - { - total_size += 1 + 1; - } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -3832,14 +3722,6 @@ namespace protobuf { _this->_internal_set_guid(from._internal_guid()); } - if (from._internal_size() != 0) - { - _this->_internal_set_size(from._internal_size()); - } - if (from._internal_is_moving() != 0) - { - _this->_internal_set_is_moving(from._internal_is_moving()); - } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -3862,7 +3744,7 @@ namespace protobuf using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfProp, _impl_.is_moving_) + sizeof(MessageOfProp::_impl_.is_moving_) - PROTOBUF_FIELD_OFFSET(MessageOfProp, _impl_.type_)>( + PROTOBUF_FIELD_OFFSET(MessageOfProp, _impl_.guid_) + sizeof(MessageOfProp::_impl_.guid_) - PROTOBUF_FIELD_OFFSET(MessageOfProp, _impl_.type_)>( reinterpret_cast(&_impl_.type_), reinterpret_cast(&other->_impl_.type_) ); @@ -5036,10 +4918,10 @@ namespace protobuf MessageOfDoor* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.is_open_){}, decltype(_impl_.number_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.x_){}, decltype(_impl_.y_){}, decltype(_impl_.is_open_){}, decltype(_impl_.progress_){}, /*decltype(_impl_._cached_size_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.number_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.number_)); + ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.progress_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.progress_)); // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfDoor) } @@ -5050,7 +4932,7 @@ namespace protobuf (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.is_open_){false}, decltype(_impl_.number_){0}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.x_){0}, decltype(_impl_.y_){0}, decltype(_impl_.is_open_){false}, decltype(_impl_.progress_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } MessageOfDoor::~MessageOfDoor() @@ -5081,7 +4963,7 @@ namespace protobuf // Prevent compiler warnings about cached_has_bits being unused (void)cached_has_bits; - ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.number_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.number_)); + ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.progress_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.progress_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -5126,11 +5008,11 @@ namespace protobuf else goto handle_unusual; continue; - // int32 number = 4; + // int32 progress = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + _impl_.progress_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); } else @@ -5191,11 +5073,11 @@ namespace protobuf target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_is_open(), target); } - // int32 number = 4; - if (this->_internal_number() != 0) + // int32 progress = 4; + if (this->_internal_progress() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_number(), target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_progress(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) @@ -5235,10 +5117,10 @@ namespace protobuf total_size += 1 + 1; } - // int32 number = 4; - if (this->_internal_number() != 0) + // int32 progress = 4; + if (this->_internal_progress() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_number()); + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_progress()); } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); @@ -5273,9 +5155,9 @@ namespace protobuf { _this->_internal_set_is_open(from._internal_is_open()); } - if (from._internal_number() != 0) + if (from._internal_progress() != 0) { - _this->_internal_set_number(from._internal_number()); + _this->_internal_set_progress(from._internal_progress()); } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -5299,7 +5181,7 @@ namespace protobuf using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfDoor, _impl_.number_) + sizeof(MessageOfDoor::_impl_.number_) - PROTOBUF_FIELD_OFFSET(MessageOfDoor, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfDoor, _impl_.progress_) + sizeof(MessageOfDoor::_impl_.progress_) - PROTOBUF_FIELD_OFFSET(MessageOfDoor, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); diff --git a/CAPI/cpp/proto/Message2Clients.pb.h b/CAPI/cpp/proto/Message2Clients.pb.h index e889130..ace7ed7 100644 --- a/CAPI/cpp/proto/Message2Clients.pb.h +++ b/CAPI/cpp/proto/Message2Clients.pb.h @@ -321,19 +321,18 @@ namespace protobuf kPlaceFieldNumber = 7, kGuidFieldNumber = 10, kPlayerStateFieldNumber = 9, - kStateFieldNumber = 11, kBulletTypeFieldNumber = 12, kLearningSpeedFieldNumber = 13, - kPlayerIdFieldNumber = 15, kTreatSpeedFieldNumber = 14, + kPlayerIdFieldNumber = 15, kViewRangeFieldNumber = 16, kRadiusFieldNumber = 17, - kScoreFieldNumber = 20, kDangerAlertFieldNumber = 19, + kScoreFieldNumber = 20, kTreatProgressFieldNumber = 21, kRescueProgressFieldNumber = 22, - kFacingDirectionFieldNumber = 24, kStudentTypeFieldNumber = 23, + kFacingDirectionFieldNumber = 24, }; // repeated double time_until_skill_available = 6; int time_until_skill_available_size() const; @@ -482,16 +481,6 @@ namespace protobuf ::protobuf::PlayerState _internal_player_state() const; void _internal_set_player_state(::protobuf::PlayerState value); - public: - // .protobuf.PlayerState state = 11; - void clear_state(); - ::protobuf::PlayerState state() const; - void set_state(::protobuf::PlayerState value); - - private: - ::protobuf::PlayerState _internal_state() const; - void _internal_set_state(::protobuf::PlayerState value); - public: // .protobuf.BulletType bullet_type = 12; void clear_bullet_type(); @@ -512,16 +501,6 @@ namespace protobuf int32_t _internal_learning_speed() const; void _internal_set_learning_speed(int32_t value); - public: - // int64 player_id = 15; - void clear_player_id(); - int64_t player_id() const; - void set_player_id(int64_t value); - - private: - int64_t _internal_player_id() const; - void _internal_set_player_id(int64_t value); - public: // int32 treat_speed = 14; void clear_treat_speed(); @@ -532,6 +511,16 @@ namespace protobuf int32_t _internal_treat_speed() const; void _internal_set_treat_speed(int32_t value); + public: + // int64 player_id = 15; + void clear_player_id(); + int64_t player_id() const; + void set_player_id(int64_t value); + + private: + int64_t _internal_player_id() const; + void _internal_set_player_id(int64_t value); + public: // int32 view_range = 16; void clear_view_range(); @@ -552,16 +541,6 @@ namespace protobuf int32_t _internal_radius() const; void _internal_set_radius(int32_t value); - public: - // int32 score = 20; - void clear_score(); - int32_t score() const; - void set_score(int32_t value); - - private: - int32_t _internal_score() const; - void _internal_set_score(int32_t value); - public: // double danger_alert = 19; void clear_danger_alert(); @@ -572,6 +551,16 @@ namespace protobuf double _internal_danger_alert() const; void _internal_set_danger_alert(double value); + public: + // int32 score = 20; + void clear_score(); + int32_t score() const; + void set_score(int32_t value); + + private: + int32_t _internal_score() const; + void _internal_set_score(int32_t value); + public: // int32 treat_progress = 21; void clear_treat_progress(); @@ -592,16 +581,6 @@ namespace protobuf int32_t _internal_rescue_progress() const; void _internal_set_rescue_progress(int32_t value); - public: - // double facing_direction = 24; - void clear_facing_direction(); - double facing_direction() const; - void set_facing_direction(double value); - - private: - double _internal_facing_direction() const; - void _internal_set_facing_direction(double value); - public: // .protobuf.StudentType student_type = 23; void clear_student_type(); @@ -612,6 +591,16 @@ namespace protobuf ::protobuf::StudentType _internal_student_type() const; void _internal_set_student_type(::protobuf::StudentType value); + public: + // double facing_direction = 24; + void clear_facing_direction(); + double facing_direction() const; + void set_facing_direction(double value); + + private: + double _internal_facing_direction() const; + void _internal_set_facing_direction(double value); + public: // @@protoc_insertion_point(class_scope:protobuf.MessageOfStudent) @@ -637,19 +626,18 @@ namespace protobuf int place_; int64_t guid_; int player_state_; - int state_; int bullet_type_; int32_t learning_speed_; - int64_t player_id_; int32_t treat_speed_; + int64_t player_id_; int32_t view_range_; int32_t radius_; - int32_t score_; double danger_alert_; + int32_t score_; int32_t treat_progress_; int32_t rescue_progress_; - double facing_direction_; int student_type_; + double facing_direction_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -824,19 +812,18 @@ namespace protobuf kXFieldNumber = 1, kYFieldNumber = 2, kSpeedFieldNumber = 3, - kDamageFieldNumber = 4, kPlaceFieldNumber = 6, - kTrickerTypeFieldNumber = 8, kGuidFieldNumber = 9, - kPlayerIdFieldNumber = 11, + kTrickerTypeFieldNumber = 8, kScoreFieldNumber = 10, + kPlayerIdFieldNumber = 11, kViewRangeFieldNumber = 12, kRadiusFieldNumber = 13, - kPlayerStateFieldNumber = 14, kTrickDesireFieldNumber = 15, kClassVolumeFieldNumber = 16, - kFacingDirectionFieldNumber = 17, + kPlayerStateFieldNumber = 14, kBulletTypeFieldNumber = 18, + kFacingDirectionFieldNumber = 17, }; // repeated double time_until_skill_available = 5; int time_until_skill_available_size() const; @@ -935,16 +922,6 @@ namespace protobuf int32_t _internal_speed() const; void _internal_set_speed(int32_t value); - public: - // int32 damage = 4; - void clear_damage(); - int32_t damage() const; - void set_damage(int32_t value); - - private: - int32_t _internal_damage() const; - void _internal_set_damage(int32_t value); - public: // .protobuf.PlaceType place = 6; void clear_place(); @@ -955,16 +932,6 @@ namespace protobuf ::protobuf::PlaceType _internal_place() const; void _internal_set_place(::protobuf::PlaceType value); - public: - // .protobuf.TrickerType tricker_type = 8; - void clear_tricker_type(); - ::protobuf::TrickerType tricker_type() const; - void set_tricker_type(::protobuf::TrickerType value); - - private: - ::protobuf::TrickerType _internal_tricker_type() const; - void _internal_set_tricker_type(::protobuf::TrickerType value); - public: // int64 guid = 9; void clear_guid(); @@ -976,14 +943,14 @@ namespace protobuf void _internal_set_guid(int64_t value); public: - // int64 player_id = 11; - void clear_player_id(); - int64_t player_id() const; - void set_player_id(int64_t value); + // .protobuf.TrickerType tricker_type = 8; + void clear_tricker_type(); + ::protobuf::TrickerType tricker_type() const; + void set_tricker_type(::protobuf::TrickerType value); private: - int64_t _internal_player_id() const; - void _internal_set_player_id(int64_t value); + ::protobuf::TrickerType _internal_tricker_type() const; + void _internal_set_tricker_type(::protobuf::TrickerType value); public: // int32 score = 10; @@ -995,6 +962,16 @@ namespace protobuf int32_t _internal_score() const; void _internal_set_score(int32_t value); + public: + // int64 player_id = 11; + void clear_player_id(); + int64_t player_id() const; + void set_player_id(int64_t value); + + private: + int64_t _internal_player_id() const; + void _internal_set_player_id(int64_t value); + public: // int32 view_range = 12; void clear_view_range(); @@ -1015,16 +992,6 @@ namespace protobuf int32_t _internal_radius() const; void _internal_set_radius(int32_t value); - public: - // .protobuf.PlayerState player_state = 14; - void clear_player_state(); - ::protobuf::PlayerState player_state() const; - void set_player_state(::protobuf::PlayerState value); - - private: - ::protobuf::PlayerState _internal_player_state() const; - void _internal_set_player_state(::protobuf::PlayerState value); - public: // double trick_desire = 15; void clear_trick_desire(); @@ -1046,14 +1013,14 @@ namespace protobuf void _internal_set_class_volume(double value); public: - // double facing_direction = 17; - void clear_facing_direction(); - double facing_direction() const; - void set_facing_direction(double value); + // .protobuf.PlayerState player_state = 14; + void clear_player_state(); + ::protobuf::PlayerState player_state() const; + void set_player_state(::protobuf::PlayerState value); private: - double _internal_facing_direction() const; - void _internal_set_facing_direction(double value); + ::protobuf::PlayerState _internal_player_state() const; + void _internal_set_player_state(::protobuf::PlayerState value); public: // .protobuf.BulletType bullet_type = 18; @@ -1065,6 +1032,16 @@ namespace protobuf ::protobuf::BulletType _internal_bullet_type() const; void _internal_set_bullet_type(::protobuf::BulletType value); + public: + // double facing_direction = 17; + void clear_facing_direction(); + double facing_direction() const; + void set_facing_direction(double value); + + private: + double _internal_facing_direction() const; + void _internal_set_facing_direction(double value); + public: // @@protoc_insertion_point(class_scope:protobuf.MessageOfTricker) @@ -1085,19 +1062,18 @@ namespace protobuf int32_t x_; int32_t y_; int32_t speed_; - int32_t damage_; int place_; - int tricker_type_; int64_t guid_; - int64_t player_id_; + int tricker_type_; int32_t score_; + int64_t player_id_; int32_t view_range_; int32_t radius_; - int player_state_; double trick_desire_; double class_volume_; - double facing_direction_; + int player_state_; int bullet_type_; + double facing_direction_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -1812,8 +1788,6 @@ namespace protobuf kYFieldNumber = 3, kPlaceFieldNumber = 6, kGuidFieldNumber = 5, - kSizeFieldNumber = 7, - kIsMovingFieldNumber = 8, }; // .protobuf.PropType type = 1; void clear_type(); @@ -1874,26 +1848,6 @@ namespace protobuf int64_t _internal_guid() const; void _internal_set_guid(int64_t value); - public: - // int32 size = 7; - void clear_size(); - int32_t size() const; - void set_size(int32_t value); - - private: - int32_t _internal_size() const; - void _internal_set_size(int32_t value); - - public: - // bool is_moving = 8; - void clear_is_moving(); - bool is_moving() const; - void set_is_moving(bool value); - - private: - bool _internal_is_moving() const; - void _internal_set_is_moving(bool value); - public: // @@protoc_insertion_point(class_scope:protobuf.MessageOfProp) @@ -1912,8 +1866,6 @@ namespace protobuf int32_t y_; int place_; int64_t guid_; - int32_t size_; - bool is_moving_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -2973,7 +2925,7 @@ namespace protobuf kXFieldNumber = 1, kYFieldNumber = 2, kIsOpenFieldNumber = 3, - kNumberFieldNumber = 4, + kProgressFieldNumber = 4, }; // int32 x = 1; void clear_x(); @@ -3005,14 +2957,14 @@ namespace protobuf void _internal_set_is_open(bool value); public: - // int32 number = 4; - void clear_number(); - int32_t number() const; - void set_number(int32_t value); + // int32 progress = 4; + void clear_progress(); + int32_t progress() const; + void set_progress(int32_t value); private: - int32_t _internal_number() const; - void _internal_set_number(int32_t value); + int32_t _internal_progress() const; + void _internal_set_progress(int32_t value); public: // @@protoc_insertion_point(class_scope:protobuf.MessageOfDoor) @@ -3029,7 +2981,7 @@ namespace protobuf int32_t x_; int32_t y_; bool is_open_; - int32_t number_; + int32_t progress_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -5660,30 +5612,6 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.MessageOfStudent.guid) } - // .protobuf.PlayerState state = 11; - inline void MessageOfStudent::clear_state() - { - _impl_.state_ = 0; - } - inline ::protobuf::PlayerState MessageOfStudent::_internal_state() const - { - return static_cast<::protobuf::PlayerState>(_impl_.state_); - } - inline ::protobuf::PlayerState MessageOfStudent::state() const - { - // @@protoc_insertion_point(field_get:protobuf.MessageOfStudent.state) - return _internal_state(); - } - inline void MessageOfStudent::_internal_set_state(::protobuf::PlayerState value) - { - _impl_.state_ = value; - } - inline void MessageOfStudent::set_state(::protobuf::PlayerState value) - { - _internal_set_state(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfStudent.state) - } - // .protobuf.BulletType bullet_type = 12; inline void MessageOfStudent::clear_bullet_type() { @@ -6102,30 +6030,6 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.MessageOfTricker.speed) } - // int32 damage = 4; - inline void MessageOfTricker::clear_damage() - { - _impl_.damage_ = 0; - } - inline int32_t MessageOfTricker::_internal_damage() const - { - return _impl_.damage_; - } - inline int32_t MessageOfTricker::damage() const - { - // @@protoc_insertion_point(field_get:protobuf.MessageOfTricker.damage) - return _internal_damage(); - } - inline void MessageOfTricker::_internal_set_damage(int32_t value) - { - _impl_.damage_ = value; - } - inline void MessageOfTricker::set_damage(int32_t value) - { - _internal_set_damage(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfTricker.damage) - } - // repeated double time_until_skill_available = 5; inline int MessageOfTricker::_internal_time_until_skill_available_size() const { @@ -7097,54 +7001,6 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.MessageOfProp.place) } - // int32 size = 7; - inline void MessageOfProp::clear_size() - { - _impl_.size_ = 0; - } - inline int32_t MessageOfProp::_internal_size() const - { - return _impl_.size_; - } - inline int32_t MessageOfProp::size() const - { - // @@protoc_insertion_point(field_get:protobuf.MessageOfProp.size) - return _internal_size(); - } - inline void MessageOfProp::_internal_set_size(int32_t value) - { - _impl_.size_ = value; - } - inline void MessageOfProp::set_size(int32_t value) - { - _internal_set_size(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfProp.size) - } - - // bool is_moving = 8; - inline void MessageOfProp::clear_is_moving() - { - _impl_.is_moving_ = false; - } - inline bool MessageOfProp::_internal_is_moving() const - { - return _impl_.is_moving_; - } - inline bool MessageOfProp::is_moving() const - { - // @@protoc_insertion_point(field_get:protobuf.MessageOfProp.is_moving) - return _internal_is_moving(); - } - inline void MessageOfProp::_internal_set_is_moving(bool value) - { - _impl_.is_moving_ = value; - } - inline void MessageOfProp::set_is_moving(bool value) - { - _internal_set_is_moving(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfProp.is_moving) - } - // ------------------------------------------------------------------- // MessageOfPickedProp @@ -7573,28 +7429,28 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.MessageOfDoor.is_open) } - // int32 number = 4; - inline void MessageOfDoor::clear_number() + // int32 progress = 4; + inline void MessageOfDoor::clear_progress() { - _impl_.number_ = 0; + _impl_.progress_ = 0; } - inline int32_t MessageOfDoor::_internal_number() const + inline int32_t MessageOfDoor::_internal_progress() const { - return _impl_.number_; + return _impl_.progress_; } - inline int32_t MessageOfDoor::number() const + inline int32_t MessageOfDoor::progress() const { - // @@protoc_insertion_point(field_get:protobuf.MessageOfDoor.number) - return _internal_number(); + // @@protoc_insertion_point(field_get:protobuf.MessageOfDoor.progress) + return _internal_progress(); } - inline void MessageOfDoor::_internal_set_number(int32_t value) + inline void MessageOfDoor::_internal_set_progress(int32_t value) { - _impl_.number_ = value; + _impl_.progress_ = value; } - inline void MessageOfDoor::set_number(int32_t value) + inline void MessageOfDoor::set_progress(int32_t value) { - _internal_set_number(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfDoor.number) + _internal_set_progress(value); + // @@protoc_insertion_point(field_set:protobuf.MessageOfDoor.progress) } // ------------------------------------------------------------------- diff --git a/CAPI/cpp/proto/MessageType.pb.cc b/CAPI/cpp/proto/MessageType.pb.cc index c29ab8e..1537d5b 100644 --- a/CAPI/cpp/proto/MessageType.pb.cc +++ b/CAPI/cpp/proto/MessageType.pb.cc @@ -30,43 +30,45 @@ static constexpr ::_pbi::MigrationSchema* schemas = nullptr; static constexpr ::_pb::Message* const* file_default_instances = nullptr; const char descriptor_table_protodef_MessageType_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\021MessageType.proto\022\010protobuf*{\n\nBulletT" - "ype\022\024\n\020NULL_BULLET_TYPE\020\000\022\017\n\013LINE_BULLET" - "\020\001\022\021\n\rCOMMON_BULLET\020\002\022\017\n\013FAST_BULLET\020\003\022\023" - "\n\017ORDINARY_BULLET\020\004\022\r\n\tATOM_BOMB\020\005*\212\001\n\tP" - "laceType\022\023\n\017NULL_PLACE_TYPE\020\000\022\010\n\004LAND\020\001\022" - "\010\n\004WALL\020\002\022\t\n\005GRASS\020\003\022\r\n\tCLASSROOM\020\004\022\010\n\004G" - "ATE\020\005\022\017\n\013HIDDEN_GATE\020\006\022\n\n\006WINDOW\020\007\022\010\n\004DO" - "OR\020\010\022\t\n\005CHEST\020\t*8\n\tShapeType\022\023\n\017NULL_SHA" - "PE_TYPE\020\000\022\n\n\006CIRCLE\020\001\022\n\n\006SQUARE\020\002*N\n\010Pro" - "pType\022\022\n\016NULL_PROP_TYPE\020\000\022\n\n\006PTYPE1\020\001\022\n\n" - "\006PTYPE2\020\002\022\n\n\006PTYPE3\020\003\022\n\n\006PTYPE4\020\004*f\n\017Stu" - "dentBuffType\022\023\n\017NULL_SBUFF_TYPE\020\000\022\016\n\nSBU" - "FFTYPE1\020\001\022\016\n\nSBUFFTYPE2\020\002\022\016\n\nSBUFFTYPE3\020" - "\003\022\016\n\nSBUFFTYPE4\020\004*\347\001\n\013PlayerState\022\017\n\013NUL" - "L_STATUS\020\000\022\010\n\004IDLE\020\001\022\014\n\010LEARNING\020\002\022\014\n\010AD" - "DICTED\020\003\022\010\n\004QUIT\020\004\022\r\n\tGRADUATED\020\005\022\013\n\007TRE" - "ATED\020\006\022\013\n\007RESCUED\020\007\022\013\n\007STUNNED\020\010\022\014\n\010TREA" - "TING\020\t\022\014\n\010RESCUING\020\n\022\014\n\010SWINGING\020\013\022\r\n\tAT" - "TACKING\020\014\022\013\n\007LOCKING\020\r\022\r\n\tRUMMAGING\020\016\022\014\n" - "\010CLIMBING\020\017*f\n\017TrickerBuffType\022\023\n\017NULL_T" - "BUFF_TYPE\020\000\022\016\n\nTBUFFTYPE1\020\001\022\016\n\nTBUFFTYPE" - "2\020\002\022\016\n\nTBUFFTYPE3\020\003\022\016\n\nTBUFFTYPE4\020\004*J\n\nP" - "layerType\022\024\n\020NULL_PLAYER_TYPE\020\000\022\022\n\016STUDE" - "NT_PLAYER\020\001\022\022\n\016TRICKER_PLAYER\020\002*l\n\013Stude" - "ntType\022\025\n\021NULL_STUDENT_TYPE\020\000\022\020\n\014STUDENT" - "TYPE1\020\001\022\020\n\014STUDENTTYPE2\020\002\022\020\n\014STUDENTTYPE" - "3\020\003\022\020\n\014STUDENTTYPE4\020\004*l\n\013TrickerType\022\025\n\021" - "NULL_TRICKER_TYPE\020\000\022\020\n\014TRICKERTYPE1\020\001\022\020\n" - "\014TRICKERTYPE2\020\002\022\020\n\014TRICKERTYPE3\020\003\022\020\n\014TRI" - "CKERTYPE4\020\004*P\n\tGameState\022\023\n\017NULL_GAME_ST" - "ATE\020\000\022\016\n\nGAME_START\020\001\022\020\n\014GAME_RUNNING\020\002\022" - "\014\n\010GAME_END\020\003b\006proto3"; + "\n\021MessageType.proto\022\010protobuf*\207\001\n\nBullet" + "Type\022\024\n\020NULL_BULLET_TYPE\020\000\022\020\n\014FLYING_KNI" + "FE\020\001\022\034\n\030COMMON_ATTACK_OF_TRICKER\020\002\022\017\n\013FA" + "ST_BULLET\020\003\022\023\n\017ORDINARY_BULLET\020\004\022\r\n\tATOM" + "_BOMB\020\005*\241\001\n\tPlaceType\022\023\n\017NULL_PLACE_TYPE" + "\020\000\022\010\n\004LAND\020\001\022\010\n\004WALL\020\002\022\t\n\005GRASS\020\003\022\r\n\tCLA" + "SSROOM\020\004\022\010\n\004GATE\020\005\022\017\n\013HIDDEN_GATE\020\006\022\n\n\006W" + "INDOW\020\007\022\t\n\005DOOR3\020\010\022\t\n\005DOOR5\020\t\022\t\n\005DOOR6\020\n" + "\022\t\n\005CHEST\020\013*8\n\tShapeType\022\023\n\017NULL_SHAPE_T" + "YPE\020\000\022\n\n\006CIRCLE\020\001\022\n\n\006SQUARE\020\002*H\n\010PropTyp" + "e\022\022\n\016NULL_PROP_TYPE\020\000\022\010\n\004KEY3\020\001\022\010\n\004KEY5\020" + "\002\022\010\n\004KEY6\020\003\022\n\n\006PTYPE4\020\004*f\n\017StudentBuffTy" + "pe\022\023\n\017NULL_SBUFF_TYPE\020\000\022\016\n\nSBUFFTYPE1\020\001\022" + "\016\n\nSBUFFTYPE2\020\002\022\016\n\nSBUFFTYPE3\020\003\022\016\n\nSBUFF" + "TYPE4\020\004*\251\002\n\013PlayerState\022\017\n\013NULL_STATUS\020\000" + "\022\010\n\004IDLE\020\001\022\014\n\010LEARNING\020\002\022\014\n\010ADDICTED\020\003\022\010" + "\n\004QUIT\020\004\022\r\n\tGRADUATED\020\005\022\013\n\007TREATED\020\006\022\013\n\007" + "RESCUED\020\007\022\013\n\007STUNNED\020\010\022\014\n\010TREATING\020\t\022\014\n\010" + "RESCUING\020\n\022\014\n\010SWINGING\020\013\022\r\n\tATTACKING\020\014\022" + "\013\n\007LOCKING\020\r\022\r\n\tRUMMAGING\020\016\022\014\n\010CLIMBING\020" + "\017\022\023\n\017OPENING_A_CHEST\020\020\022\027\n\023USING_SPECIAL_" + "SKILL\020\021\022\022\n\016OPENING_A_GATE\020\022*f\n\017TrickerBu" + "ffType\022\023\n\017NULL_TBUFF_TYPE\020\000\022\016\n\nTBUFFTYPE" + "1\020\001\022\016\n\nTBUFFTYPE2\020\002\022\016\n\nTBUFFTYPE3\020\003\022\016\n\nT" + "BUFFTYPE4\020\004*J\n\nPlayerType\022\024\n\020NULL_PLAYER" + "_TYPE\020\000\022\022\n\016STUDENT_PLAYER\020\001\022\022\n\016TRICKER_P" + "LAYER\020\002*g\n\013StudentType\022\025\n\021NULL_STUDENT_T" + "YPE\020\000\022\013\n\007ATHLETE\020\001\022\020\n\014STUDENTTYPE2\020\002\022\020\n\014" + "STUDENTTYPE3\020\003\022\020\n\014STUDENTTYPE4\020\004*h\n\013Tric" + "kerType\022\025\n\021NULL_TRICKER_TYPE\020\000\022\014\n\010ASSASS" + "IN\020\001\022\020\n\014TRICKERTYPE2\020\002\022\020\n\014TRICKERTYPE3\020\003" + "\022\020\n\014TRICKERTYPE4\020\004*P\n\tGameState\022\023\n\017NULL_" + "GAME_STATE\020\000\022\016\n\nGAME_START\020\001\022\020\n\014GAME_RUN" + "NING\020\002\022\014\n\010GAME_END\020\003b\006proto3"; static ::_pbi::once_flag descriptor_table_MessageType_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_MessageType_2eproto = { false, false, - 1261, + 1348, descriptor_table_protodef_MessageType_2eproto, "MessageType.proto", &descriptor_table_MessageType_2eproto_once, @@ -129,6 +131,8 @@ namespace protobuf case 7: case 8: case 9: + case 10: + case 11: return true; default: return false; @@ -218,6 +222,9 @@ namespace protobuf case 13: case 14: case 15: + case 16: + case 17: + case 18: return true; default: return false; diff --git a/CAPI/cpp/proto/MessageType.pb.h b/CAPI/cpp/proto/MessageType.pb.h index 7a10f95..93bcfed 100644 --- a/CAPI/cpp/proto/MessageType.pb.h +++ b/CAPI/cpp/proto/MessageType.pb.h @@ -53,8 +53,8 @@ namespace protobuf enum BulletType : int { NULL_BULLET_TYPE = 0, - LINE_BULLET = 1, - COMMON_BULLET = 2, + FLYING_KNIFE = 1, + COMMON_ATTACK_OF_TRICKER = 2, FAST_BULLET = 3, ORDINARY_BULLET = 4, ATOM_BOMB = 5, @@ -93,8 +93,10 @@ namespace protobuf GATE = 5, HIDDEN_GATE = 6, WINDOW = 7, - DOOR = 8, - CHEST = 9, + DOOR3 = 8, + DOOR5 = 9, + DOOR6 = 10, + CHEST = 11, PlaceType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), PlaceType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; @@ -153,9 +155,9 @@ namespace protobuf enum PropType : int { NULL_PROP_TYPE = 0, - PTYPE1 = 1, - PTYPE2 = 2, - PTYPE3 = 3, + KEY3 = 1, + KEY5 = 2, + KEY6 = 3, PTYPE4 = 4, PropType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), PropType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() @@ -232,12 +234,15 @@ namespace protobuf LOCKING = 13, RUMMAGING = 14, CLIMBING = 15, + OPENING_A_CHEST = 16, + USING_SPECIAL_SKILL = 17, + OPENING_A_GATE = 18, PlayerState_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), PlayerState_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool PlayerState_IsValid(int value); constexpr PlayerState PlayerState_MIN = NULL_STATUS; - constexpr PlayerState PlayerState_MAX = CLIMBING; + constexpr PlayerState PlayerState_MAX = OPENING_A_GATE; constexpr int PlayerState_ARRAYSIZE = PlayerState_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PlayerState_descriptor(); @@ -322,7 +327,7 @@ namespace protobuf enum StudentType : int { NULL_STUDENT_TYPE = 0, - STUDENTTYPE1 = 1, + ATHLETE = 1, STUDENTTYPE2 = 2, STUDENTTYPE3 = 3, STUDENTTYPE4 = 4, @@ -354,7 +359,7 @@ namespace protobuf enum TrickerType : int { NULL_TRICKER_TYPE = 0, - TRICKERTYPE1 = 1, + ASSASSIN = 1, TRICKERTYPE2 = 2, TRICKERTYPE3 = 3, TRICKERTYPE4 = 4, diff --git a/CAPI/python/PyAPI/Communication.py b/CAPI/python/PyAPI/Communication.py index b7e49ff..57b6941 100644 --- a/CAPI/python/PyAPI/Communication.py +++ b/CAPI/python/PyAPI/Communication.py @@ -119,68 +119,86 @@ class Communication: else: return learnResult.act_success - def EndLearning(self, playerID: int) -> bool: + def StartTreatMate(self, playerID: int) -> bool: try: - learnResult = self.__THUAI6Stub.EndLearning( + helpResult = self.__THUAI6Stub.StartTreatMate( THUAI62Proto.THUAI62ProtobufID(playerID)) except grpc.RpcError as e: return False else: - return learnResult.act_success + return helpResult.act_success - def StartHelpMate(self, playerID: int) -> bool: + def StartRescueMate(self, playerID: int) -> bool: try: - helpResult = self.__THUAI6Stub.StartHelpMate( + helpResult = self.__THUAI6Stub.StartRescueMate( THUAI62Proto.THUAI62ProtobufID(playerID)) except grpc.RpcError as e: return False else: return helpResult.act_success - def EndHelpMate(self, playerID: int) -> bool: + def Attack(self, angle: float, playerID: int) -> bool: try: - helpResult = self.__THUAI6Stub.EndHelpMate( + attackResult = self.__THUAI6Stub.Attack( + THUAI62Proto.THUAI62ProtobufTrick(angle, playerID)) + except grpc.RpcError as e: + return False + else: + return attackResult.act_success + + def OpenDoor(self, playerID: int) -> bool: + try: + openResult = self.__THUAI6Stub.OpenDoor( THUAI62Proto.THUAI62ProtobufID(playerID)) except grpc.RpcError as e: return False else: - return helpResult.act_success + return openResult.act_success - def Trick(self, angle: float, playerID: int) -> bool: + def CloseDoor(self, playerID: int) -> bool: try: - trickResult = self.__THUAI6Stub.Trick( - THUAI62Proto.THUAI62ProtobufTrick(angle, playerID)) + closeResult = self.__THUAI6Stub.CloseDoor( + THUAI62Proto.THUAI62ProtobufID(playerID)) + except grpc.RpcError as e: + return False + else: + return closeResult.act_success + + def SkipWindow(self, playerID: int) -> bool: + try: + skipResult = self.__THUAI6Stub.SkipWindow( + THUAI62Proto.THUAI62ProtobufID(playerID)) except grpc.RpcError as e: return False else: - return trickResult.act_success + return skipResult.act_success - def StartExam(self, playerID: int) -> bool: + def StartOpenGate(self, playerID: int) -> bool: try: - carryResult = self.__THUAI6Stub.StartExam( + openResult = self.__THUAI6Stub.StartOpenGate( THUAI62Proto.THUAI62ProtobufID(playerID)) except grpc.RpcError as e: return False else: - return carryResult.act_success + return openResult.act_success - def EndExam(self, playerID: int) -> bool: + def StartOpenChest(self, playerID: int) -> bool: try: - releaseResult = self.__THUAI6Stub.EndExam( + openResult = self.__THUAI6Stub.StartOpenChest( THUAI62Proto.THUAI62ProtobufID(playerID)) except grpc.RpcError as e: return False else: - return releaseResult.act_success + return openResult.act_success - def MakeFail(self, playerID: int) -> bool: + def EndAllAction(self, playerID: int) -> bool: try: - hangResult = self.__THUAI6Stub.MakeFail( + endResult = self.__THUAI6Stub.EndAllAction( THUAI62Proto.THUAI62ProtobufID(playerID)) except grpc.RpcError as e: return False else: - return hangResult.act_success + return endResult.act_success def TryConnection(self, playerID: int) -> bool: try: diff --git a/CAPI/python/PyAPI/State.py b/CAPI/python/PyAPI/State.py index e6c967a..eb80a3b 100644 --- a/CAPI/python/PyAPI/State.py +++ b/CAPI/python/PyAPI/State.py @@ -11,6 +11,13 @@ class State: props: List[THUAI6.Prop] - map: List[List[THUAI6.PlaceType]] + gameMap: List[List[THUAI6.PlaceType]] + + bullets: List[THUAI6.Bullet] + bombedBullets: List[THUAI6.BombedBullet] + + mapInfo: THUAI6.GameMap + + gameInfo: THUAI6.GameInfo guids: List[int] diff --git a/CAPI/python/PyAPI/logic.py b/CAPI/python/PyAPI/logic.py index 83140f0..da5aa89 100644 --- a/CAPI/python/PyAPI/logic.py +++ b/CAPI/python/PyAPI/logic.py @@ -89,12 +89,49 @@ class Logic(ILogic): def GetFullMap(self) -> List[List[THUAI6.PlaceType]]: with self.__mtxState: self.__logger.debug("Called GetFullMap") - return self.__currentState.map + return self.__currentState.gameMap def GetPlaceType(self, x: int, y: int) -> THUAI6.PlaceType: with self.__mtxState: self.__logger.debug("Called GetPlaceType") - return self.__currentState.map[x][y] + return self.__currentState.gameMap[x][y] + + def IsDoorOpen(self, x: int, y: int) -> bool: + with self.__mtxState: + self.__logger.debug("Called IsDoorOpen") + if (x, y) in self.__currentState.mapInfo.doorState: + return self.__currentState.mapInfo.doorState[(x, y)] + else: + return False + + def GetClassroomProgess(self, x: int, y: int) -> int: + with self.__mtxState: + self.__logger.debug("Called GetClassroomProgess") + if (x, y) in self.__currentState.mapInfo.classroomState: + return self.__currentState.mapInfo.classroomState[(x, y)] + else: + return 0 + + def GetChestProgress(self, x: int, y: int) -> int: + with self.__mtxState: + self.__logger.debug("Called GetChestProgress") + if (x, y) in self.__currentState.mapInfo.chestState: + return self.__currentState.mapInfo.chestState[(x, y)] + else: + return 0 + + def GetGateProgress(self, x: int, y: int) -> int: + with self.__mtxState: + self.__logger.debug("Called GetGateProgress") + if (x, y) in self.__currentState.mapInfo.gateState: + return self.__currentState.mapInfo.gateState[(x, y)] + else: + return 0 + + def GetGameInfo(self) -> THUAI6.GameInfo: + with self.__mtxState: + self.__logger.debug("Called GetGameInfo") + return self.__currentState.gameInfo def Move(self, time: int, angle: float) -> bool: self.__logger.debug("Called Move") @@ -146,35 +183,41 @@ class Logic(ILogic): self.__logger.debug("Called StartLearning") return self.__comm.StartLearning(self.__playerID) - def EndLearning(self) -> bool: - self.__logger.debug("Called EndLearning") - return self.__comm.EndLearning(self.__playerID) + def StartTreatMate(self) -> bool: + self.__logger.debug("Called StartTreatMate") + return self.__comm.StartTreatMate(self.__playerID) + + def StartRescueMate(self) -> bool: + self.__logger.debug("Called StartRescueMate") + return self.__comm.StartRescueMate(self.__playerID) - def StartHelpMate(self) -> bool: - self.__logger.debug("Called StartHelpMate") - return self.__comm.StartHelpMate(self.__playerID) + def Attack(self, angle: float) -> bool: + self.__logger.debug("Called Trick") + return self.__comm.Attack(angle, self.__playerID) - def EndHelpMate(self) -> bool: - self.__logger.debug("Called EndHelpMate") - return self.__comm.EndHelpMate(self.__playerID) + def CloseDoor(self) -> bool: + self.__logger.debug("Called CloseDoor") + return self.__comm.CloseDoor(self.__playerID) - # Tricker使用的接口 + def OpenDoor(self) -> bool: + self.__logger.debug("Called OpenDoor") + return self.__comm.OpenDoor(self.__playerID) - def Trick(self, angle: float) -> bool: - self.__logger.debug("Called Trick") - return self.__comm.Trick(angle, self.__playerID) + def SkipWindow(self) -> bool: + self.__logger.debug("Called SkipWindow") + return self.__comm.SkipWindow(self.__playerID) - def StartExam(self) -> bool: - self.__logger.debug("Called StartExam") - return self.__comm.StartExam(self.__playerID) + def StartOpenGate(self) -> bool: + self.__logger.debug("Called StartOpenGate") + return self.__comm.StartOpenGate(self.__playerID) - def EndExam(self) -> bool: - self.__logger.debug("Called EndExam") - return self.__comm.EndExam(self.__playerID) + def StartOpenChest(self) -> bool: + self.__logger.debug("Called StartOpenChest") + return self.__comm.StartOpenChest(self.__playerID) - def MakeFail(self) -> bool: - self.__logger.debug("Called MakeFail") - return self.__comm.MakeFail(self.__playerID) + def EndAllAction(self) -> bool: + self.__logger.debug("Called EndAllAction") + return self.__comm.EndAllAction(self.__playerID) # Logic内部逻辑 def __TryConnection(self) -> bool: diff --git a/CAPI/python/PyAPI/structures.py b/CAPI/python/PyAPI/structures.py index eb3d963..1c8ae05 100644 --- a/CAPI/python/PyAPI/structures.py +++ b/CAPI/python/PyAPI/structures.py @@ -1,5 +1,5 @@ from enum import Enum -from typing import List, Dict +from typing import List, Dict, Tuple class GameState(Enum): @@ -15,9 +15,11 @@ class PlaceType(Enum): Wall = 2 Grass = 3 ClassRoom = 4 - BlackRoom = 5 - Gate = 6 - HiddenGate = 7 + Gate = 5 + HiddenGate = 6 + Window = 7 + Door = 8 + Chest = 9 class ShapeType(Enum): @@ -37,6 +39,15 @@ class PropType(Enum): PropType1 = 1 +class BulletType(Enum): + NullBulletType = 0 + LineBullet = 1 + CommonBullet = 2 + FastBullet = 3 + OrdinaryBullet = 4 + AtomBomb = 5 + + class StudentType(Enum): NullStudentType = 0 StudentType1 = 1 @@ -57,14 +68,35 @@ class TrickerBuffType(Enum): TrickerBuffType1 = 1 -class StudentState(Enum): - NullStudentState = 0 +class PlayerState(Enum): + NullState = 0 Idle = 1 Learning = 2 - Fail = 3 - Emotional = 4 - Quit = 5 - Graduated = 6 + Addicted = 3 + Quit = 4 + Graduated = 5 + Treated = 6 + Rescued = 7 + Stunned = 8 + Treating = 9 + Rescuing = 10 + Swinging = 11 + Attacking = 12 + Locking = 13 + Rummaging = 14 + Climbing = 15 + + +class MessageOfObj(Enum): + NullMessageOfObj = 0 + StudentMessage = 1 + TrickerMessage = 2 + PropMessage = 3 + BulletMessage = 4 + BombedBulletMessage = 5 + ClassroomMessage = 6 + GateMessage = 7 + ChestMessage = 8 class Player: @@ -75,25 +107,22 @@ class Player: playerID: int guid: int radius: int - timeUntilSkillAvailable: float + damage: int + timeUntilSkillAvailable: List[float] playerType: PlayerType - prop: PropType + prop: List[PropType] place: PlaceType + playerState: PlayerState class Student(Player): - state: StudentState determination: int - failNum: int - failTime: float - emoTime: float + addiction: int studentType: StudentType buff: List[StudentBuffType] class Tricker(Player): - damage: int - movable: bool trickerType: TrickerType buff: List[TrickerBuffType] @@ -107,3 +136,42 @@ class Prop: place: PlaceType facingDirection: float isMoving: bool + + +class Bullet: + bulletType: BulletType + x: int + y: int + facingDirection: float + guid: int + team: PlayerType + place: PlaceType + bombRange: float + + +class BombedBullet(): + bulletType: BulletType + x: int + y: int + facingDirection: float + mappingID: int + bombRange: float + + +class GameMap: + classroomState: Dict[tuple[int, int], int] + gateState: Dict[tuple[int, int], int] + chestState: Dict[tuple[int, int], bool] + doorState: Dict[tuple[int, int], bool] + + +class GameInfo: + gameTime: int + subjectLeft: int + studentGraduated: int + studentQuited: int + studentScore: int + trickerScore: int + gateOpened: bool + hiddenGateRefreshed: bool + hiddenGateOpened: bool diff --git a/CAPI/python/PyAPI/utils.py b/CAPI/python/PyAPI/utils.py index 875e6ab..d320ef9 100644 --- a/CAPI/python/PyAPI/utils.py +++ b/CAPI/python/PyAPI/utils.py @@ -25,22 +25,34 @@ class AssistFunction(NoInstance): return grid // numOfGridPerCell @staticmethod - def HaveView(viewRange: int, x: int, y: int, newX: int, newY: int, map: List[List[THUAI6.PlaceType]]) -> bool: + def HaveView(viewRange: int, x: int, y: int, newX: int, newY: int, myPlace: THUAI6.PlaceType, newPlace: THUAI6.PlaceType, map: List[List[THUAI6.PlaceType]]) -> bool: deltaX: int = newX - x deltaY: int = newY - y - if deltaX * deltaX + deltaY * deltaY <= viewRange * viewRange: + distance: float = deltaX**2 + deltaY**2 + if myPlace != THUAI6.PlaceType.Grass and newPlace == THUAI6.PlaceType.Grass: + return False + if distance <= viewRange * viewRange: divide: int = max(abs(deltaX), abs(deltaY)) // 100 dx: float = deltaX / divide dy: float = deltaY / divide selfX: float = float(x) selfY: float = float(y) - for i in range(divide): - selfX += dx - selfY += dy - if map[AssistFunction.GridToCell(int(selfX))][AssistFunction.GridToCell(int(selfY))] != THUAI6.PlaceType.Land: - return False + if newPlace == THUAI6.PlaceType.Grass and myPlace == THUAI6.PlaceType.Grass: + for i in range(divide): + selfX += dx + selfY += dy + if map[AssistFunction.GridToCell(int(selfX))][AssistFunction.GridToCell(int(selfY))] != THUAI6.PlaceType.Grass: + return False + else: + return True else: - return True + for i in range(divide): + selfX += dx + selfY += dy + if map[AssistFunction.GridToCell(int(selfX))][AssistFunction.GridToCell(int(selfY))] == THUAI6.PlaceType.Wall: + return False + else: + return True else: return False @@ -52,9 +64,11 @@ class Proto2THUAI6(NoInstance): MessageType.LAND: THUAI6.PlaceType.Land, MessageType.GRASS: THUAI6.PlaceType.Grass, MessageType.CLASSROOM: THUAI6.PlaceType.ClassRoom, - MessageType.BLACKROOM: THUAI6.PlaceType.BlackRoom, MessageType.GATE: THUAI6.PlaceType.Gate, - MessageType.HIDDEN_GATE: THUAI6.PlaceType.HiddenGate} + MessageType.HIDDEN_GATE: THUAI6.PlaceType.HiddenGate, + MessageType.WINDOW: THUAI6.PlaceType.Window, + MessageType.DOOR: THUAI6.PlaceType.Door, + } shapeTypeDict: Final[dict] = { MessageType.NULL_SHAPE_TYPE: THUAI6.ShapeType.NullShapeType, @@ -86,14 +100,18 @@ class Proto2THUAI6(NoInstance): MessageType.NULL_TBUFF_TYPE: THUAI6.TrickerBuffType.NullTrickerBuffType, MessageType.TBUFFTYPE1: THUAI6.TrickerBuffType.TrickerBuffType1, } - studentStateDict: Final[dict] = { - MessageType.NULL_STATUS: THUAI6.StudentState.NullStudentState, - MessageType.IDLE: THUAI6.StudentState.Idle, - MessageType.LEARNING: THUAI6.StudentState.Learning, - MessageType.FAIL: THUAI6.StudentState.Fail, - MessageType.EMOTIONAL: THUAI6.StudentState.Emotional, - MessageType.QUIT: THUAI6.StudentState.Quit, - MessageType.GRADUATED: THUAI6.StudentState.Graduated} + playerStateDict: Final[dict] = { + MessageType.NULL_STATUS: THUAI6.PlayerState.NullState, + MessageType.IDLE: THUAI6.PlayerState.Idle, + MessageType.LEARNING: THUAI6.PlayerState.Learning, + MessageType.ADDICTED: THUAI6.PlayerState.Addicted, + MessageType.QUIT: THUAI6.PlayerState.Quit, + MessageType.GRADUATED: THUAI6.PlayerState.Graduated, + MessageType.RESCUED: THUAI6.PlayerState.Rescued, + MessageType.TREATED: THUAI6.PlayerState.Treated, + MessageType.STUNNED: THUAI6.PlayerState.Stunned, + MessageType.RESCUING: THUAI6.PlayerState.Rescuing, + MessageType.TREATING: THUAI6.PlayerState.Treating, } gameStateDict: Final[dict] = { MessageType.NULL_GAME_STATE: THUAI6.GameState.NullGameState, @@ -101,6 +119,14 @@ class Proto2THUAI6(NoInstance): MessageType.GAME_RUNNING: THUAI6.GameState.GameRunning, MessageType.GAME_END: THUAI6.GameState.GameEnd} + bulletTypeDict: Final[dict] = { + MessageType.NULL_BULLET_TYPE: THUAI6.BulletType.NullBulletType, + MessageType.COMMON_BULLET: THUAI6.BulletType.CommonBullet, + MessageType.FAST_BULLET: THUAI6.BulletType.FastBullet, + MessageType.LINE_BULLET: THUAI6.BulletType.LineBullet, + MessageType.ORDINARY_BULLET: THUAI6.BulletType.OrdinaryBullet, + MessageType.ATOM_BOMB: THUAI6.BulletType.AtomBomb, } + # 用于将Proto的对象转为THUAI6的对象 @staticmethod def Protobuf2THUAI6Tricker(trickerMsg: Message2Clients.MessageOfTricker) -> THUAI6.Tricker: @@ -109,12 +135,14 @@ class Proto2THUAI6(NoInstance): tricker.y = trickerMsg.y tricker.speed = trickerMsg.speed tricker.damage = trickerMsg.damage - tricker.timeUntilSkillAvailable = trickerMsg.time_until_skill_available + for time in trickerMsg.time_until_skill_available: + tricker.timeUntilSkillAvailable.append(time) tricker.place = Proto2THUAI6.placeTypeDict[trickerMsg.place] - tricker.prop = Proto2THUAI6.propTypeDict[trickerMsg.prop] + tricker.playerState = Proto2THUAI6.playerStateDict[trickerMsg.player_state] + for item in trickerMsg.prop: + tricker.prop.append(Proto2THUAI6.propTypeDict[item]) tricker.trickerType = Proto2THUAI6.trickerTypeDict[trickerMsg.tricker_type] tricker.guid = trickerMsg.guid - tricker.movable = trickerMsg.movable tricker.playerID = trickerMsg.player_id tricker.viewRange = trickerMsg.view_range tricker.radius = trickerMsg.radius @@ -130,19 +158,19 @@ class Proto2THUAI6(NoInstance): student.y = studentMsg.y student.speed = studentMsg.speed student.determination = studentMsg.determination - student.failNum = studentMsg.fail_num - student.failTime = studentMsg.fail_time - student.emoTime = studentMsg.emo_time - student.timeUntilSkillAvailable = studentMsg.time_until_skill_available + student.addiction = studentMsg.addiction + for time in studentMsg.time_until_skill_available: + student.timeUntilSkillAvailable.append(time) + student.damage = studentMsg.damage student.place = Proto2THUAI6.placeTypeDict[studentMsg.place] - student.prop = Proto2THUAI6.propTypeDict[studentMsg.prop] + for item in studentMsg.prop: + student.prop.append(Proto2THUAI6.propTypeDict[item]) student.studentType = Proto2THUAI6.studentTypeDict[studentMsg.student_type] student.guid = studentMsg.guid - student.state = Proto2THUAI6.studentStateDict[studentMsg.state] + student.playerState = Proto2THUAI6.playerStateDict[studentMsg.player_state] student.playerID = studentMsg.player_id student.viewRange = studentMsg.view_range student.radius = studentMsg.radius - student.buff.clear() for buff in studentMsg.buff: student.buff.append(Proto2THUAI6.studentBuffTypeDict[buff]) return student @@ -159,6 +187,44 @@ class Proto2THUAI6(NoInstance): prop.isMoving = propMsg.is_moving return prop + @staticmethod + def Protobuf2THUAI6GameInfo(allMsg: Message2Clients.MessageOfAll): + gameInfo = THUAI6.GameInfo() + gameInfo.gameTime = allMsg.game_time + gameInfo.subjectLeft = allMsg.subject_left + gameInfo.studentGraduated = allMsg.student_graduated + gameInfo.studentQuited = allMsg.student_quited + gameInfo.studentScore = allMsg.student_score + gameInfo.trickerScore = allMsg.tricker_score + gameInfo.gateOpened = allMsg.gate_opened + gameInfo.hiddenGateOpened = allMsg.hidden_gate_opened + gameInfo.hiddenGateRefreshed = allMsg.hidden_gate_refreshed + return gameInfo + + @staticmethod + def Protobuf2THUAI6Bullet(bulletMsg: Message2Clients.MessageOfBullet) -> THUAI6.Bullet: + bullet = THUAI6.Bullet() + bullet.x = bulletMsg.x + bullet.y = bulletMsg.y + bullet.bulletType = Proto2THUAI6.bulletTypeDict[bulletMsg.type] + bullet.facingDirection = bulletMsg.facing_direction + bullet.guid = bulletMsg.guid + bullet.team = Proto2THUAI6.playerTypeDict[bulletMsg.team] + bullet.place = Proto2THUAI6.placeTypeDict[bulletMsg.place] + bullet.bombRange = bulletMsg.bomb_range + return bullet + + @staticmethod + def Protobuf2THUAI6BombedBullet(bulletMsg: Message2Clients.MessageOfBombedBullet) -> THUAI6.BombedBullet: + bullet = THUAI6.BombedBullet() + bullet.x = bulletMsg.x + bullet.y = bulletMsg.y + bullet.bulletType = Proto2THUAI6.bulletTypeDict[bulletMsg.type] + bullet.facingDirection = bulletMsg.facing_direction + bullet.mappingID = bulletMsg.mapping_id + bullet.bombRange = bulletMsg.bomb_range + return bullet + @staticmethod def Protobuf2THUAI6Map(mapMsg: Message2Clients.MessageOfMap) -> List[List[THUAI6.PlaceType]]: map = [] @@ -177,18 +243,11 @@ class THUAI62Proto(NoInstance): THUAI6.PlaceType.Land: MessageType.LAND, THUAI6.PlaceType.Grass: MessageType.GRASS, THUAI6.PlaceType.ClassRoom: MessageType.CLASSROOM, - THUAI6.PlaceType.BlackRoom: MessageType.BLACKROOM, THUAI6.PlaceType.Gate: MessageType.GATE, - THUAI6.PlaceType.HiddenGate: MessageType.HIDDEN_GATE} - - shapeTypeDict: Final[dict] = { - THUAI6.ShapeType.NullShapeType: MessageType.NULL_SHAPE_TYPE, - THUAI6.ShapeType.Square: MessageType.SQUARE, - THUAI6.ShapeType.Circle: MessageType.CIRCLE} - - propTypeDict: Final[dict] = { - THUAI6.PropType.NullPropType: MessageType.NULL_PROP_TYPE, - THUAI6.PropType.PropType1: MessageType.PTYPE1, } + THUAI6.PlaceType.HiddenGate: MessageType.HIDDEN_GATE, + THUAI6.PlaceType.Door: MessageType.DOOR, + THUAI6.PlaceType.Chest: MessageType.CHEST, + THUAI6.PlaceType.Window: MessageType.WINDOW, } playerTypeDict: Final[dict] = { THUAI6.PlayerType.NullPlayerType: MessageType.NULL_PLAYER_TYPE, @@ -203,30 +262,12 @@ class THUAI62Proto(NoInstance): THUAI6.TrickerType.NullTrickerType: MessageType.NULL_TRICKER_TYPE, THUAI6.TrickerType.TrickerType1: MessageType.TRICKERTYPE1, } - studentBuffTypeDict: Final[dict] = { - THUAI6.StudentBuffType.NullStudentBuffType: MessageType.NULL_SBUFF_TYPE, - THUAI6.StudentBuffType.StudentBuffType1: MessageType.SBUFFTYPE1, } - - trickerBuffTypeDict: Final[dict] = { - THUAI6.TrickerBuffType.NullTrickerBuffType: MessageType.NULL_TBUFF_TYPE, - THUAI6.TrickerBuffType.TrickerBuffType1: MessageType.TBUFFTYPE1, } - - studentStateDict: Final[dict] = { - THUAI6.StudentState.NullStudentState: MessageType.NULL_STATUS, - THUAI6.StudentState.Idle: MessageType.IDLE, - THUAI6.StudentState.Learning: MessageType.LEARNING, - THUAI6.StudentState.Fail: MessageType.FAIL, - THUAI6.StudentState.Emotional: MessageType.EMOTIONAL, - THUAI6.StudentState.Quit: MessageType.QUIT, - THUAI6.StudentState.Graduated: MessageType.GRADUATED, } - - gameStateDict: Final[dict] = { - THUAI6.GameState.NullGameState: MessageType.NULL_GAME_STATE, - THUAI6.GameState.GameStart: MessageType.GAME_START, - THUAI6.GameState.GameRunning: MessageType.GAME_RUNNING, - THUAI6.GameState.GameEnd: MessageType.GAME_END} + propTypeDict: Final[dict] = { + THUAI6.PropType.NullPropType: MessageType.NULL_PROP_TYPE, + THUAI6.PropType.PropType1: MessageType.PTYPE1, } # 用于将THUAI6的对象转为Proto的对象 + @staticmethod def THUAI62ProtobufPlayer(playerID: int, playerType: THUAI6.PlayerType, studentType: THUAI6.StudentType, trickerType: THUAI6.TrickerType) -> Message2Server.PlayerMsg: return Message2Server.PlayerMsg(player_id=playerID, player_type=THUAI62Proto.playerTypeDict[playerType], student_type=THUAI62Proto.studentTypeDict[studentType], tricker_type=THUAI62Proto.trickerTypeDict[trickerType]) @@ -240,13 +281,13 @@ class THUAI62Proto(NoInstance): return Message2Server.MoveMsg(player_id=id, angle=angle, time_in_milliseconds=time) @staticmethod - def THUAI62ProtobufPick(prop: THUAI6.PropType, id: int) -> Message2Server.PickMsg: - return Message2Server.PickMsg(player_id=id, prop_type=THUAI62Proto.propTypeDict[prop]) + def THUAI62ProtobufPick(prop: THUAI6.PropType, id: int) -> Message2Server.PropMsg: + return Message2Server.PropMsg(player_id=id, prop_type=THUAI62Proto.propTypeDict[prop]) @staticmethod def THUAI62ProtobufSend(msg: str, toID: int, id: int) -> Message2Server.SendMsg: return Message2Server.SendMsg(player_id=id, to_player_id=toID, message=msg) @staticmethod - def THUAI62ProtobufTrick(angle: float, id: int) -> Message2Server.TrickMsg: - return Message2Server.TrickMsg(player_id=id, angle=angle) + def THUAI62ProtobufTrick(angle: float, id: int) -> Message2Server.AttackMsg: + return Message2Server.AttackMsg(player_id=id, angle=angle) diff --git a/dependency/proto/Message2Clients.proto b/dependency/proto/Message2Clients.proto index 51e581b..7ccc4f6 100755 --- a/dependency/proto/Message2Clients.proto +++ b/dependency/proto/Message2Clients.proto @@ -122,8 +122,7 @@ message MessageOfDoor int32 x = 1; int32 y = 2; bool is_open = 3; - int32 number = 4; - int32 progress = 5; + int32 progress = 4; } message MessageOfChest