diff --git a/CAPI/cpp/API/include/structures.h b/CAPI/cpp/API/include/structures.h index 4831b94..ca01de0 100644 --- a/CAPI/cpp/API/include/structures.h +++ b/CAPI/cpp/API/include/structures.h @@ -197,7 +197,7 @@ namespace THUAI6 PlayerType playerType; // 玩家类型 std::vector props; - PlaceType place; // 所处格子的类型 + // PlaceType place; // 所处格子的类型 BulletType bulletType; PlayerState playerState; @@ -232,9 +232,9 @@ namespace THUAI6 double facingDirection; // 朝向 int64_t guid; // 全局唯一ID PlayerType team; // 子弹所属队伍 - PlaceType place; // 所处格子的类型 - double bombRange; // 炸弹爆炸范围 - int32_t speed; // 子弹速度 + // PlaceType place; // 所处格子的类型 + double bombRange; // 炸弹爆炸范围 + int32_t speed; // 子弹速度 }; struct BombedBullet @@ -253,7 +253,7 @@ namespace THUAI6 int32_t y; int64_t guid; PropType type; - PlaceType place; + // PlaceType place; double facingDirection; // 朝向 }; diff --git a/CAPI/cpp/API/include/utils.hpp b/CAPI/cpp/API/include/utils.hpp index 07e52c5..2575ae2 100644 --- a/CAPI/cpp/API/include/utils.hpp +++ b/CAPI/cpp/API/include/utils.hpp @@ -227,7 +227,7 @@ namespace Proto2THUAI6 tricker->timeUntilSkillAvailable.clear(); 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()]; + // tricker->place = placeTypeDict[trickerMsg.place()]; tricker->playerState = playerStateDict[trickerMsg.player_state()]; tricker->props.clear(); for (int i = 0; i < trickerMsg.prop().size(); i++) @@ -269,7 +269,7 @@ namespace Proto2THUAI6 student->props.clear(); for (int i = 0; i < studentMsg.prop().size(); i++) student->props.push_back(propTypeDict[studentMsg.prop(i)]); - student->place = placeTypeDict[studentMsg.place()]; + // student->place = placeTypeDict[studentMsg.place()]; student->playerState = playerStateDict[studentMsg.player_state()]; student->determination = studentMsg.determination(); student->addiction = studentMsg.addiction(); @@ -286,7 +286,7 @@ namespace Proto2THUAI6 prop->x = propMsg.x(); prop->y = propMsg.y(); prop->type = propTypeDict[propMsg.type()]; - prop->place = placeTypeDict[propMsg.place()]; + // prop->place = placeTypeDict[propMsg.place()]; prop->guid = propMsg.guid(); prop->facingDirection = propMsg.facing_direction(); return prop; @@ -313,7 +313,7 @@ namespace Proto2THUAI6 bullet->facingDirection = bulletMsg.facing_direction(); bullet->guid = bulletMsg.guid(); bullet->team = playerTypeDict[bulletMsg.team()]; - bullet->place = placeTypeDict[bulletMsg.place()]; + // bullet->place = placeTypeDict[bulletMsg.place()]; bullet->bombRange = bulletMsg.bomb_range(); bullet->speed = bulletMsg.speed(); return bullet; diff --git a/CAPI/cpp/API/src/DebugAPI.cpp b/CAPI/cpp/API/src/DebugAPI.cpp index b56cd4c..f892cfa 100644 --- a/CAPI/cpp/API/src/DebugAPI.cpp +++ b/CAPI/cpp/API/src/DebugAPI.cpp @@ -684,7 +684,7 @@ void StudentDebugAPI::PrintStudent() const { logger->info("******Student Info******"); logger->info("playerID={}, GUID={}, x={}, y={}", student->playerID, student->guid, student->x, student->y); - logger->info("speed={}, view range={}, place={}, radius={}", student->speed, student->viewRange, THUAI6::placeTypeDict[student->place], student->radius); + logger->info("speed={}, view range={}, radius={}", student->speed, student->viewRange, student->radius); std::string skillTime = ""; for (const auto& time : student->timeUntilSkillAvailable) skillTime += std::to_string(time) + ", "; @@ -709,7 +709,7 @@ void TrickerDebugAPI::PrintStudent() const { logger->info("******Student Info******"); logger->info("playerID={}, GUID={}, x={}, y={}", student->playerID, student->guid, student->x, student->y); - logger->info("speed={}, view range={}, place={}, radius={}", student->speed, student->viewRange, THUAI6::placeTypeDict[student->place], student->radius); + logger->info("speed={}, view range={}, radius={}", student->speed, student->viewRange, student->radius); std::string skillTime = ""; for (const auto& time : student->timeUntilSkillAvailable) skillTime += std::to_string(time) + ", "; @@ -734,7 +734,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={}, radius={}", tricker->speed, tricker->viewRange, THUAI6::placeTypeDict[tricker->place], tricker->radius); + logger->info("speed={}, view range={}, radius={}", tricker->speed, tricker->viewRange, tricker->radius); std::string skillTime = ""; for (const auto& time : tricker->timeUntilSkillAvailable) skillTime += std::to_string(time) + ", "; @@ -758,7 +758,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={}, radius={}", tricker->speed, tricker->viewRange, THUAI6::placeTypeDict[tricker->place], tricker->radius); + logger->info("speed={}, view range={}, radius={}", tricker->speed, tricker->viewRange, tricker->radius); std::string skillTime = ""; for (const auto& time : tricker->timeUntilSkillAvailable) skillTime += std::to_string(time) + ", "; @@ -781,7 +781,7 @@ void StudentDebugAPI::PrintProp() const for (auto prop : logic.GetProps()) { logger->info("******Prop Info******"); - logger->info("GUID={}, x={}, y={}, place={}, facing direction={}", prop->guid, prop->x, prop->y, THUAI6::placeTypeDict[prop->place], prop->facingDirection); + logger->info("GUID={}, x={}, y={}, facing direction={}", prop->guid, prop->x, prop->y, prop->facingDirection); logger->info("*********************\n"); } } @@ -791,7 +791,7 @@ void TrickerDebugAPI::PrintProp() const for (auto prop : logic.GetProps()) { logger->info("******Prop Info******"); - logger->info("GUID={}, x={}, y={}, place={}, facing direction={}", prop->guid, prop->x, prop->y, THUAI6::placeTypeDict[prop->place], prop->facingDirection); + logger->info("GUID={}, x={}, y={}, facing direction={}", prop->guid, prop->x, prop->y, prop->facingDirection); logger->info("*********************\n"); } } @@ -801,7 +801,7 @@ void StudentDebugAPI::PrintSelfInfo() const auto student = logic.StudentGetSelfInfo(); logger->info("******Self Info******"); logger->info("playerID={}, GUID={}, x={}, y={}", student->playerID, student->guid, student->x, student->y); - logger->info("speed={}, view range={}, place={}, radius={}", student->speed, student->viewRange, THUAI6::placeTypeDict[student->place], student->radius); + logger->info("speed={}, view range={}, radius={}", student->speed, student->viewRange, student->radius); std::string skillTime = ""; for (const auto& time : student->timeUntilSkillAvailable) skillTime += std::to_string(time) + ", "; @@ -824,7 +824,7 @@ void TrickerDebugAPI::PrintSelfInfo() const auto tricker = logic.TrickerGetSelfInfo(); logger->info("******Self Info******"); logger->info("playerID={}, GUID={}, x={}, y={}", tricker->playerID, tricker->guid, tricker->x, tricker->y); - logger->info("speed={}, view range={}, place={}, radius={}", tricker->speed, tricker->viewRange, THUAI6::placeTypeDict[tricker->place], tricker->radius); + logger->info("speed={}, view range={}, radius={}", tricker->speed, tricker->viewRange, tricker->radius); std::string skillTime = ""; for (const auto& time : tricker->timeUntilSkillAvailable) skillTime += std::to_string(time) + ", "; diff --git a/CAPI/cpp/API/src/logic.cpp b/CAPI/cpp/API/src/logic.cpp index 2b7cb91..f5f62b9 100644 --- a/CAPI/cpp/API/src/logic.cpp +++ b/CAPI/cpp/API/src/logic.cpp @@ -589,7 +589,7 @@ void Logic::LoadBufferCase(const protobuf::MessageOfObj& item) else if (Proto2THUAI6::newsTypeDict[news.news_case()] == THUAI6::NewsType::BinaryMessage) { messageQueue.emplace(std::make_pair(news.to_id(), news.binary_message())); - logger->debug("Add News!"); + logger->debug("Add Binary News!"); } else logger->error("Unknown NewsType!"); @@ -712,7 +712,7 @@ bool Logic::HaveView(int gridX, int gridY, int selfX, int selfY, int viewRange) void Logic::Main(CreateAIFunc createAI, std::string IP, std::string port, bool file, bool print, bool warnOnly) { // 建立日志组件 - auto fileLogger = std::make_shared("logs/logic-log.txt", true); + auto fileLogger = std::make_shared(fmt::format("logs/logic-{}-log.txt", playerID), true); auto printLogger = std::make_shared(); std::string pattern = "[logic] [%H:%M:%S.%e] [%l] %v"; fileLogger->set_pattern(pattern); diff --git a/CAPI/cpp/proto/Message2Clients.pb.cc b/CAPI/cpp/proto/Message2Clients.pb.cc index 147fd09..4818850 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_.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_)*/ {}} + /*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_.player_state_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{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_)*/ {}} { } 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_.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_)*/ {}} + /*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_.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_)*/ {}} { } struct MessageOfTrickerDefaultTypeInternal @@ -70,7 +70,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_.team_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.bomb_range_)*/ 0, /*decltype(_impl_.place_)*/ 0, /*decltype(_impl_.speed_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} + /*decltype(_impl_.type_)*/ 0, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_.team_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.bomb_range_)*/ 0, /*decltype(_impl_.speed_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } struct MessageOfBulletDefaultTypeInternal @@ -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_._cached_size_)*/ {}} + /*decltype(_impl_.type_)*/ 0, /*decltype(_impl_.x_)*/ 0, /*decltype(_impl_.facing_direction_)*/ 0, /*decltype(_impl_.guid_)*/ int64_t{0}, /*decltype(_impl_.y_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}} { } struct MessageOfPropDefaultTypeInternal @@ -458,7 +458,6 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.determination_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.addiction_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.time_until_skill_available_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.place_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.prop_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.player_state_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfStudent, _impl_.guid_), @@ -485,7 +484,6 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.y_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.speed_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.time_until_skill_available_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.place_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.prop_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.tricker_type_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfTricker, _impl_.guid_), @@ -511,7 +509,6 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.facing_direction_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.guid_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.team_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.place_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.bomb_range_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.speed_), ~0u, // no _has_bits_ @@ -537,7 +534,6 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfProp, _impl_.y_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfProp, _impl_.facing_direction_), PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfProp, _impl_.guid_), - PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfProp, _impl_.place_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfPickedProp, _internal_metadata_), ~0u, // no _extensions_ @@ -679,24 +675,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)}, - {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)}, - {174, -1, -1, sizeof(::protobuf::MessageOfObj)}, - {193, -1, -1, sizeof(::protobuf::MessageOfAll)}, - {205, -1, -1, sizeof(::protobuf::MessageToClient)}, - {214, -1, -1, sizeof(::protobuf::MoveRes)}, - {223, -1, -1, sizeof(::protobuf::BoolRes)}, + {28, -1, -1, sizeof(::protobuf::MessageOfTricker)}, + {51, -1, -1, sizeof(::protobuf::MessageOfBullet)}, + {65, -1, -1, sizeof(::protobuf::MessageOfBombedBullet)}, + {77, -1, -1, sizeof(::protobuf::MessageOfProp)}, + {88, -1, -1, sizeof(::protobuf::MessageOfPickedProp)}, + {99, -1, -1, sizeof(::protobuf::MessageOfClassroom)}, + {108, -1, -1, sizeof(::protobuf::MessageOfGate)}, + {117, -1, -1, sizeof(::protobuf::MessageOfHiddenGate)}, + {126, -1, -1, sizeof(::protobuf::MessageOfDoor)}, + {136, -1, -1, sizeof(::protobuf::MessageOfChest)}, + {145, -1, -1, sizeof(::protobuf::MessageOfMap_Row)}, + {152, -1, -1, sizeof(::protobuf::MessageOfMap)}, + {159, -1, -1, sizeof(::protobuf::MessageOfNews)}, + {170, -1, -1, sizeof(::protobuf::MessageOfObj)}, + {189, -1, -1, sizeof(::protobuf::MessageOfAll)}, + {201, -1, -1, sizeof(::protobuf::MessageToClient)}, + {210, -1, -1, sizeof(::protobuf::MoveRes)}, + {219, -1, -1, sizeof(::protobuf::BoolRes)}, }; static const ::_pb::Message* const file_default_instances[] = { @@ -723,91 +719,87 @@ 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\"\333\004\n\020MessageOfStudent\022\t\n\001x\030\001" + "geType.proto\"\267\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" - "\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\"i\n\rMessageOfNews\022\026\n\014text_mess" - "age\030\001 \001(\tH\000\022\030\n\016binary_message\030\004 \001(\014H\000\022\017\n" - "\007from_id\030\002 \001(\003\022\r\n\005to_id\030\003 \001(\003B\006\n\004news\"\244\005" - "\n\014MessageOfObj\0225\n\017student_message\030\001 \001(\0132" - "\032.protobuf.MessageOfStudentH\000\0225\n\017tricker" - "_message\030\002 \001(\0132\032.protobuf.MessageOfTrick" - "erH\000\022/\n\014prop_message\030\003 \001(\0132\027.protobuf.Me" - "ssageOfPropH\000\0223\n\016bullet_message\030\004 \001(\0132\031." - "protobuf.MessageOfBulletH\000\022@\n\025bombed_bul" - "let_message\030\005 \001(\0132\037.protobuf.MessageOfBo" - "mbedBulletH\000\0229\n\021classroom_message\030\006 \001(\0132" - "\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.Messag" - "eOfGateH\000\0221\n\rchest_message\030\t \001(\0132\030.proto" - "buf.MessageOfChestH\000\022<\n\023hidden_gate_mess" - "age\030\n \001(\0132\035.protobuf.MessageOfHiddenGate" - "H\000\022/\n\014news_message\030\013 \001(\0132\027.protobuf.Mess" - "ageOfNewsH\000\022-\n\013map_message\030\014 \001(\0132\026.proto" - "buf.MessageOfMapH\000B\020\n\016message_of_obj\"\234\001\n" - "\014MessageOfAll\022\021\n\tgame_time\030\001 \001(\005\022\030\n\020subj" - "ect_finished\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\"\224\001\n\017" - "MessageToClient\022+\n\013obj_message\030\001 \003(\0132\026.p" - "rotobuf.MessageOfObj\022\'\n\ngame_state\030\002 \001(\016" - "2\023.protobuf.GameState\022+\n\013all_message\030\003 \001" - "(\0132\026.protobuf.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"; + "_until_skill_available\030\006 \003(\001\022 \n\004prop\030\010 \003" + "(\0162\022.protobuf.PropType\022+\n\014player_state\030\t" + " \001(\0162\025.protobuf.PlayerState\022\014\n\004guid\030\n \001(" + "\003\022)\n\013bullet_type\030\014 \001(\0162\024.protobuf.Bullet" + "Type\022\026\n\016learning_speed\030\r \001(\005\022\023\n\013treat_sp" + "eed\030\016 \001(\005\022\021\n\tplayer_id\030\017 \001(\003\022\022\n\nview_ran" + "ge\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\014studen" + "t_type\030\027 \001(\0162\025.protobuf.StudentType\022\030\n\020f" + "acing_direction\030\030 \001(\001\022\'\n\004buff\030\031 \003(\0162\031.pr" + "otobuf.StudentBuffType\"\305\003\n\020MessageOfTric" + "ker\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\032time_until_skill_available\030\005 \003(\001\022 \n\004" + "prop\030\007 \003(\0162\022.protobuf.PropType\022+\n\014tricke" + "r_type\030\010 \001(\0162\025.protobuf.TrickerType\022\014\n\004g" + "uid\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.PlayerS" + "tate\022\024\n\014trick_desire\030\017 \001(\001\022\024\n\014class_volu" + "me\030\020 \001(\001\022\030\n\020facing_direction\030\021 \001(\001\022)\n\013bu" + "llet_type\030\022 \001(\0162\024.protobuf.BulletType\022\'\n" + "\004buff\030\023 \003(\0162\031.protobuf.TrickerBuffType\"\272" + "\001\n\017MessageOfBullet\022\"\n\004type\030\001 \001(\0162\024.proto" + "buf.BulletType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020" + "facing_direction\030\004 \001(\001\022\014\n\004guid\030\005 \001(\003\022\"\n\004" + "team\030\006 \001(\0162\024.protobuf.PlayerType\022\022\n\nbomb" + "_range\030\010 \001(\001\022\r\n\005speed\030\t \001(\005\"\223\001\n\025MessageO" + "fBombedBullet\022\"\n\004type\030\001 \001(\0162\024.protobuf.B" + "ulletType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020facin" + "g_direction\030\004 \001(\001\022\022\n\nmapping_id\030\005 \001(\003\022\022\n" + "\nbomb_range\030\006 \001(\001\"o\n\rMessageOfProp\022 \n\004ty" + "pe\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\004" + "guid\030\005 \001(\003\"{\n\023MessageOfPickedProp\022 \n\004typ" + "e\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\nm" + "apping_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\010" + "progress\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\rM" + "essageOfDoor\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\010progress\030\004 \001(\005\"8\n\016Message" + "OfChest\022\t\n\001x\030\001 \001(\005\022\t\n\001y\030\002 \001(\005\022\020\n\010progres" + "s\030\003 \001(\005\"`\n\014MessageOfMap\022\'\n\003row\030\002 \003(\0132\032.p" + "rotobuf.MessageOfMap.Row\032\'\n\003Row\022 \n\003col\030\001" + " \003(\0162\023.protobuf.PlaceType\"i\n\rMessageOfNe" + "ws\022\026\n\014text_message\030\001 \001(\tH\000\022\030\n\016binary_mes" + "sage\030\004 \001(\014H\000\022\017\n\007from_id\030\002 \001(\003\022\r\n\005to_id\030\003" + " \001(\003B\006\n\004news\"\244\005\n\014MessageOfObj\0225\n\017student" + "_message\030\001 \001(\0132\032.protobuf.MessageOfStude" + "ntH\000\0225\n\017tricker_message\030\002 \001(\0132\032.protobuf" + ".MessageOfTrickerH\000\022/\n\014prop_message\030\003 \001(" + "\0132\027.protobuf.MessageOfPropH\000\0223\n\016bullet_m" + "essage\030\004 \001(\0132\031.protobuf.MessageOfBulletH" + "\000\022@\n\025bombed_bullet_message\030\005 \001(\0132\037.proto" + "buf.MessageOfBombedBulletH\000\0229\n\021classroom" + "_message\030\006 \001(\0132\034.protobuf.MessageOfClass" + "roomH\000\022/\n\014door_message\030\007 \001(\0132\027.protobuf." + "MessageOfDoorH\000\022/\n\014gate_message\030\010 \001(\0132\027." + "protobuf.MessageOfGateH\000\0221\n\rchest_messag" + "e\030\t \001(\0132\030.protobuf.MessageOfChestH\000\022<\n\023h" + "idden_gate_message\030\n \001(\0132\035.protobuf.Mess" + "ageOfHiddenGateH\000\022/\n\014news_message\030\013 \001(\0132" + "\027.protobuf.MessageOfNewsH\000\022-\n\013map_messag" + "e\030\014 \001(\0132\026.protobuf.MessageOfMapH\000B\020\n\016mes" + "sage_of_obj\"\234\001\n\014MessageOfAll\022\021\n\tgame_tim" + "e\030\001 \001(\005\022\030\n\020subject_finished\030\002 \001(\005\022\031\n\021stu" + "dent_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_s" + "core\030\006 \001(\005\"\224\001\n\017MessageToClient\022+\n\013obj_me" + "ssage\030\001 \003(\0132\026.protobuf.MessageOfObj\022\'\n\ng" + "ame_state\030\002 \001(\0162\023.protobuf.GameState\022+\n\013" + "all_message\030\003 \001(\0132\026.protobuf.MessageOfAl" + "l\"J\n\007MoveRes\022\024\n\014actual_speed\030\001 \001(\003\022\024\n\014ac" + "tual_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, }; @@ -815,7 +807,7 @@ static ::_pbi::once_flag descriptor_table_Message2Clients_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_Message2Clients_2eproto = { false, false, - 3422, + 3277, descriptor_table_protodef_Message2Clients_2eproto, "Message2Clients.proto", &descriptor_table_Message2Clients_2eproto_once, @@ -858,10 +850,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_.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_)*/ {}}; + 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_.player_state_){}, decltype(_impl_.guid_){}, 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_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.facing_direction_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.facing_direction_)); + ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.student_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.student_type_)); // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfStudent) } @@ -872,7 +864,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_.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_)*/ {}}; + 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_.player_state_){0}, decltype(_impl_.guid_){int64_t{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_)*/ {}}; } MessageOfStudent::~MessageOfStudent() @@ -909,7 +901,7 @@ namespace protobuf _impl_.time_until_skill_available_.Clear(); _impl_.prop_.Clear(); _impl_.buff_.Clear(); - ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.facing_direction_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.facing_direction_)); + ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.student_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.student_type_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -989,17 +981,6 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.PlaceType place = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) - { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_place(static_cast<::protobuf::PlaceType>(val)); - } - else - goto handle_unusual; - continue; // repeated .protobuf.PropType prop = 8; case 8: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) @@ -1250,15 +1231,6 @@ namespace protobuf target = stream->WriteFixedPacked(6, _internal_time_until_skill_available(), target); } - // .protobuf.PlaceType place = 7; - if (this->_internal_place() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 7, this->_internal_place(), target - ); - } - // repeated .protobuf.PropType prop = 8; { int byte_size = _impl_._prop_cached_byte_size_.load(std::memory_order_relaxed); @@ -1494,11 +1466,11 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_addiction()); } - // .protobuf.PlaceType place = 7; - if (this->_internal_place() != 0) + // .protobuf.PlayerState player_state = 9; + if (this->_internal_player_state() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_place()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_player_state()); } // int64 guid = 10; @@ -1507,13 +1479,6 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_guid()); } - // .protobuf.PlayerState player_state = 9; - if (this->_internal_player_state() != 0) - { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_player_state()); - } - // .protobuf.BulletType bullet_type = 12; if (this->_internal_bullet_type() != 0) { @@ -1527,18 +1492,18 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_learning_speed()); } - // 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 treat_speed = 14; + if (this->_internal_treat_speed() != 0) + { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_treat_speed()); + } + // int32 view_range = 16; if (this->_internal_view_range() != 0) { @@ -1557,6 +1522,15 @@ 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(); @@ -1567,15 +1541,6 @@ 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) { @@ -1594,13 +1559,6 @@ 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(); @@ -1611,6 +1569,13 @@ 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_); } @@ -1654,18 +1619,14 @@ namespace protobuf { _this->_internal_set_addiction(from._internal_addiction()); } - if (from._internal_place() != 0) + if (from._internal_player_state() != 0) { - _this->_internal_set_place(from._internal_place()); + _this->_internal_set_player_state(from._internal_player_state()); } if (from._internal_guid() != 0) { _this->_internal_set_guid(from._internal_guid()); } - 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()); @@ -1674,14 +1635,14 @@ namespace protobuf { _this->_internal_set_learning_speed(from._internal_learning_speed()); } - 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_treat_speed() != 0) + { + _this->_internal_set_treat_speed(from._internal_treat_speed()); + } if (from._internal_view_range() != 0) { _this->_internal_set_view_range(from._internal_view_range()); @@ -1690,6 +1651,10 @@ 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; @@ -1698,10 +1663,6 @@ 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()); @@ -1710,10 +1671,6 @@ 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; @@ -1722,6 +1679,10 @@ 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_); } @@ -1747,7 +1708,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_.facing_direction_) + sizeof(MessageOfStudent::_impl_.facing_direction_) - PROTOBUF_FIELD_OFFSET(MessageOfStudent, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfStudent, _impl_.student_type_) + sizeof(MessageOfStudent::_impl_.student_type_) - PROTOBUF_FIELD_OFFSET(MessageOfStudent, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); @@ -1779,10 +1740,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_.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_)*/ {}}; + 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_.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_)*/ {}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.facing_direction_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.facing_direction_)); + ::memcpy(&_impl_.x_, &from._impl_.x_, static_cast(reinterpret_cast(&_impl_.bullet_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.bullet_type_)); // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfTricker) } @@ -1793,7 +1754,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_.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_)*/ {}}; + 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_.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_)*/ {}}; } MessageOfTricker::~MessageOfTricker() @@ -1830,7 +1791,7 @@ namespace protobuf _impl_.time_until_skill_available_.Clear(); _impl_.prop_.Clear(); _impl_.buff_.Clear(); - ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.facing_direction_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.facing_direction_)); + ::memset(&_impl_.x_, 0, static_cast(reinterpret_cast(&_impl_.bullet_type_) - reinterpret_cast(&_impl_.x_)) + sizeof(_impl_.bullet_type_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -1890,17 +1851,6 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.PlaceType place = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) - { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_place(static_cast<::protobuf::PlaceType>(val)); - } - else - goto handle_unusual; - continue; // repeated .protobuf.PropType prop = 7; case 7: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) @@ -2107,15 +2057,6 @@ namespace protobuf target = stream->WriteFixedPacked(5, _internal_time_until_skill_available(), target); } - // .protobuf.PlaceType place = 6; - if (this->_internal_place() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 6, this->_internal_place(), target - ); - } - // repeated .protobuf.PropType prop = 7; { int byte_size = _impl_._prop_cached_byte_size_.load(std::memory_order_relaxed); @@ -2322,11 +2263,11 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_speed()); } - // .protobuf.PlaceType place = 6; - if (this->_internal_place() != 0) + // .protobuf.TrickerType tricker_type = 8; + if (this->_internal_tricker_type() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_place()); + ::_pbi::WireFormatLite::EnumSize(this->_internal_tricker_type()); } // int64 guid = 9; @@ -2335,11 +2276,10 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_guid()); } - // .protobuf.TrickerType tricker_type = 8; - if (this->_internal_tricker_type() != 0) + // int64 player_id = 11; + if (this->_internal_player_id() != 0) { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_tricker_type()); + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_player_id()); } // int32 score = 10; @@ -2348,12 +2288,6 @@ namespace protobuf total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_score()); } - // int64 player_id = 11; - if (this->_internal_player_id() != 0) - { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_player_id()); - } - // int32 view_range = 12; if (this->_internal_view_range() != 0) { @@ -2366,6 +2300,13 @@ 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(); @@ -2386,20 +2327,6 @@ namespace protobuf total_size += 2 + 8; } - // .protobuf.PlayerState player_state = 14; - if (this->_internal_player_state() != 0) - { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_player_state()); - } - - // .protobuf.BulletType bullet_type = 18; - if (this->_internal_bullet_type() != 0) - { - total_size += 2 + - ::_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(); @@ -2410,6 +2337,13 @@ namespace protobuf total_size += 2 + 8; } + // .protobuf.BulletType bullet_type = 18; + if (this->_internal_bullet_type() != 0) + { + total_size += 2 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_bullet_type()); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -2445,26 +2379,22 @@ namespace protobuf { _this->_internal_set_speed(from._internal_speed()); } - if (from._internal_place() != 0) + if (from._internal_tricker_type() != 0) { - _this->_internal_set_place(from._internal_place()); + _this->_internal_set_tricker_type(from._internal_tricker_type()); } if (from._internal_guid() != 0) { _this->_internal_set_guid(from._internal_guid()); } - if (from._internal_tricker_type() != 0) + if (from._internal_player_id() != 0) { - _this->_internal_set_tricker_type(from._internal_tricker_type()); + _this->_internal_set_player_id(from._internal_player_id()); } 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()); @@ -2473,6 +2403,10 @@ 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; @@ -2489,14 +2423,6 @@ 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; @@ -2505,6 +2431,10 @@ 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_); } @@ -2530,7 +2460,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_.facing_direction_) + sizeof(MessageOfTricker::_impl_.facing_direction_) - PROTOBUF_FIELD_OFFSET(MessageOfTricker, _impl_.x_)>( + PROTOBUF_FIELD_OFFSET(MessageOfTricker, _impl_.bullet_type_) + sizeof(MessageOfTricker::_impl_.bullet_type_) - PROTOBUF_FIELD_OFFSET(MessageOfTricker, _impl_.x_)>( reinterpret_cast(&_impl_.x_), reinterpret_cast(&other->_impl_.x_) ); @@ -2562,7 +2492,7 @@ namespace protobuf MessageOfBullet* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.type_){}, decltype(_impl_.x_){}, decltype(_impl_.facing_direction_){}, decltype(_impl_.y_){}, decltype(_impl_.team_){}, decltype(_impl_.guid_){}, decltype(_impl_.bomb_range_){}, decltype(_impl_.place_){}, decltype(_impl_.speed_){}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.type_){}, decltype(_impl_.x_){}, decltype(_impl_.facing_direction_){}, decltype(_impl_.y_){}, decltype(_impl_.team_){}, decltype(_impl_.guid_){}, decltype(_impl_.bomb_range_){}, decltype(_impl_.speed_){}, /*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_.speed_) - reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.speed_)); @@ -2576,7 +2506,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_.team_){0}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.bomb_range_){0}, decltype(_impl_.place_){0}, decltype(_impl_.speed_){0}, /*decltype(_impl_._cached_size_)*/ {}}; + decltype(_impl_.type_){0}, decltype(_impl_.x_){0}, decltype(_impl_.facing_direction_){0}, decltype(_impl_.y_){0}, decltype(_impl_.team_){0}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.bomb_range_){0}, decltype(_impl_.speed_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } MessageOfBullet::~MessageOfBullet() @@ -2684,17 +2614,6 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.PlaceType place = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) - { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_place(static_cast<::protobuf::PlaceType>(val)); - } - else - goto handle_unusual; - continue; // double bomb_range = 8; case 8: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 65)) @@ -2799,15 +2718,6 @@ namespace protobuf ); } - // .protobuf.PlaceType place = 7; - if (this->_internal_place() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 7, this->_internal_place(), target - ); - } - // double bomb_range = 8; static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_bomb_range = this->_internal_bomb_range(); @@ -2897,13 +2807,6 @@ namespace protobuf total_size += 1 + 8; } - // .protobuf.PlaceType place = 7; - if (this->_internal_place() != 0) - { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_place()); - } - // int32 speed = 9; if (this->_internal_speed() != 0) { @@ -2966,10 +2869,6 @@ namespace protobuf { _this->_internal_set_bomb_range(from._internal_bomb_range()); } - if (from._internal_place() != 0) - { - _this->_internal_set_place(from._internal_place()); - } if (from._internal_speed() != 0) { _this->_internal_set_speed(from._internal_speed()); @@ -3405,10 +3304,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_._cached_size_)*/ {}}; + decltype(_impl_.type_){}, decltype(_impl_.x_){}, decltype(_impl_.facing_direction_){}, decltype(_impl_.guid_){}, decltype(_impl_.y_){}, /*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_.guid_) - reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.guid_)); + ::memcpy(&_impl_.type_, &from._impl_.type_, static_cast(reinterpret_cast(&_impl_.y_) - reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.y_)); // @@protoc_insertion_point(copy_constructor:protobuf.MessageOfProp) } @@ -3419,7 +3318,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_._cached_size_)*/ {}}; + decltype(_impl_.type_){0}, decltype(_impl_.x_){0}, decltype(_impl_.facing_direction_){0}, decltype(_impl_.guid_){int64_t{0}}, decltype(_impl_.y_){0}, /*decltype(_impl_._cached_size_)*/ {}}; } MessageOfProp::~MessageOfProp() @@ -3450,7 +3349,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_.guid_) - reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.guid_)); + ::memset(&_impl_.type_, 0, static_cast(reinterpret_cast(&_impl_.y_) - reinterpret_cast(&_impl_.type_)) + sizeof(_impl_.y_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -3516,17 +3415,6 @@ namespace protobuf else goto handle_unusual; continue; - // .protobuf.PlaceType place = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) - { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_place(static_cast<::protobuf::PlaceType>(val)); - } - else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -3602,15 +3490,6 @@ namespace protobuf target = ::_pbi::WireFormatLite::WriteInt64ToArray(5, this->_internal_guid(), target); } - // .protobuf.PlaceType place = 6; - if (this->_internal_place() != 0) - { - target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( - 6, this->_internal_place(), target - ); - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -3653,25 +3532,18 @@ namespace protobuf total_size += 1 + 8; } - // int32 y = 3; - if (this->_internal_y() != 0) - { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_y()); - } - - // .protobuf.PlaceType place = 6; - if (this->_internal_place() != 0) - { - total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_place()); - } - // int64 guid = 5; if (this->_internal_guid() != 0) { total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_guid()); } + // int32 y = 3; + if (this->_internal_y() != 0) + { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_y()); + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } @@ -3708,18 +3580,14 @@ namespace protobuf { _this->_internal_set_facing_direction(from._internal_facing_direction()); } - if (from._internal_y() != 0) - { - _this->_internal_set_y(from._internal_y()); - } - if (from._internal_place() != 0) - { - _this->_internal_set_place(from._internal_place()); - } if (from._internal_guid() != 0) { _this->_internal_set_guid(from._internal_guid()); } + if (from._internal_y() != 0) + { + _this->_internal_set_y(from._internal_y()); + } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } @@ -3742,7 +3610,7 @@ namespace protobuf using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MessageOfProp, _impl_.guid_) + sizeof(MessageOfProp::_impl_.guid_) - PROTOBUF_FIELD_OFFSET(MessageOfProp, _impl_.type_)>( + PROTOBUF_FIELD_OFFSET(MessageOfProp, _impl_.y_) + sizeof(MessageOfProp::_impl_.y_) - PROTOBUF_FIELD_OFFSET(MessageOfProp, _impl_.type_)>( reinterpret_cast(&_impl_.type_), reinterpret_cast(&other->_impl_.type_) ); diff --git a/CAPI/cpp/proto/Message2Clients.pb.h b/CAPI/cpp/proto/Message2Clients.pb.h index 8bbb6e2..ff0dd2d 100644 --- a/CAPI/cpp/proto/Message2Clients.pb.h +++ b/CAPI/cpp/proto/Message2Clients.pb.h @@ -318,21 +318,20 @@ namespace protobuf kSpeedFieldNumber = 3, kDeterminationFieldNumber = 4, kAddictionFieldNumber = 5, - kPlaceFieldNumber = 7, - kGuidFieldNumber = 10, kPlayerStateFieldNumber = 9, + kGuidFieldNumber = 10, kBulletTypeFieldNumber = 12, kLearningSpeedFieldNumber = 13, - kTreatSpeedFieldNumber = 14, kPlayerIdFieldNumber = 15, + kTreatSpeedFieldNumber = 14, kViewRangeFieldNumber = 16, kRadiusFieldNumber = 17, - kDangerAlertFieldNumber = 19, kScoreFieldNumber = 20, + kDangerAlertFieldNumber = 19, kTreatProgressFieldNumber = 21, kRescueProgressFieldNumber = 22, - kStudentTypeFieldNumber = 23, kFacingDirectionFieldNumber = 24, + kStudentTypeFieldNumber = 23, }; // repeated double time_until_skill_available = 6; int time_until_skill_available_size() const; @@ -452,14 +451,14 @@ namespace protobuf void _internal_set_addiction(int32_t value); public: - // .protobuf.PlaceType place = 7; - void clear_place(); - ::protobuf::PlaceType place() const; - void set_place(::protobuf::PlaceType value); + // .protobuf.PlayerState player_state = 9; + void clear_player_state(); + ::protobuf::PlayerState player_state() const; + void set_player_state(::protobuf::PlayerState value); private: - ::protobuf::PlaceType _internal_place() const; - void _internal_set_place(::protobuf::PlaceType value); + ::protobuf::PlayerState _internal_player_state() const; + void _internal_set_player_state(::protobuf::PlayerState value); public: // int64 guid = 10; @@ -471,16 +470,6 @@ namespace protobuf int64_t _internal_guid() const; void _internal_set_guid(int64_t value); - public: - // .protobuf.PlayerState player_state = 9; - 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: // .protobuf.BulletType bullet_type = 12; void clear_bullet_type(); @@ -501,16 +490,6 @@ namespace protobuf int32_t _internal_learning_speed() const; void _internal_set_learning_speed(int32_t value); - public: - // int32 treat_speed = 14; - void clear_treat_speed(); - int32_t treat_speed() const; - void set_treat_speed(int32_t value); - - private: - int32_t _internal_treat_speed() const; - void _internal_set_treat_speed(int32_t value); - public: // int64 player_id = 15; void clear_player_id(); @@ -521,6 +500,16 @@ namespace protobuf int64_t _internal_player_id() const; void _internal_set_player_id(int64_t value); + public: + // int32 treat_speed = 14; + void clear_treat_speed(); + int32_t treat_speed() const; + void set_treat_speed(int32_t value); + + private: + int32_t _internal_treat_speed() const; + void _internal_set_treat_speed(int32_t value); + public: // int32 view_range = 16; void clear_view_range(); @@ -541,16 +530,6 @@ namespace protobuf int32_t _internal_radius() const; void _internal_set_radius(int32_t value); - public: - // double danger_alert = 19; - void clear_danger_alert(); - double danger_alert() const; - void set_danger_alert(double value); - - private: - double _internal_danger_alert() const; - void _internal_set_danger_alert(double value); - public: // int32 score = 20; void clear_score(); @@ -561,6 +540,16 @@ namespace protobuf int32_t _internal_score() const; void _internal_set_score(int32_t value); + public: + // double danger_alert = 19; + void clear_danger_alert(); + double danger_alert() const; + void set_danger_alert(double value); + + private: + double _internal_danger_alert() const; + void _internal_set_danger_alert(double value); + public: // int32 treat_progress = 21; void clear_treat_progress(); @@ -581,16 +570,6 @@ namespace protobuf int32_t _internal_rescue_progress() const; void _internal_set_rescue_progress(int32_t value); - public: - // .protobuf.StudentType student_type = 23; - void clear_student_type(); - ::protobuf::StudentType student_type() const; - void set_student_type(::protobuf::StudentType value); - - private: - ::protobuf::StudentType _internal_student_type() const; - void _internal_set_student_type(::protobuf::StudentType value); - public: // double facing_direction = 24; void clear_facing_direction(); @@ -601,6 +580,16 @@ namespace protobuf double _internal_facing_direction() const; void _internal_set_facing_direction(double value); + public: + // .protobuf.StudentType student_type = 23; + void clear_student_type(); + ::protobuf::StudentType student_type() const; + void set_student_type(::protobuf::StudentType value); + + private: + ::protobuf::StudentType _internal_student_type() const; + void _internal_set_student_type(::protobuf::StudentType value); + public: // @@protoc_insertion_point(class_scope:protobuf.MessageOfStudent) @@ -623,21 +612,20 @@ namespace protobuf int32_t speed_; int32_t determination_; int32_t addiction_; - int place_; - int64_t guid_; int player_state_; + int64_t guid_; int bullet_type_; int32_t learning_speed_; - int32_t treat_speed_; int64_t player_id_; + int32_t treat_speed_; int32_t view_range_; int32_t radius_; - double danger_alert_; int32_t score_; + double danger_alert_; int32_t treat_progress_; int32_t rescue_progress_; - int student_type_; double facing_direction_; + int student_type_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -812,18 +800,17 @@ namespace protobuf kXFieldNumber = 1, kYFieldNumber = 2, kSpeedFieldNumber = 3, - kPlaceFieldNumber = 6, - kGuidFieldNumber = 9, kTrickerTypeFieldNumber = 8, - kScoreFieldNumber = 10, + kGuidFieldNumber = 9, kPlayerIdFieldNumber = 11, + kScoreFieldNumber = 10, kViewRangeFieldNumber = 12, kRadiusFieldNumber = 13, + kPlayerStateFieldNumber = 14, kTrickDesireFieldNumber = 15, kClassVolumeFieldNumber = 16, - kPlayerStateFieldNumber = 14, - kBulletTypeFieldNumber = 18, kFacingDirectionFieldNumber = 17, + kBulletTypeFieldNumber = 18, }; // repeated double time_until_skill_available = 5; int time_until_skill_available_size() const; @@ -923,14 +910,14 @@ namespace protobuf void _internal_set_speed(int32_t value); public: - // .protobuf.PlaceType place = 6; - void clear_place(); - ::protobuf::PlaceType place() const; - void set_place(::protobuf::PlaceType value); + // .protobuf.TrickerType tricker_type = 8; + void clear_tricker_type(); + ::protobuf::TrickerType tricker_type() const; + void set_tricker_type(::protobuf::TrickerType value); private: - ::protobuf::PlaceType _internal_place() const; - void _internal_set_place(::protobuf::PlaceType value); + ::protobuf::TrickerType _internal_tricker_type() const; + void _internal_set_tricker_type(::protobuf::TrickerType value); public: // int64 guid = 9; @@ -943,14 +930,14 @@ namespace protobuf void _internal_set_guid(int64_t value); public: - // .protobuf.TrickerType tricker_type = 8; - void clear_tricker_type(); - ::protobuf::TrickerType tricker_type() const; - void set_tricker_type(::protobuf::TrickerType value); + // int64 player_id = 11; + void clear_player_id(); + int64_t player_id() const; + void set_player_id(int64_t value); private: - ::protobuf::TrickerType _internal_tricker_type() const; - void _internal_set_tricker_type(::protobuf::TrickerType value); + int64_t _internal_player_id() const; + void _internal_set_player_id(int64_t value); public: // int32 score = 10; @@ -962,16 +949,6 @@ 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(); @@ -992,6 +969,16 @@ 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(); @@ -1013,14 +1000,14 @@ namespace protobuf void _internal_set_class_volume(double value); public: - // .protobuf.PlayerState player_state = 14; - void clear_player_state(); - ::protobuf::PlayerState player_state() const; - void set_player_state(::protobuf::PlayerState value); + // double facing_direction = 17; + void clear_facing_direction(); + double facing_direction() const; + void set_facing_direction(double value); private: - ::protobuf::PlayerState _internal_player_state() const; - void _internal_set_player_state(::protobuf::PlayerState value); + double _internal_facing_direction() const; + void _internal_set_facing_direction(double value); public: // .protobuf.BulletType bullet_type = 18; @@ -1032,16 +1019,6 @@ 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) @@ -1062,18 +1039,17 @@ namespace protobuf int32_t x_; int32_t y_; int32_t speed_; - int place_; - int64_t guid_; int tricker_type_; - int32_t score_; + int64_t guid_; int64_t player_id_; + int32_t score_; int32_t view_range_; int32_t radius_; + int player_state_; double trick_desire_; double class_volume_; - int player_state_; - int bullet_type_; double facing_direction_; + int bullet_type_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -1249,7 +1225,6 @@ namespace protobuf kTeamFieldNumber = 6, kGuidFieldNumber = 5, kBombRangeFieldNumber = 8, - kPlaceFieldNumber = 7, kSpeedFieldNumber = 9, }; // .protobuf.BulletType type = 1; @@ -1321,16 +1296,6 @@ namespace protobuf double _internal_bomb_range() const; void _internal_set_bomb_range(double value); - public: - // .protobuf.PlaceType place = 7; - void clear_place(); - ::protobuf::PlaceType place() const; - void set_place(::protobuf::PlaceType value); - - private: - ::protobuf::PlaceType _internal_place() const; - void _internal_set_place(::protobuf::PlaceType value); - public: // int32 speed = 9; void clear_speed(); @@ -1360,7 +1325,6 @@ namespace protobuf int team_; int64_t guid_; double bomb_range_; - int place_; int32_t speed_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; @@ -1785,9 +1749,8 @@ namespace protobuf kTypeFieldNumber = 1, kXFieldNumber = 2, kFacingDirectionFieldNumber = 4, - kYFieldNumber = 3, - kPlaceFieldNumber = 6, kGuidFieldNumber = 5, + kYFieldNumber = 3, }; // .protobuf.PropType type = 1; void clear_type(); @@ -1818,26 +1781,6 @@ namespace protobuf double _internal_facing_direction() const; void _internal_set_facing_direction(double value); - public: - // int32 y = 3; - void clear_y(); - int32_t y() const; - void set_y(int32_t value); - - private: - int32_t _internal_y() const; - void _internal_set_y(int32_t value); - - public: - // .protobuf.PlaceType place = 6; - void clear_place(); - ::protobuf::PlaceType place() const; - void set_place(::protobuf::PlaceType value); - - private: - ::protobuf::PlaceType _internal_place() const; - void _internal_set_place(::protobuf::PlaceType value); - public: // int64 guid = 5; void clear_guid(); @@ -1848,6 +1791,16 @@ namespace protobuf int64_t _internal_guid() const; void _internal_set_guid(int64_t value); + public: + // int32 y = 3; + void clear_y(); + int32_t y() const; + void set_y(int32_t value); + + private: + int32_t _internal_y() const; + void _internal_set_y(int32_t value); + public: // @@protoc_insertion_point(class_scope:protobuf.MessageOfProp) @@ -1863,9 +1816,8 @@ namespace protobuf int type_; int32_t x_; double facing_direction_; - int32_t y_; - int place_; int64_t guid_; + int32_t y_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; }; union @@ -5502,30 +5454,6 @@ namespace protobuf return _internal_mutable_time_until_skill_available(); } - // .protobuf.PlaceType place = 7; - inline void MessageOfStudent::clear_place() - { - _impl_.place_ = 0; - } - inline ::protobuf::PlaceType MessageOfStudent::_internal_place() const - { - return static_cast<::protobuf::PlaceType>(_impl_.place_); - } - inline ::protobuf::PlaceType MessageOfStudent::place() const - { - // @@protoc_insertion_point(field_get:protobuf.MessageOfStudent.place) - return _internal_place(); - } - inline void MessageOfStudent::_internal_set_place(::protobuf::PlaceType value) - { - _impl_.place_ = value; - } - inline void MessageOfStudent::set_place(::protobuf::PlaceType value) - { - _internal_set_place(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfStudent.place) - } - // repeated .protobuf.PropType prop = 8; inline int MessageOfStudent::_internal_prop_size() const { @@ -6105,30 +6033,6 @@ namespace protobuf return _internal_mutable_time_until_skill_available(); } - // .protobuf.PlaceType place = 6; - inline void MessageOfTricker::clear_place() - { - _impl_.place_ = 0; - } - inline ::protobuf::PlaceType MessageOfTricker::_internal_place() const - { - return static_cast<::protobuf::PlaceType>(_impl_.place_); - } - inline ::protobuf::PlaceType MessageOfTricker::place() const - { - // @@protoc_insertion_point(field_get:protobuf.MessageOfTricker.place) - return _internal_place(); - } - inline void MessageOfTricker::_internal_set_place(::protobuf::PlaceType value) - { - _impl_.place_ = value; - } - inline void MessageOfTricker::set_place(::protobuf::PlaceType value) - { - _internal_set_place(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfTricker.place) - } - // repeated .protobuf.PropType prop = 7; inline int MessageOfTricker::_internal_prop_size() const { @@ -6649,30 +6553,6 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.MessageOfBullet.team) } - // .protobuf.PlaceType place = 7; - inline void MessageOfBullet::clear_place() - { - _impl_.place_ = 0; - } - inline ::protobuf::PlaceType MessageOfBullet::_internal_place() const - { - return static_cast<::protobuf::PlaceType>(_impl_.place_); - } - inline ::protobuf::PlaceType MessageOfBullet::place() const - { - // @@protoc_insertion_point(field_get:protobuf.MessageOfBullet.place) - return _internal_place(); - } - inline void MessageOfBullet::_internal_set_place(::protobuf::PlaceType value) - { - _impl_.place_ = value; - } - inline void MessageOfBullet::set_place(::protobuf::PlaceType value) - { - _internal_set_place(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfBullet.place) - } - // double bomb_range = 8; inline void MessageOfBullet::clear_bomb_range() { @@ -6993,30 +6873,6 @@ namespace protobuf // @@protoc_insertion_point(field_set:protobuf.MessageOfProp.guid) } - // .protobuf.PlaceType place = 6; - inline void MessageOfProp::clear_place() - { - _impl_.place_ = 0; - } - inline ::protobuf::PlaceType MessageOfProp::_internal_place() const - { - return static_cast<::protobuf::PlaceType>(_impl_.place_); - } - inline ::protobuf::PlaceType MessageOfProp::place() const - { - // @@protoc_insertion_point(field_get:protobuf.MessageOfProp.place) - return _internal_place(); - } - inline void MessageOfProp::_internal_set_place(::protobuf::PlaceType value) - { - _impl_.place_ = value; - } - inline void MessageOfProp::set_place(::protobuf::PlaceType value) - { - _internal_set_place(value); - // @@protoc_insertion_point(field_set:protobuf.MessageOfProp.place) - } - // ------------------------------------------------------------------- // MessageOfPickedProp diff --git a/CAPI/cpp/proto/Services.grpc.pb.h b/CAPI/cpp/proto/Services.grpc.pb.h index e99d5cc..7cf6d74 100644 --- a/CAPI/cpp/proto/Services.grpc.pb.h +++ b/CAPI/cpp/proto/Services.grpc.pb.h @@ -25,8 +25,6 @@ #include #include -#undef SendMessage - namespace protobuf { diff --git a/CAPI/python/PyAPI/DebugAPI.py b/CAPI/python/PyAPI/DebugAPI.py index deeb2c2..dec6f45 100644 --- a/CAPI/python/PyAPI/DebugAPI.py +++ b/CAPI/python/PyAPI/DebugAPI.py @@ -318,7 +318,7 @@ class StudentDebugAPI(IStudentAPI, IGameTimer): self.__logger.info( f"playerID={student.playerID}, GUID={student.guid}, x={student.x}, y={student.y}") self.__logger.info( - f"speed={student.speed}, view range={student.viewRange}, place={student.place.name}, radius={student.radius}") + f"speed={student.speed}, view range={student.viewRange}, radius={student.radius}") self.__logger.info( f"score={student.score}, facing direction={student.facingDirection}, skill time={student.timeUntilSkillAvailable}") studentProp = "" @@ -342,7 +342,7 @@ class StudentDebugAPI(IStudentAPI, IGameTimer): self.__logger.info( f"playerID={tricker.playerID}, GUID={tricker.guid}, x={tricker.x}, y={tricker.y}") self.__logger.info( - f"speed={tricker.speed}, view range={tricker.viewRange}, place={tricker.place.name}, radius={tricker.radius}") + f"speed={tricker.speed}, view range={tricker.viewRange}, radius={tricker.radius}") self.__logger.info( f"score={tricker.score}, facing direction={tricker.facingDirection}, skill time={tricker.timeUntilSkillAvailable}") trickerProp = "" @@ -362,7 +362,7 @@ class StudentDebugAPI(IStudentAPI, IGameTimer): for prop in self.__logic.GetProps(): self.__logger.info("******Prop Info******") self.__logger.info( - f"GUID={prop.guid}, x={prop.x}, y={prop.y}, place={prop.place.name}, facing direction={prop.facingDirection}") + f"GUID={prop.guid}, x={prop.x}, y={prop.y}, facing direction={prop.facingDirection}") self.__logger.info("*********************") def PrintSelfInfo(self) -> None: @@ -371,7 +371,7 @@ class StudentDebugAPI(IStudentAPI, IGameTimer): self.__logger.info( f"playerID={student.playerID}, GUID={student.guid}, x={student.x}, y={student.y}") self.__logger.info( - f"speed={student.speed}, view range={student.viewRange}, place={student.place.name}, radius={student.radius}") + f"speed={student.speed}, view range={student.viewRange}, radius={student.radius}") self.__logger.info( f"score={student.score}, facing direction={student.facingDirection}, skill time={student.timeUntilSkillAvailable}") studentProp = "" @@ -773,7 +773,7 @@ class TrickerDebugAPI(ITrickerAPI, IGameTimer): self.__logger.info( f"playerID={student.playerID}, GUID={student.guid}, x={student.x}, y={student.y}") self.__logger.info( - f"speed={student.speed}, view range={student.viewRange}, place={student.place.name}, radius={student.radius}") + f"speed={student.speed}, view range={student.viewRange}, radius={student.radius}") self.__logger.info( f"score={student.score}, facing direction={student.facingDirection}, skill time={student.timeUntilSkillAvailable}") studentProp = "" @@ -797,7 +797,7 @@ class TrickerDebugAPI(ITrickerAPI, IGameTimer): self.__logger.info( f"playerID={tricker.playerID}, GUID={tricker.guid}, x={tricker.x}, y={tricker.y}") self.__logger.info( - f"speed={tricker.speed}, view range={tricker.viewRange}, place={tricker.place.name}, radius={tricker.radius}") + f"speed={tricker.speed}, view range={tricker.viewRange}, radius={tricker.radius}") self.__logger.info( f"score={tricker.score}, facing direction={tricker.facingDirection}, skill time={tricker.timeUntilSkillAvailable}") trickerProp = "" @@ -817,7 +817,7 @@ class TrickerDebugAPI(ITrickerAPI, IGameTimer): for prop in self.__logic.GetProps(): self.__logger.info("******Prop Info******") self.__logger.info( - f"GUID={prop.guid}, x={prop.x}, y={prop.y}, place={prop.place.name}, facing direction={prop.facingDirection}") + f"GUID={prop.guid}, x={prop.x}, y={prop.y}, facing direction={prop.facingDirection}") self.__logger.info("*********************") def PrintSelfInfo(self) -> None: @@ -826,7 +826,7 @@ class TrickerDebugAPI(ITrickerAPI, IGameTimer): self.__logger.info( f"playerID={tricker.playerID}, GUID={tricker.guid}, x={tricker.x}, y={tricker.y}") self.__logger.info( - f"speed={tricker.speed}, view range={tricker.viewRange}, place={tricker.place.name}, radius={tricker.radius}") + f"speed={tricker.speed}, view range={tricker.viewRange}, radius={tricker.radius}") self.__logger.info( f"score={tricker.score}, facing direction={tricker.facingDirection}, skill time={tricker.timeUntilSkillAvailable}") trickerProp = "" diff --git a/CAPI/python/PyAPI/structures.py b/CAPI/python/PyAPI/structures.py index 72e61b4..f28fbe4 100644 --- a/CAPI/python/PyAPI/structures.py +++ b/CAPI/python/PyAPI/structures.py @@ -156,7 +156,6 @@ class Player: self.timeUntilSkillAvailable: List[float] = [] self.playerType: PlayerType = PlayerType.NullPlayerType self.prop: List[PropType] = [] - self.place: PlaceType = PlaceType.NullPlaceType self.bulletType: BulletType = BulletType.NullBulletType self.playerState: PlayerState = PlayerState.NullState @@ -190,7 +189,6 @@ class Prop: self.y: int = 0 self.guid: int = 0 self.type: PropType = PropType.NullPropType - self.place: PlaceType = PlaceType.NullPlaceType self.facingDirection: float = 0.0 @@ -202,7 +200,6 @@ class Bullet: self.facingDirection: float = 0.0 self.guid: int = 0 self.team: PlayerType = PlayerType.NullPlayerType - self.place: PlaceType = PlaceType.NullPlaceType self.bombRange: float = 0.0 self.speed: int = 0 diff --git a/CAPI/python/PyAPI/utils.py b/CAPI/python/PyAPI/utils.py index 42c85a4..15ad8a3 100644 --- a/CAPI/python/PyAPI/utils.py +++ b/CAPI/python/PyAPI/utils.py @@ -179,7 +179,6 @@ class Proto2THUAI6(NoInstance): tricker.bulletType = Proto2THUAI6.bulletTypeDict[trickerMsg.bullet_type] for time in trickerMsg.time_until_skill_available: tricker.timeUntilSkillAvailable.append(time) - tricker.place = Proto2THUAI6.placeTypeDict[trickerMsg.place] tricker.playerState = Proto2THUAI6.playerStateDict[trickerMsg.player_state] for item in trickerMsg.prop: tricker.prop.append(Proto2THUAI6.propTypeDict[item]) @@ -211,7 +210,6 @@ class Proto2THUAI6(NoInstance): student.dangerAlert = studentMsg.danger_alert for time in studentMsg.time_until_skill_available: student.timeUntilSkillAvailable.append(time) - student.place = Proto2THUAI6.placeTypeDict[studentMsg.place] for item in studentMsg.prop: student.prop.append(Proto2THUAI6.propTypeDict[item]) student.studentType = Proto2THUAI6.studentTypeDict[studentMsg.student_type] @@ -255,7 +253,6 @@ class Proto2THUAI6(NoInstance): 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 diff --git a/CAPI/python/run.sh b/CAPI/python/run.sh index 6d74095..70f4686 100755 --- a/CAPI/python/run.sh +++ b/CAPI/python/run.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 0 -d -o& -# python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 1 -o& +python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 1 -d -o& # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 2& # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 3& # python PyAPI/main.py -I 172.22.32.1 -P 8888 -p 4& \ No newline at end of file diff --git a/dependency/proto/Message2Clients.proto b/dependency/proto/Message2Clients.proto index c1711e3..e154b43 100755 --- a/dependency/proto/Message2Clients.proto +++ b/dependency/proto/Message2Clients.proto @@ -12,7 +12,7 @@ message MessageOfStudent int32 determination = 4; // 剩余的学习毅力,相当于血量 int32 addiction = 5; // 沉迷程度,相当于淘汰进度 repeated double time_until_skill_available = 6; - PlaceType place = 7; + // PlaceType place = 7; repeated PropType prop = 8; PlayerState player_state = 9; int64 guid = 10; @@ -37,7 +37,7 @@ message MessageOfTricker int32 y = 2; int32 speed = 3; repeated double time_until_skill_available = 5; - PlaceType place = 6; + // PlaceType place = 6; repeated PropType prop = 7; TrickerType tricker_type = 8; int64 guid = 9; @@ -61,7 +61,7 @@ message MessageOfBullet double facing_direction = 4; int64 guid = 5; PlayerType team = 6; - PlaceType place = 7; + // PlaceType place = 7; double bomb_range = 8; int32 speed = 9; } @@ -83,7 +83,7 @@ message MessageOfProp // 可拾取道具的信息 int32 y = 3; double facing_direction = 4; int64 guid = 5; - PlaceType place = 6; + // PlaceType place = 6; } diff --git a/dependency/proto/Proto.sln b/dependency/proto/Proto.sln old mode 100644 new mode 100755 diff --git a/docs/GameRules.md b/docs/GameRules.md index ba03c8b..e8f1488 100644 --- a/docs/GameRules.md +++ b/docs/GameRules.md @@ -1,5 +1,5 @@ # 规则 -V5.5 +V5.6 - [规则](#规则) - [简则](#简则) - [地图](#地图) @@ -192,7 +192,7 @@ $$ | :------------ | :--------------------- | :--------------------- | :--------------------- | :--------------------- | | 移动速度/s | 3960 | 3600 | 3852 | 3600 | | 隐蔽度 | 1.5 | 1 | 0.8 | 0.75| -| 警戒范围 | 22,100 | 17000 | 15300 | 17000 +| 警戒范围 | 22100 | 17000 | 15300 | 17000| | 视野范围 | 15600 | 13000 | 13000 | 14300| | 开锁门速度/ms | 4000 | 4000 | 4000 |4000 | | 翻窗速度/s | 2540 | 2540 | 2794 | 2540| @@ -246,14 +246,14 @@ $$ | :------------ | :--------------------- | :--------------------- | :--------------------- | :--------------------- | | 移动速度/s | 2700 | 3150 | 2880 | 3000 | | 最大毅力值 | 30000000 | 3000000 | 3300000 | 3200000 | -| 最大沉迷度 | 600000 | 54,000 | 78,000 | 66,000 | -| 学习一科速度 | 0 | 73 | 135 | 123 | +| 最大沉迷度 | 600000 | 54000 | 78000 | 66000 | +| 学习速度/ms | 0 | 73 | 135 | 123 | | 勉励速度/ms | 80 | 90 | 100 | 120 | | 隐蔽度 | 0.5 | 0.9 | 0.9 | 0.8 | -| 警戒范围 | 7500 | 15000 | 13,500 | 15000 | -| 视野范围 | 9,000 | 11000 | 9,000 | 10000 | +| 警戒范围 | 7500 | 15000 | 13500 | 15000 | +| 视野范围 | 9000 | 11000 | 9000 | 10000 | | 开锁门速度/ms | 4000 | 4000 | 4000 | 2800 | -| 翻窗速度/ms | 1270 | 3048 | 2116 | 2540 | +| 翻窗速度/ms | 611 | 1466 | 1018 | 1222 | | 翻箱速度/ms | 1000 | 1000 | 1000 | 900 | #### 运动员 diff --git a/docs/游戏机制与平衡性调整更新草案.md b/docs/游戏机制与平衡性调整更新草案.md new file mode 100644 index 0000000..c4bd4b8 --- /dev/null +++ b/docs/游戏机制与平衡性调整更新草案.md @@ -0,0 +1,97 @@ +# 游戏机制与平衡性调整更新草案 +v1.2 + +## 说明 +- 该草案尚未完全确定,请大家不要过分依靠该文档进行修改自己的代码 +- 有任何问题都可以在选手群中提出建议和讨论 + +## 游戏接口 + 删除structures.h中Player的属性place + +## 游戏规则 + +## 游戏机制 + +## 攻击 +- 飞刀FlyingKnife + - 前摇变为600ms +- 搞蛋鬼的一般攻击CommonAttackOfTricker + - 改为“不能攻击未写完的作业” +- 蹦蹦炸弹BombBomb + - 未攻击至目标时的后摇改为1200ms + - 增强为“可以攻击未写完的作业” + - 增强为“可以攻击使门被打开(可以重新被锁上)” +- strike(新增) + - 可以攻击未写完的作业 + +修改后: +| 攻击(子弹)类型 |搞蛋鬼的一般攻击CommonAttackOfTricker|飞刀FlyingKnife | 蹦蹦炸弹BombBomb | 小炸弹JumpyDumpty | strike | +| :--------------------- | :---------------------| :--------------------- | :--------------------- | :--------------------- | :--------------------- | +| 子弹爆炸范围 | 0 | 0 | 2000 | 1000 | 0 | +| 子弹攻击距离 | 2200 | 78000 | 2200 | 4400 | 2000 | +| 攻击力 | 1500000 | 1200000 | 1800000 | 900000 | 1600000 | +| 移动速度/s | 7400 | 18500 | 6000 | 8600 | 6250 | +| 前摇(ms) | 297 | 600 | 366 | - | 320 | +|未攻击至目标时的后摇(ms)| 800 | 0 | 1200 | - | 800 | +|攻击至目标时的后摇(ms) | 3700 | 0 | 3700 | - | 3700 | +| CD(ms) | 800 | 400 | 3000 | - | 800 | +| 最大子弹容量 | 1 | 1 | 1 | - | 1 | + + +## 职业 +- 所有角色开锁门速度加速至1.25倍 +- 所有角色翻箱速度加速至1.25倍 + +### 学生 +- 先前学生翻窗数据有误 + +- Teacher + - 警戒范围由7500改为13000 + - 翻窗速度改为1000 + - 技能惩罚(Punish)强化为“使用瞬间,在**视野距离范围内(不是可视范围)的**翻窗、开锁门、攻击前后摇、**使用技能期间**的捣蛋鬼会被眩晕(3070+**500***已受伤害/基本伤害(1500000))ms” + - 技能喝茶(HaveTea)(新增) + - CD:90s + - 使用瞬间,向当前方向瞬移3000(可以穿墙),如果会碰撞则失败。 +- Robot(新增) + - 无技能 + - 特性 + - 不可被眩晕 + - 不可毕业 + - 不可救人 + - 无牵制得分 + - 不可使用道具(可以捡起和扔道具) +- TechOtaku(新增) + - 一名TechOtaku最多可以在场上同时最多拥有3个Robot,无法共享视野 + 0. SummonGolem + - CD:40s,持续时间:6s + - 在持续时间中,学生进入人物状态进入UsingSpecialSkill(不能移动),进入其他状态会导致制作机器人失败。 + - 在持续时间中,学生面前生成道具CraftingBench;学生进入其他状态或该道具被碰撞后,CraftingBench消失且制作机器人失败。 + - 持续时间结束后,道具CraftingBench所在位置生成一个Robot,CraftingBench消失 + 1. UseRobot + - CD:0s,持续时间:0s + - TechOtaku的Robot的PlayerId = TechOtaku的PlayerId + n×5(一局游戏理论人数),其中1<=n<=3(自己的n为0) + - 新造的Robot的PlayerId的n总是尽量小 + - 每使用一次UseRobot,TechOtaku就切换一次操控的角色,若之前操控角色的PlayerId =TechOtaku的PlayerId + j×5,其PlayerId变为PlayerId =TechOtaku的PlayerId + ((j+1)mod 4 )×5,若其不可用,则再次进行这样的操作 +修改后: + +| 学生职业 | 教师Teacher | 健身狂Athlete |学霸StraightAStudent | 开心果Sunshine | 机器人Robot | 技术宅TechOtaku | +| :------------ | :------------------ | :------------------ | :------------------ | :------------------ | :------------------ | :------------------ | +| 移动速度/s | 2700 | 3150 | 2880 | 3000 | 2700 | 2880 | +| 最大毅力值 | 30000000 | 3000000 | 3300000 | 3200000 | 900000 | 2700000 | +| 最大沉迷度 | 600000 | 54000 | 78000 | 60000 | 0 | 60000 | +| 学习速度/ms | 0 | 73 | 135 | 123 | 100 | 130 | +| 勉励速度/ms | 80 | 90 | 100 | 120 | 0 | 100 | +| 隐蔽度 | 0.5 | 0.9 | 0.9 | 0.8 | 0.8 | 1.1 | +| 警戒范围 | 13000 | 15000 | 13500 | 15000 | 0 | 15000 | +| 视野范围 | 9000 | 11000 | 9000 | 10000 | 0 | 9000 | +| 开锁门速度/ms | 5000 | 5000 | 5000 | 3500 | 0 | 5000 | +| 翻窗速度/ms | 1000 | 1466 | 1018 | 1222 | 1 | 1100 | +| 翻箱速度/ms | 1250 | 1250 | 1250 | 1125 | 1000 | 1100 | + +### 捣蛋鬼 +- Assassin + - 技能隐身(BecomeInvisible)添加约束条件“使用隐身技能后,人物状态进入UsingSpecialSkill,进入其他状态会使得隐身状态解除" +- 喧哗者ANoisyPerson + - 普通攻击改为strike +- Klee + - 被动技能Lucky!(新增):开局获得随机的一个道具(不会是钥匙) diff --git a/docs/版本更新说明.md b/docs/版本更新说明.md new file mode 100644 index 0000000..22cf437 --- /dev/null +++ b/docs/版本更新说明.md @@ -0,0 +1,10 @@ +# 版本更新说明 + +# 说明 +- 只说明对于选手较为重要的修改 + +# 等待更新的更改 +- docs:添加了 游戏机制与平衡性调整更新草案.pdf +- docs:添加了 版本更新说明.pdf +- docs&hotfix: 修正了GameRules.pdf中学生翻窗速度的错误 +- remove: 删除了Place属性 \ No newline at end of file diff --git a/logic/GameClass/GameObj/Bullet/BombedBullet.cs b/logic/GameClass/GameObj/Bullet/BombedBullet.cs index c9b245f..b4afd1f 100644 --- a/logic/GameClass/GameObj/Bullet/BombedBullet.cs +++ b/logic/GameClass/GameObj/Bullet/BombedBullet.cs @@ -13,7 +13,6 @@ namespace GameClass.GameObj public BombedBullet(Bullet bullet) : base(bullet.Position, bullet.Radius, GameObjType.BombedBullet) { - this.place = bullet.Place; this.bulletHasBombed = bullet; this.MappingID = bullet.ID; this.FacingDirection = bullet.FacingDirection; diff --git a/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs b/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs index 2b3df5c..7601669 100644 --- a/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs +++ b/logic/GameClass/GameObj/Bullet/Bullet.Ghost.cs @@ -5,8 +5,8 @@ namespace GameClass.GameObj { internal sealed class CommonAttackOfGhost : Bullet { - public CommonAttackOfGhost(Character player, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) : - base(player, radius, placeType, pos) + public CommonAttackOfGhost(Character player, XY pos, int radius = GameData.bulletRadius) : + base(player, radius, pos) { } public override double BulletBombRange => 0; @@ -52,8 +52,8 @@ namespace GameClass.GameObj internal sealed class FlyingKnife : Bullet { - public FlyingKnife(Character player, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) : - base(player, radius, placeType, pos) + public FlyingKnife(Character player, XY pos, int radius = GameData.bulletRadius) : + base(player, radius, pos) { } public override double BulletBombRange => 0; @@ -100,8 +100,7 @@ namespace GameClass.GameObj internal sealed class BombBomb : Bullet { - public BombBomb(Character player, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) : - base(player, radius, placeType, pos) + public BombBomb(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos) { } public override double BulletBombRange => GameData.basicBulletBombRange; @@ -146,8 +145,7 @@ namespace GameClass.GameObj } internal sealed class JumpyDumpty : Bullet { - public JumpyDumpty(Character player, PlaceType placeType, XY pos, int radius = GameData.bulletRadius) : - base(player, radius, placeType, pos) + public JumpyDumpty(Character player, XY pos, int radius = GameData.bulletRadius) : base(player, radius, pos) { } public override double BulletBombRange => GameData.basicBulletBombRange / 2; diff --git a/logic/GameClass/GameObj/Bullet/Bullet.cs b/logic/GameClass/GameObj/Bullet/Bullet.cs index 29f2d78..acada59 100644 --- a/logic/GameClass/GameObj/Bullet/Bullet.cs +++ b/logic/GameClass/GameObj/Bullet/Bullet.cs @@ -41,10 +41,9 @@ namespace GameClass.GameObj return true; return false; } - public Bullet(Character player, int radius, PlaceType placeType, XY Position) : + public Bullet(Character player, int radius, XY Position) : base(Position, radius, GameObjType.Bullet) { - this.place = placeType; this.CanMove = true; this.moveSpeed = this.Speed; this.hasSpear = player.TryUseSpear(); @@ -57,18 +56,18 @@ namespace GameClass.GameObj public static class BulletFactory { - public static Bullet? GetBullet(Character character, PlaceType place, XY pos) + public static Bullet? GetBullet(Character character, XY pos) { switch (character.BulletOfPlayer) { case BulletType.FlyingKnife: - return new FlyingKnife(character, place, pos); + return new FlyingKnife(character, pos); case BulletType.CommonAttackOfGhost: - return new CommonAttackOfGhost(character, place, pos); + return new CommonAttackOfGhost(character, pos); case BulletType.JumpyDumpty: - return new JumpyDumpty(character, place, pos); + return new JumpyDumpty(character, pos); case BulletType.BombBomb: - return new BombBomb(character, place, pos); + return new BombBomb(character, pos); default: return null; } diff --git a/logic/GameClass/GameObj/Character/Character.Skill.cs b/logic/GameClass/GameObj/Character/Character.Skill.cs index a1dc379..c835a6d 100644 --- a/logic/GameClass/GameObj/Character/Character.Skill.cs +++ b/logic/GameClass/GameObj/Character/Character.Skill.cs @@ -57,7 +57,6 @@ namespace GameClass.GameObj protected Character(XY initPos, int initRadius, CharacterType characterType) : base(initPos, initRadius, GameObjType.Character) { - this.place = PlaceType.Null; this.CanMove = true; this.score = 0; this.buffManager = new BuffManager(); diff --git a/logic/GameClass/GameObj/Character/Character.cs b/logic/GameClass/GameObj/Character/Character.cs index d8dea18..aa799eb 100644 --- a/logic/GameClass/GameObj/Character/Character.cs +++ b/logic/GameClass/GameObj/Character/Character.cs @@ -58,10 +58,10 @@ namespace GameClass.GameObj /// 进行一次攻击 /// /// 攻击操作发出的子弹 - public Bullet? Attack(XY pos, PlaceType place) + public Bullet? Attack(XY pos) { if (TrySubBulletNum()) - return BulletFactory.GetBullet(this, place, pos); + return BulletFactory.GetBullet(this, pos); else return null; } @@ -365,7 +365,6 @@ namespace GameClass.GameObj CanMove = false; IsResetting = true; Position = GameData.PosWhoDie; - place = PlaceType.Grass; } } #endregion diff --git a/logic/GameClass/GameObj/GameObj.cs b/logic/GameClass/GameObj/GameObj.cs index 3aba2a1..d9db633 100644 --- a/logic/GameClass/GameObj/GameObj.cs +++ b/logic/GameClass/GameObj/GameObj.cs @@ -14,35 +14,24 @@ namespace GameClass.GameObj protected readonly XY birthPos; - private GameObjType type; + private readonly GameObjType type; public GameObjType Type => type; private static long currentMaxID = 0; // 目前游戏对象的最大ID public const long invalidID = long.MaxValue; // 无效的ID - public const long noneID = long.MinValue; public long ID { get; } - private XY position; - public XY Position - { - get => position; - protected - set - { - lock (gameObjLock) - { - position = value; - } - } - } - - protected PlaceType place; - public PlaceType Place { get => place; } + protected XY position; + public virtual XY Position { get; set; } private XY facingDirection = new(1, 0); public XY FacingDirection { - get => facingDirection; + get + { + lock (gameObjLock) + return facingDirection; + } set { lock (gameObjLock) @@ -85,7 +74,7 @@ namespace GameClass.GameObj public virtual bool IgnoreCollideExecutor(IGameObj targetObj) => false; public GameObj(XY initPos, int initRadius, GameObjType initType) { - this.Position = this.birthPos = initPos; + this.position = this.birthPos = initPos; this.Radius = initRadius; this.type = initType; ID = Interlocked.Increment(ref currentMaxID); diff --git a/logic/GameClass/GameObj/Map/Chest.cs b/logic/GameClass/GameObj/Map/Chest.cs index 23d9571..b302e44 100644 --- a/logic/GameClass/GameObj/Map/Chest.cs +++ b/logic/GameClass/GameObj/Map/Chest.cs @@ -11,7 +11,6 @@ namespace GameClass.GameObj public Chest(XY initPos) : base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.Chest) { - this.place = PlaceType.Chest; this.CanMove = false; } public override bool IsRigid => true; diff --git a/logic/GameClass/GameObj/Map/Door.cs b/logic/GameClass/GameObj/Map/Door.cs index 6dd85e9..c03f160 100644 --- a/logic/GameClass/GameObj/Map/Door.cs +++ b/logic/GameClass/GameObj/Map/Door.cs @@ -11,9 +11,25 @@ namespace GameClass.GameObj public Door(XY initPos, PlaceType placeType) : base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.Door) { - this.place = placeType; + switch (placeType) + { + case PlaceType.Door3: + doorNum = 3; + break; + case PlaceType.Door5: + doorNum = 5; + break; + case PlaceType.Door6: + default: + doorNum = 6; + break; + } this.CanMove = false; } + + private readonly int doorNum; + public int DoorNum => doorNum; + public override bool IsRigid => !isOpen; public override ShapeType Shape => ShapeType.Square; diff --git a/logic/GameClass/GameObj/Map/Doorway.cs b/logic/GameClass/GameObj/Map/Doorway.cs index cff420b..4c5f78d 100644 --- a/logic/GameClass/GameObj/Map/Doorway.cs +++ b/logic/GameClass/GameObj/Map/Doorway.cs @@ -11,7 +11,6 @@ namespace GameClass.GameObj public Doorway(XY initPos) : base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.Doorway) { - this.place = PlaceType.Doorway; this.CanMove = false; } public override bool IsRigid => true; diff --git a/logic/GameClass/GameObj/Map/EmergencyExit.cs b/logic/GameClass/GameObj/Map/EmergencyExit.cs index f311238..02414c4 100644 --- a/logic/GameClass/GameObj/Map/EmergencyExit.cs +++ b/logic/GameClass/GameObj/Map/EmergencyExit.cs @@ -11,7 +11,6 @@ namespace GameClass.GameObj public EmergencyExit(XY initPos) : base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.EmergencyExit) { - this.place = PlaceType.EmergencyExit; this.CanMove = false; } public override bool IsRigid => true; diff --git a/logic/GameClass/GameObj/Map/Generator.cs b/logic/GameClass/GameObj/Map/Generator.cs index d982161..fe3fbd5 100644 --- a/logic/GameClass/GameObj/Map/Generator.cs +++ b/logic/GameClass/GameObj/Map/Generator.cs @@ -10,7 +10,6 @@ namespace GameClass.GameObj public Generator(XY initPos) : base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.Generator) { - this.place = PlaceType.Generator; this.CanMove = false; } public override bool IsRigid => true; diff --git a/logic/GameClass/GameObj/Map/Wall.cs b/logic/GameClass/GameObj/Map/Wall.cs index 3a81ee4..1cef8e9 100644 --- a/logic/GameClass/GameObj/Map/Wall.cs +++ b/logic/GameClass/GameObj/Map/Wall.cs @@ -10,7 +10,6 @@ namespace GameClass.GameObj public Wall(XY initPos) : base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.Wall) { - this.place = PlaceType.Wall; this.CanMove = false; } public override bool IsRigid => true; diff --git a/logic/GameClass/GameObj/Map/Window.cs b/logic/GameClass/GameObj/Map/Window.cs index 3694ec4..a71e05f 100644 --- a/logic/GameClass/GameObj/Map/Window.cs +++ b/logic/GameClass/GameObj/Map/Window.cs @@ -11,7 +11,6 @@ namespace GameClass.GameObj public Window(XY initPos) : base(initPos, GameData.numOfPosGridPerCell / 2, GameObjType.Window) { - this.place = PlaceType.Window; this.CanMove = false; } public override bool IsRigid => true; diff --git a/logic/GameClass/GameObj/Moveable.cs b/logic/GameClass/GameObj/Moveable.cs index 128240f..4184fa2 100644 --- a/logic/GameClass/GameObj/Moveable.cs +++ b/logic/GameClass/GameObj/Moveable.cs @@ -12,6 +12,22 @@ namespace GameClass.GameObj protected readonly object moveObjLock = new(); public object MoveLock => moveObjLock; + public override XY Position + { + get + { + lock (gameObjLock) + return position; + } + set + { + lock (gameObjLock) + { + position = value; + } + } + } + private bool isMoving; public bool IsMoving { @@ -48,27 +64,17 @@ namespace GameClass.GameObj public int OrgMoveSpeed { get; protected set; } // 移动,改变坐标 - public long MovingSetPos(XY moveVec, PlaceType place) + public long MovingSetPos(XY moveVec) { if (moveVec.x != 0 || moveVec.y != 0) lock (gameObjLock) { FacingDirection = moveVec; this.Position += moveVec; - this.place = place; } return moveVec * moveVec; } - public void ReSetPos(XY pos, PlaceType place) - { - lock (gameObjLock) - { - this.Position = pos; - this.place = place; - } - } - /// /// 设置移动速度 /// diff --git a/logic/GameClass/GameObj/OutOfBoundBlock.cs b/logic/GameClass/GameObj/OutOfBoundBlock.cs index 1c62417..3cd88eb 100644 --- a/logic/GameClass/GameObj/OutOfBoundBlock.cs +++ b/logic/GameClass/GameObj/OutOfBoundBlock.cs @@ -11,7 +11,6 @@ namespace GameClass.GameObj public OutOfBoundBlock(XY initPos) : base(initPos, int.MaxValue, GameObjType.OutOfBoundBlock) { - this.place = PlaceType.Wall; this.CanMove = false; } diff --git a/logic/GameClass/GameObj/PickedProp.cs b/logic/GameClass/GameObj/PickedProp.cs index 33418c2..221e6e8 100644 --- a/logic/GameClass/GameObj/PickedProp.cs +++ b/logic/GameClass/GameObj/PickedProp.cs @@ -17,7 +17,6 @@ namespace GameClass.GameObj public PickedProp(Prop prop) : base(prop.Position, prop.Radius, GameObjType.PickedProp) { - this.place = prop.Place; this.PropHasPicked = prop; this.MappingID = prop.ID; } diff --git a/logic/GameClass/GameObj/Prop.cs b/logic/GameClass/GameObj/Prop.cs index 3704a10..c3626de 100644 --- a/logic/GameClass/GameObj/Prop.cs +++ b/logic/GameClass/GameObj/Prop.cs @@ -19,10 +19,9 @@ namespace GameClass.GameObj public abstract PropType GetPropType(); - public Prop(XY initPos, PlaceType place, int radius = GameData.PropRadius) : + public Prop(XY initPos, int radius = GameData.PropRadius) : base(initPos, radius, GameObjType.Prop) { - this.place = place; this.CanMove = false; this.moveSpeed = GameData.PropMoveSpeed; } @@ -43,8 +42,8 @@ namespace GameClass.GameObj /// public sealed class AddSpeed : Prop { - public AddSpeed(XY initPos, PlaceType placeType) : - base(initPos, placeType) + public AddSpeed(XY initPos) : + base(initPos) { } public override PropType GetPropType() => PropType.AddSpeed; @@ -54,24 +53,24 @@ namespace GameClass.GameObj /// public sealed class AddLifeOrClairaudience : Prop { - public AddLifeOrClairaudience(XY initPos, PlaceType placeType) : - base(initPos, placeType) + public AddLifeOrClairaudience(XY initPos) : + base(initPos) { } public override PropType GetPropType() => PropType.AddLifeOrClairaudience; } public sealed class AddHpOrAp : Prop { - public AddHpOrAp(XY initPos, PlaceType placeType) : - base(initPos, placeType) + public AddHpOrAp(XY initPos) : + base(initPos) { } public override PropType GetPropType() => PropType.AddHpOrAp; } public sealed class RecoveryFromDizziness : Prop { - public RecoveryFromDizziness(XY initPos, PlaceType placeType) : - base(initPos, placeType) + public RecoveryFromDizziness(XY initPos) : + base(initPos) { } public override PropType GetPropType() => PropType.RecoveryFromDizziness; @@ -81,35 +80,35 @@ namespace GameClass.GameObj /// public sealed class ShieldOrSpear : Prop { - public ShieldOrSpear(XY initPos, PlaceType placeType) : base(initPos, placeType) + public ShieldOrSpear(XY initPos) : base(initPos) { } public override PropType GetPropType() => PropType.ShieldOrSpear; } public sealed class Key3 : Prop { - public Key3(XY initPos, PlaceType placeType) : base(initPos, placeType) + public Key3(XY initPos) : base(initPos) { } public override PropType GetPropType() => PropType.Key3; } public sealed class Key5 : Prop { - public Key5(XY initPos, PlaceType placeType) : base(initPos, placeType) + public Key5(XY initPos) : base(initPos) { } public override PropType GetPropType() => PropType.Key5; } public sealed class Key6 : Prop { - public Key6(XY initPos, PlaceType placeType) : base(initPos, placeType) + public Key6(XY initPos) : base(initPos) { } public override PropType GetPropType() => PropType.Key6; } public sealed class NullProp : Prop { - public NullProp(PlaceType placeType = PlaceType.Wall) : base(new XY(1, 1), placeType) + public NullProp() : base(new XY(1, 1)) { } public override PropType GetPropType() => PropType.Null; @@ -143,26 +142,26 @@ namespace GameClass.GameObj // #endregion public static class PropFactory { - public static Prop GetProp(PropType propType, XY pos, PlaceType place) + public static Prop GetProp(PropType propType, XY pos) { switch (propType) { case PropType.AddSpeed: - return new AddSpeed(pos, place); + return new AddSpeed(pos); case PropType.AddLifeOrClairaudience: - return new AddLifeOrClairaudience(pos, place); + return new AddLifeOrClairaudience(pos); case PropType.ShieldOrSpear: - return new ShieldOrSpear(pos, place); + return new ShieldOrSpear(pos); case PropType.AddHpOrAp: - return new AddHpOrAp(pos, place); + return new AddHpOrAp(pos); case PropType.RecoveryFromDizziness: - return new RecoveryFromDizziness(pos, place); + return new RecoveryFromDizziness(pos); case PropType.Key3: - return new Key3(pos, place); + return new Key3(pos); case PropType.Key5: - return new Key5(pos, place); + return new Key5(pos); case PropType.Key6: - return new Key6(pos, place); + return new Key6(pos); default: return new NullProp(); } diff --git a/logic/GameEngine/MoveEngine.cs b/logic/GameEngine/MoveEngine.cs index aa13c68..e3c758e 100644 --- a/logic/GameEngine/MoveEngine.cs +++ b/logic/GameEngine/MoveEngine.cs @@ -70,7 +70,7 @@ namespace GameEngine XY nextPos = obj.Position + moveVec; double maxLen = collisionChecker.FindMax(obj, nextPos, moveVec); maxLen = Math.Min(maxLen, obj.MoveSpeed / GameData.numOfStepPerSecond); - obj.MovingSetPos(new XY(moveVec, maxLen), GetPlaceType(nextPos)); + obj.MovingSetPos(new XY(moveVec, maxLen)); } public void MoveObj(IMoveable obj, int moveTime, double direction) @@ -90,7 +90,7 @@ namespace GameEngine double moveVecLength = 0.0; XY res = new(direction, moveVecLength); - double deltaLen = moveVecLength - Math.Sqrt(obj.MovingSetPos(res, GetPlaceType(obj.Position + res))); // 转向,并用deltaLen存储行走的误差 + double deltaLen = moveVecLength - Math.Sqrt(obj.MovingSetPos(res)); // 转向,并用deltaLen存储行走的误差 IGameObj? collisionObj = null; bool isDestroyed = false; @@ -156,7 +156,7 @@ namespace GameEngine } while (flag); if (threadNum == 0 || ((ICharacter)obj).ThreadNum == threadNum) - deltaLen += moveVecLength - Math.Sqrt(obj.MovingSetPos(res, GetPlaceType(obj.Position + res))); + deltaLen += moveVecLength - Math.Sqrt(obj.MovingSetPos(res)); return true; }, @@ -175,7 +175,7 @@ namespace GameEngine if ((collisionObj = collisionChecker.CheckCollisionWhenMoving(obj, res)) == null) { if (threadNum == 0 || ((ICharacter)obj).ThreadNum == threadNum) - obj.MovingSetPos(res, GetPlaceType(obj.Position + res)); + obj.MovingSetPos(res); } else { diff --git a/logic/Gaming/ActionManager.cs b/logic/Gaming/ActionManager.cs index 842e625..2e142e1 100644 --- a/logic/Gaming/ActionManager.cs +++ b/logic/Gaming/ActionManager.cs @@ -267,7 +267,7 @@ namespace Gaming { Prop prop = chestToOpen.PropInChest[i]; chestToOpen.PropInChest[i] = new NullProp(); - prop.ReSetPos(player.Position, gameMap.GetPlaceType(player.Position)); + prop.Position = player.Position; gameMap.Add(prop); } } @@ -295,7 +295,7 @@ namespace Gaming if (characterInWindow != null) { if (player.IsGhost() && !characterInWindow.IsGhost()) - characterManager.BeAttacked((Student)(characterInWindow), player.Attack(characterInWindow.Position, PlaceType.Null)); + characterManager.BeAttacked((Student)(characterInWindow), player.Attack(characterInWindow.Position)); return false; }*/ @@ -323,7 +323,7 @@ namespace Gaming return; } - player.ReSetPos(windowToPlayer + windowForClimb.Position, PlaceType.Window); + player.Position = windowToPlayer + windowForClimb.Position; player.MoveSpeed = player.SpeedOfClimbingThroughWindows; moveEngine.MoveObj(player, (int)(windowToPlayer.Length() * 3.0 * 1000 / player.MoveSpeed), (-1 * windowToPlayer).Angle()); @@ -339,7 +339,7 @@ namespace Gaming ) .Start(); XY PosJumpOff = windowForClimb.Position - 2 * windowToPlayer; - player.ReSetPos(PosJumpOff, gameMap.GetPlaceType(PosJumpOff)); + player.Position = PosJumpOff; player.MoveSpeed = player.ReCalculateBuff(BuffType.AddSpeed, player.OrgMoveSpeed, GameData.MaxSpeed, GameData.MinSpeed); windowForClimb.WhoIsClimbing = null; // gameMap.Remove(addWall); @@ -367,15 +367,15 @@ namespace Gaming switch (prop.GetPropType()) { case PropType.Key3: - if (doorToLock.Place == PlaceType.Door3) + if (doorToLock.DoorNum == 3) flag = true; break; case PropType.Key5: - if (doorToLock.Place == PlaceType.Door5) + if (doorToLock.DoorNum == 5) flag = true; break; case PropType.Key6: - if (doorToLock.Place == PlaceType.Door6) + if (doorToLock.DoorNum == 6) flag = true; break; default: diff --git a/logic/Gaming/AttackManager.cs b/logic/Gaming/AttackManager.cs index 9b9fc1e..69203b1 100644 --- a/logic/Gaming/AttackManager.cs +++ b/logic/Gaming/AttackManager.cs @@ -178,7 +178,7 @@ namespace Gaming (int)(Math.Abs((player.Radius + BulletFactory.BulletRadius(player.BulletOfPlayer)) * Math.Sin(angle))) * ((Math.Sin(angle) > 0) ? 1 : -1) ); - Bullet? bullet = player.Attack(res, gameMap.GetPlaceType(res)); + Bullet? bullet = player.Attack(res); if (bullet != null) { diff --git a/logic/Gaming/CharacterManager .cs b/logic/Gaming/CharacterManager .cs index 2a12664..92593a4 100644 --- a/logic/Gaming/CharacterManager .cs +++ b/logic/Gaming/CharacterManager .cs @@ -407,7 +407,7 @@ namespace Gaming Prop? prop = player.UseProp(i); if (prop != null) { - prop.ReSetPos(player.Position, gameMap.GetPlaceType(player.Position)); + prop.Position = player.Position; gameMap.Add(prop); } } diff --git a/logic/Gaming/PropManager.cs b/logic/Gaming/PropManager.cs index 6b2ba2b..57b18c9 100644 --- a/logic/Gaming/PropManager.cs +++ b/logic/Gaming/PropManager.cs @@ -124,13 +124,13 @@ namespace Gaming if (prop.GetPropType() == PropType.Null) return; - prop.ReSetPos(player.Position, gameMap.GetPlaceType(player.Position)); + prop.Position = player.Position; gameMap.Add(prop); } - private Prop ProduceOnePropNotKey(Random r, XY Pos) + private static Prop ProduceOnePropNotKey(Random r, XY Pos) { - return PropFactory.GetProp((PropType)r.Next(GameData.numOfTeachingBuilding + 1, GameData.numOfPropSpecies + 1), Pos, gameMap.GetPlaceType(Pos)); + return PropFactory.GetProp((PropType)r.Next(GameData.numOfTeachingBuilding + 1, GameData.numOfPropSpecies + 1), Pos); } private Chest GetChest(Random r) @@ -153,7 +153,7 @@ namespace Gaming { ++cou; Chest chest = GetChest(r); - chest.PropInChest[1] = new Key3(chest.Position, PlaceType.Chest); + chest.PropInChest[1] = new Key3(chest.Position); chest.PropInChest[0] = ProduceOnePropNotKey(r, chest.Position); } cou = 0; @@ -161,7 +161,7 @@ namespace Gaming { ++cou; Chest chest = GetChest(r); - chest.PropInChest[1] = new Key5(chest.Position, PlaceType.Chest); + chest.PropInChest[1] = new Key5(chest.Position); chest.PropInChest[0] = ProduceOnePropNotKey(r, chest.Position); } cou = 0; @@ -169,7 +169,7 @@ namespace Gaming { ++cou; Chest chest = GetChest(r); - chest.PropInChest[1] = new Key6(chest.Position, PlaceType.Chest); + chest.PropInChest[1] = new Key6(chest.Position); chest.PropInChest[0] = ProduceOnePropNotKey(r, chest.Position); } diff --git a/logic/Preparation/Interface/IGameObj.cs b/logic/Preparation/Interface/IGameObj.cs index 7990248..58c4141 100644 --- a/logic/Preparation/Interface/IGameObj.cs +++ b/logic/Preparation/Interface/IGameObj.cs @@ -7,7 +7,6 @@ namespace Preparation.Interface public GameObjType Type { get; } public long ID { get; } public XY Position { get; } // if Square, Pos equals the center - public PlaceType Place { get; } public XY FacingDirection { get; } public bool IsRigid { get; } public ShapeType Shape { get; } diff --git a/logic/Preparation/Interface/IMoveable.cs b/logic/Preparation/Interface/IMoveable.cs index a9ee5cb..d9c5e3a 100644 --- a/logic/Preparation/Interface/IMoveable.cs +++ b/logic/Preparation/Interface/IMoveable.cs @@ -9,8 +9,7 @@ namespace Preparation.Interface public int MoveSpeed { get; } public bool IsMoving { get; set; } public bool IsAvailable { get; } - public long MovingSetPos(XY moveVec, PlaceType place); - public void ReSetPos(XY pos, PlaceType place); + public long MovingSetPos(XY moveVec); public bool WillCollideWith(IGameObj? targetObj, XY nextPos) // 检查下一位置是否会和目标物碰撞 { if (targetObj == null) diff --git a/logic/Preparation/Utility/GameData.cs b/logic/Preparation/Utility/GameData.cs index b788f41..72c37b8 100644 --- a/logic/Preparation/Utility/GameData.cs +++ b/logic/Preparation/Utility/GameData.cs @@ -1,6 +1,5 @@ using Preparation.Interface; using System; -using System.Net.NetworkInformation; namespace Preparation.Utility { diff --git a/logic/Server/CopyInfo.cs b/logic/Server/CopyInfo.cs index d6a1423..9b4ff84 100644 --- a/logic/Server/CopyInfo.cs +++ b/logic/Server/CopyInfo.cs @@ -61,7 +61,6 @@ namespace Server Speed = player.MoveSpeed, Determination = player.HP, Addiction = player.GamingAddiction, - Place = Transformation.ToPlaceType((Preparation.Utility.PlaceType)player.Place), Guid = player.ID, PlayerState = Transformation.ToPlayerState((PlayerStateType)player.PlayerState), @@ -108,7 +107,6 @@ namespace Server X = player.Position.x, Y = player.Position.y, Speed = player.MoveSpeed, - Place = Transformation.ToPlaceType((Preparation.Utility.PlaceType)player.Place), TrickerType = Transformation.ToTrickerType(player.CharacterType), Guid = player.ID, @@ -152,7 +150,6 @@ namespace Server FacingDirection = bullet.FacingDirection.Angle(), Guid = bullet.ID, Team = (bullet.Parent!.IsGhost()) ? PlayerType.TrickerPlayer : PlayerType.StudentPlayer, - Place = Transformation.ToPlaceType((Preparation.Utility.PlaceType)bullet.Place), BombRange = bullet.BulletBombRange, Speed = bullet.Speed } @@ -170,8 +167,7 @@ namespace Server X = prop.Position.x, Y = prop.Position.y, FacingDirection = prop.FacingDirection.Angle(), - Guid = prop.ID, - Place = Transformation.ToPlaceType((Preparation.Utility.PlaceType)prop.Place) + Guid = prop.ID } }; return msg; diff --git a/logic/cmd/gameServerAndClient.cmd b/logic/cmd/gameServerAndClient.cmd index 125b391..71f90c7 100644 --- a/logic/cmd/gameServerAndClient.cmd +++ b/logic/cmd/gameServerAndClient.cmd @@ -1,6 +1,6 @@ @echo off -start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --ip 0.0.0.0 --port 8888 --studentCount 0 --trickerCount 1 --gameTimeInSecond 600 --fileName test +start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --ip 0.0.0.0 --port 8888 --studentCount 4 --trickerCount 1 --gameTimeInSecond 600 --fileName test ping -n 2 127.0.0.1 > NUL