| @@ -197,7 +197,7 @@ namespace THUAI6 | |||
| PlayerType playerType; // 玩家类型 | |||
| std::vector<PropType> 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; // 朝向 | |||
| }; | |||
| @@ -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; | |||
| @@ -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) + ", "; | |||
| @@ -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<spdlog::sinks::basic_file_sink_mt>("logs/logic-log.txt", true); | |||
| auto fileLogger = std::make_shared<spdlog::sinks::basic_file_sink_mt>(fmt::format("logs/logic-{}-log.txt", playerID), true); | |||
| auto printLogger = std::make_shared<spdlog::sinks::stdout_color_sink_mt>(); | |||
| std::string pattern = "[logic] [%H:%M:%S.%e] [%l] %v"; | |||
| fileLogger->set_pattern(pattern); | |||
| @@ -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 | |||
| @@ -25,8 +25,6 @@ | |||
| #include <grpcpp/impl/codegen/stub_options.h> | |||
| #include <grpcpp/impl/codegen/sync_stream.h> | |||
| #undef SendMessage | |||
| namespace protobuf | |||
| { | |||
| @@ -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 = "" | |||
| @@ -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 | |||
| @@ -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 | |||
| @@ -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& | |||
| @@ -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; | |||
| } | |||