From 25925cdb6a6ea1a3fdff6cea958ea433ebf8cadd Mon Sep 17 00:00:00 2001 From: DragonAura Date: Sat, 15 Apr 2023 19:42:59 +0800 Subject: [PATCH] feat: :sparkles: add sunshine --- CAPI/cpp/API/include/structures.h | 2 ++ CAPI/cpp/API/include/utils.hpp | 2 ++ CAPI/cpp/proto/MessageType.pb.cc | 16 +++++++++------- CAPI/cpp/proto/MessageType.pb.h | 3 ++- CAPI/python/PyAPI/structures.py | 1 + CAPI/python/PyAPI/utils.py | 6 ++++-- CAPI/python/generate_proto.sh | 2 -- 7 files changed, 20 insertions(+), 12 deletions(-) diff --git a/CAPI/cpp/API/include/structures.h b/CAPI/cpp/API/include/structures.h index 88fd26c..613e04e 100644 --- a/CAPI/cpp/API/include/structures.h +++ b/CAPI/cpp/API/include/structures.h @@ -85,6 +85,7 @@ namespace THUAI6 StraightAStudent = 3, Robot = 4, TechOtaku = 5, + Sunshine = 6, }; // 捣蛋鬼类型 @@ -285,6 +286,7 @@ namespace THUAI6 {StudentType::StraightAStudent, "StraightAStudent"}, {StudentType::Robot, "Robot"}, {StudentType::TechOtaku, "TechOtaku"}, + {StudentType::Sunshine, "Sunshine"}, }; inline std::map trickerTypeDict{ diff --git a/CAPI/cpp/API/include/utils.hpp b/CAPI/cpp/API/include/utils.hpp index dd550c7..3472cf6 100644 --- a/CAPI/cpp/API/include/utils.hpp +++ b/CAPI/cpp/API/include/utils.hpp @@ -112,6 +112,7 @@ namespace Proto2THUAI6 {protobuf::StudentType::STRAIGHT_A_STUDENT, THUAI6::StudentType::StraightAStudent}, {protobuf::StudentType::ROBOT, THUAI6::StudentType::Robot}, {protobuf::StudentType::TECH_OTAKU, THUAI6::StudentType::TechOtaku}, + {protobuf::StudentType::SUNSHINE, THUAI6::StudentType::Sunshine}, }; inline std::map trickerTypeDict{ @@ -370,6 +371,7 @@ namespace THUAI62Proto {THUAI6::StudentType::StraightAStudent, protobuf::StudentType::STRAIGHT_A_STUDENT}, {THUAI6::StudentType::Robot, protobuf::StudentType::ROBOT}, {THUAI6::StudentType::TechOtaku, protobuf::StudentType::TECH_OTAKU}, + {THUAI6::StudentType::Sunshine, protobuf::StudentType::SUNSHINE}, }; // inline std::map studentBuffTypeDict{ diff --git a/CAPI/cpp/proto/MessageType.pb.cc b/CAPI/cpp/proto/MessageType.pb.cc index 83acf36..d00f04c 100644 --- a/CAPI/cpp/proto/MessageType.pb.cc +++ b/CAPI/cpp/proto/MessageType.pb.cc @@ -59,19 +59,20 @@ const char descriptor_table_protodef_MessageType_2eproto[] PROTOBUF_SECTION_VARI "SPEAR\020\002\022\n\n\006ADD_AP\020\003\022\021\n\rCLAIRAUDIENCE\020\004\022\025" "\n\021TRICKER_INVISIBLE\020\005*J\n\nPlayerType\022\024\n\020N" "ULL_PLAYER_TYPE\020\000\022\022\n\016STUDENT_PLAYER\020\001\022\022\n" - "\016TRICKER_PLAYER\020\002*q\n\013StudentType\022\025\n\021NULL" + "\016TRICKER_PLAYER\020\002*\177\n\013StudentType\022\025\n\021NULL" "_STUDENT_TYPE\020\000\022\013\n\007ATHLETE\020\001\022\013\n\007TEACHER\020" "\002\022\026\n\022STRAIGHT_A_STUDENT\020\003\022\t\n\005ROBOT\020\004\022\016\n\n" - "TECH_OTAKU\020\005*Z\n\013TrickerType\022\025\n\021NULL_TRIC" - "KER_TYPE\020\000\022\014\n\010ASSASSIN\020\001\022\010\n\004KLEE\020\002\022\022\n\016A_" - "NOISY_PERSON\020\003\022\010\n\004IDOL\020\004*P\n\tGameState\022\023\n" - "\017NULL_GAME_STATE\020\000\022\016\n\nGAME_START\020\001\022\020\n\014GA" - "ME_RUNNING\020\002\022\014\n\010GAME_END\020\003b\006proto3"; + "TECH_OTAKU\020\005\022\014\n\010SUNSHINE\020\006*Z\n\013TrickerTyp" + "e\022\025\n\021NULL_TRICKER_TYPE\020\000\022\014\n\010ASSASSIN\020\001\022\010" + "\n\004KLEE\020\002\022\022\n\016A_NOISY_PERSON\020\003\022\010\n\004IDOL\020\004*P" + "\n\tGameState\022\023\n\017NULL_GAME_STATE\020\000\022\016\n\nGAME" + "_START\020\001\022\020\n\014GAME_RUNNING\020\002\022\014\n\010GAME_END\020\003" + "b\006proto3"; static ::_pbi::once_flag descriptor_table_MessageType_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_MessageType_2eproto = { false, false, - 1474, + 1488, descriptor_table_protodef_MessageType_2eproto, "MessageType.proto", &descriptor_table_MessageType_2eproto_once, @@ -292,6 +293,7 @@ namespace protobuf case 3: case 4: case 5: + case 6: return true; default: return false; diff --git a/CAPI/cpp/proto/MessageType.pb.h b/CAPI/cpp/proto/MessageType.pb.h index 1de7f3b..b4b70cf 100644 --- a/CAPI/cpp/proto/MessageType.pb.h +++ b/CAPI/cpp/proto/MessageType.pb.h @@ -337,12 +337,13 @@ namespace protobuf STRAIGHT_A_STUDENT = 3, ROBOT = 4, TECH_OTAKU = 5, + SUNSHINE = 6, StudentType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), StudentType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() }; bool StudentType_IsValid(int value); constexpr StudentType StudentType_MIN = NULL_STUDENT_TYPE; - constexpr StudentType StudentType_MAX = TECH_OTAKU; + constexpr StudentType StudentType_MAX = SUNSHINE; constexpr int StudentType_ARRAYSIZE = StudentType_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* StudentType_descriptor(); diff --git a/CAPI/python/PyAPI/structures.py b/CAPI/python/PyAPI/structures.py index dbd83fe..012f7ab 100644 --- a/CAPI/python/PyAPI/structures.py +++ b/CAPI/python/PyAPI/structures.py @@ -70,6 +70,7 @@ class StudentType(Enum): StraightAStudent = 3 Robot = 4 TechOtaku = 5 + Sunshine = 6 class TrickerType(Enum): diff --git a/CAPI/python/PyAPI/utils.py b/CAPI/python/PyAPI/utils.py index c1e31e2..2e1c181 100644 --- a/CAPI/python/PyAPI/utils.py +++ b/CAPI/python/PyAPI/utils.py @@ -105,7 +105,8 @@ class Proto2THUAI6(NoInstance): MessageType.TEACHER: THUAI6.StudentType.Teacher, MessageType.STRAIGHT_A_STUDENT: THUAI6.StudentType.StraightAStudent, MessageType.ROBOT: THUAI6.StudentType.Robot, - MessageType.TECH_OTAKU: THUAI6.StudentType.TechOtaku, } + MessageType.TECH_OTAKU: THUAI6.StudentType.TechOtaku, + MessageType.SUNSHINE: THUAI6.StudentType.Sunshine, } trickerTypeDict: Final[dict] = { MessageType.NULL_TRICKER_TYPE: THUAI6.TrickerType.NullTrickerType, @@ -309,7 +310,8 @@ class THUAI62Proto(NoInstance): THUAI6.StudentType.Teacher: MessageType.TEACHER, THUAI6.StudentType.StraightAStudent: MessageType.STRAIGHT_A_STUDENT, THUAI6.StudentType.Robot: MessageType.ROBOT, - THUAI6.StudentType.TechOtaku: MessageType.TECH_OTAKU, } + THUAI6.StudentType.TechOtaku: MessageType.TECH_OTAKU, + THUAI6.StudentType.Sunshine: MessageType.SUNSHINE, } trickerTypeDict: Final[dict] = { THUAI6.TrickerType.NullTrickerType: MessageType.NULL_TRICKER_TYPE, diff --git a/CAPI/python/generate_proto.sh b/CAPI/python/generate_proto.sh index 8b917c4..25e4cb7 100755 --- a/CAPI/python/generate_proto.sh +++ b/CAPI/python/generate_proto.sh @@ -8,5 +8,3 @@ python3 -m grpc_tools.protoc -I../../dependency/proto/ --python_out=./proto --py python3 -m grpc_tools.protoc -I../../dependency/proto/ --python_out=./proto --pyi_out=./proto Message2Clients.proto python3 -m grpc_tools.protoc -I../../dependency/proto/ --python_out=./proto --pyi_out=./proto Message2Server.proto python3 -m grpc_tools.protoc -I../../dependency/proto/ --python_out=./proto --pyi_out=./proto --grpc_python_out=./proto Services.proto - -