Browse Source

feat: add sunshine

tags/0.1.0
DragonAura 3 years ago
parent
commit
25925cdb6a
7 changed files with 20 additions and 12 deletions
  1. +2
    -0
      CAPI/cpp/API/include/structures.h
  2. +2
    -0
      CAPI/cpp/API/include/utils.hpp
  3. +9
    -7
      CAPI/cpp/proto/MessageType.pb.cc
  4. +2
    -1
      CAPI/cpp/proto/MessageType.pb.h
  5. +1
    -0
      CAPI/python/PyAPI/structures.py
  6. +4
    -2
      CAPI/python/PyAPI/utils.py
  7. +0
    -2
      CAPI/python/generate_proto.sh

+ 2
- 0
CAPI/cpp/API/include/structures.h View File

@@ -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<TrickerType, std::string> trickerTypeDict{


+ 2
- 0
CAPI/cpp/API/include/utils.hpp View File

@@ -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<protobuf::TrickerType, THUAI6::TrickerType> 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<THUAI6::StudentBuffType, protobuf::StudentBuffType> studentBuffTypeDict{


+ 9
- 7
CAPI/cpp/proto/MessageType.pb.cc View File

@@ -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;


+ 2
- 1
CAPI/cpp/proto/MessageType.pb.h View File

@@ -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<int32_t>::min(),
StudentType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<int32_t>::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();


+ 1
- 0
CAPI/python/PyAPI/structures.py View File

@@ -70,6 +70,7 @@ class StudentType(Enum):
StraightAStudent = 3
Robot = 4
TechOtaku = 5
Sunshine = 6


class TrickerType(Enum):


+ 4
- 2
CAPI/python/PyAPI/utils.py View File

@@ -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,


+ 0
- 2
CAPI/python/generate_proto.sh View File

@@ -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



Loading…
Cancel
Save