Browse Source

feat(proto): 🎨 change type of team

tags/0.1.0
DragonAura 2 years ago
parent
commit
c5651600cd
3 changed files with 110 additions and 106 deletions
  1. +68
    -64
      CAPI/proto/Message2Clients.pb.cc
  2. +41
    -41
      CAPI/proto/Message2Clients.pb.h
  3. +1
    -1
      dependency/proto/Message2Clients.proto

+ 68
- 64
CAPI/proto/Message2Clients.pb.cc View File

@@ -70,7 +70,7 @@ namespace protobuf
::_pbi::ConstantInitialized
) :
_impl_{
/*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_.place_)*/ 0, /*decltype(_impl_.parent_team_id_)*/ int64_t{0}, /*decltype(_impl_.bomb_range_)*/ 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_.place_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}}
{
}
struct MessageOfBulletDefaultTypeInternal
@@ -347,7 +347,7 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V
PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.y_),
PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.facing_direction_),
PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.guid_),
PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.parent_team_id_),
PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.team_),
PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.place_),
PROTOBUF_FIELD_OFFSET(::protobuf::MessageOfBullet, _impl_.bomb_range_),
~0u, // no _has_bits_
@@ -492,40 +492,40 @@ const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_
"ickerType\022\014\n\004guid\030\t \001(\003\022\017\n\007movable\030\n \001(\010"
"\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\004buff\030\016 \003(\0162\031.protobuf"
".TrickerBuffType\"\303\001\n\017MessageOfBullet\022\"\n\004"
".TrickerBuffType\"\317\001\n\017MessageOfBullet\022\"\n\004"
"type\030\001 \001(\0162\024.protobuf.BulletType\022\t\n\001x\030\002 "
"\001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020facing_direction\030\004 \001(\001"
"\022\014\n\004guid\030\005 \001(\003\022\026\n\016parent_team_id\030\006 \001(\003\022\""
"\n\005place\030\007 \001(\0162\023.protobuf.PlaceType\022\022\n\nbo"
"mb_range\030\010 \001(\001\"\223\001\n\025MessageOfBombedBullet"
"\022\"\n\004type\030\001 \001(\0162\024.protobuf.BulletType\022\t\n\001"
"x\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\"\264\001\n\rMessageOfProp\022 \n\004type\030\001 \001(\0162\022.p"
"\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.Pla"
"ceType\022\022\n\nbomb_range\030\010 \001(\001\"\223\001\n\025MessageOf"
"BombedBullet\022\"\n\004type\030\001 \001(\0162\024.protobuf.Bu"
"lletType\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\n"
"bomb_range\030\006 \001(\001\"\264\001\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\022\"\n\005place\030\006 \001(\0162\023.protobuf.Pla"
"ceType\022\014\n\004size\030\007 \001(\005\022\021\n\tis_moving\030\010 \001(\010\""
"{\n\023MessageOfPickedProp\022 \n\004type\030\001 \001(\0162\022.p"
"rotobuf.PropType\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030"
"\n\020facing_direction\030\004 \001(\001\022\014\n\004guid\030\005 \001(\003\022\""
"\n\005place\030\006 \001(\0162\023.protobuf.PlaceType\022\014\n\004si"
"ze\030\007 \001(\005\022\021\n\tis_moving\030\010 \001(\010\"{\n\023MessageOf"
"PickedProp\022 \n\004type\030\001 \001(\0162\022.protobuf.Prop"
"Type\022\t\n\001x\030\002 \001(\005\022\t\n\001y\030\003 \001(\005\022\030\n\020facing_dir"
"ection\030\004 \001(\001\022\022\n\nmapping_id\030\005 \001(\003\"`\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\"\363\002\n\017MessageToClient\0223\n\017studen"
"t_message\030\001 \003(\0132\032.protobuf.MessageOfStud"
"ent\0223\n\017tricker_message\030\002 \003(\0132\032.protobuf."
"MessageOfTricker\022-\n\014prop_message\030\003 \003(\0132\027"
".protobuf.MessageOfProp\0221\n\016bullet_messag"
"e\030\004 \003(\0132\031.protobuf.MessageOfBullet\022>\n\025bo"
"mbed_bullet_message\030\005 \003(\0132\037.protobuf.Mes"
"sageOfBombedBullet\022+\n\013map_message\030\006 \001(\0132"
"\026.protobuf.MessageOfMap\022\'\n\ngame_state\030\007 "
"\001(\0162\023.protobuf.GameState\"J\n\007MoveRes\022\024\n\014a"
"ctual_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_s"
"uccess\030\001 \001(\010\"P\n\006MsgRes\022\024\n\014have_message\030\001"
" \001(\010\022\026\n\016from_player_id\030\002 \001(\003\022\030\n\020message_"
"received\030\003 \001(\tb\006proto3";
"\n\020facing_direction\030\004 \001(\001\022\022\n\nmapping_id\030\005"
" \001(\003\"`\n\014MessageOfMap\022\'\n\003row\030\002 \003(\0132\032.prot"
"obuf.MessageOfMap.Row\032\'\n\003Row\022 \n\003col\030\001 \003("
"\0162\023.protobuf.PlaceType\"\363\002\n\017MessageToClie"
"nt\0223\n\017student_message\030\001 \003(\0132\032.protobuf.M"
"essageOfStudent\0223\n\017tricker_message\030\002 \003(\013"
"2\032.protobuf.MessageOfTricker\022-\n\014prop_mes"
"sage\030\003 \003(\0132\027.protobuf.MessageOfProp\0221\n\016b"
"ullet_message\030\004 \003(\0132\031.protobuf.MessageOf"
"Bullet\022>\n\025bombed_bullet_message\030\005 \003(\0132\037."
"protobuf.MessageOfBombedBullet\022+\n\013map_me"
"ssage\030\006 \001(\0132\026.protobuf.MessageOfMap\022\'\n\ng"
"ame_state\030\007 \001(\0162\023.protobuf.GameState\"J\n\007"
"MoveRes\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\007Bool"
"Res\022\023\n\013act_success\030\001 \001(\010\"P\n\006MsgRes\022\024\n\014ha"
"ve_message\030\001 \001(\010\022\026\n\016from_player_id\030\002 \001(\003"
"\022\030\n\020message_received\030\003 \001(\tb\006proto3";
static const ::_pbi::DescriptorTable* const descriptor_table_Message2Clients_2eproto_deps[1] = {
&::descriptor_table_MessageType_2eproto,
};
@@ -533,7 +533,7 @@ static ::_pbi::once_flag descriptor_table_Message2Clients_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_Message2Clients_2eproto = {
false,
false,
2182,
2194,
descriptor_table_protodef_Message2Clients_2eproto,
"Message2Clients.proto",
&descriptor_table_Message2Clients_2eproto_once,
@@ -1947,10 +1947,10 @@ namespace protobuf
MessageOfBullet* const _this = this;
(void)_this;
new (&_impl_) Impl_{
decltype(_impl_.type_){}, decltype(_impl_.x_){}, decltype(_impl_.facing_direction_){}, decltype(_impl_.guid_){}, decltype(_impl_.y_){}, decltype(_impl_.place_){}, decltype(_impl_.parent_team_id_){}, decltype(_impl_.bomb_range_){}, /*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_.place_){}, /*decltype(_impl_._cached_size_)*/ {}};

_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::memcpy(&_impl_.type_, &from._impl_.type_, static_cast<size_t>(reinterpret_cast<char*>(&_impl_.bomb_range_) - reinterpret_cast<char*>(&_impl_.type_)) + sizeof(_impl_.bomb_range_));
::memcpy(&_impl_.type_, &from._impl_.type_, static_cast<size_t>(reinterpret_cast<char*>(&_impl_.place_) - reinterpret_cast<char*>(&_impl_.type_)) + sizeof(_impl_.place_));
// @@protoc_insertion_point(copy_constructor:protobuf.MessageOfBullet)
}

@@ -1961,7 +1961,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_.guid_){int64_t{0}}, decltype(_impl_.y_){0}, decltype(_impl_.place_){0}, decltype(_impl_.parent_team_id_){int64_t{0}}, decltype(_impl_.bomb_range_){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_.place_){0}, /*decltype(_impl_._cached_size_)*/ {}};
}

MessageOfBullet::~MessageOfBullet()
@@ -1992,7 +1992,7 @@ namespace protobuf
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;

::memset(&_impl_.type_, 0, static_cast<size_t>(reinterpret_cast<char*>(&_impl_.bomb_range_) - reinterpret_cast<char*>(&_impl_.type_)) + sizeof(_impl_.bomb_range_));
::memset(&_impl_.type_, 0, static_cast<size_t>(reinterpret_cast<char*>(&_impl_.place_) - reinterpret_cast<char*>(&_impl_.type_)) + sizeof(_impl_.place_));
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

@@ -2058,12 +2058,13 @@ namespace protobuf
else
goto handle_unusual;
continue;
// int64 parent_team_id = 6;
// .protobuf.PlayerType team = 6;
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48))
{
_impl_.parent_team_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
_internal_set_team(static_cast<::protobuf::PlayerType>(val));
}
else
goto handle_unusual;
@@ -2164,11 +2165,13 @@ namespace protobuf
target = ::_pbi::WireFormatLite::WriteInt64ToArray(5, this->_internal_guid(), target);
}

// int64 parent_team_id = 6;
if (this->_internal_parent_team_id() != 0)
// .protobuf.PlayerType team = 6;
if (this->_internal_team() != 0)
{
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteInt64ToArray(6, this->_internal_parent_team_id(), target);
target = ::_pbi::WireFormatLite::WriteEnumToArray(
6, this->_internal_team(), target
);
}

// .protobuf.PlaceType place = 7;
@@ -2233,29 +2236,23 @@ namespace protobuf
total_size += 1 + 8;
}

// 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());
}

// .protobuf.PlaceType place = 7;
if (this->_internal_place() != 0)
// .protobuf.PlayerType team = 6;
if (this->_internal_team() != 0)
{
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_place());
::_pbi::WireFormatLite::EnumSize(this->_internal_team());
}

// int64 parent_team_id = 6;
if (this->_internal_parent_team_id() != 0)
// int64 guid = 5;
if (this->_internal_guid() != 0)
{
total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_parent_team_id());
total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_guid());
}

// double bomb_range = 8;
@@ -2268,6 +2265,13 @@ namespace protobuf
total_size += 1 + 8;
}

// .protobuf.PlaceType place = 7;
if (this->_internal_place() != 0)
{
total_size += 1 +
::_pbi::WireFormatLite::EnumSize(this->_internal_place());
}

return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

@@ -2304,21 +2308,17 @@ namespace protobuf
{
_this->_internal_set_facing_direction(from._internal_facing_direction());
}
if (from._internal_guid() != 0)
{
_this->_internal_set_guid(from._internal_guid());
}
if (from._internal_y() != 0)
{
_this->_internal_set_y(from._internal_y());
}
if (from._internal_place() != 0)
if (from._internal_team() != 0)
{
_this->_internal_set_place(from._internal_place());
_this->_internal_set_team(from._internal_team());
}
if (from._internal_parent_team_id() != 0)
if (from._internal_guid() != 0)
{
_this->_internal_set_parent_team_id(from._internal_parent_team_id());
_this->_internal_set_guid(from._internal_guid());
}
static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size.");
double tmp_bomb_range = from._internal_bomb_range();
@@ -2328,6 +2328,10 @@ namespace protobuf
{
_this->_internal_set_bomb_range(from._internal_bomb_range());
}
if (from._internal_place() != 0)
{
_this->_internal_set_place(from._internal_place());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

@@ -2350,7 +2354,7 @@ namespace protobuf
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(MessageOfBullet, _impl_.bomb_range_) + sizeof(MessageOfBullet::_impl_.bomb_range_) - PROTOBUF_FIELD_OFFSET(MessageOfBullet, _impl_.type_)>(
PROTOBUF_FIELD_OFFSET(MessageOfBullet, _impl_.place_) + sizeof(MessageOfBullet::_impl_.place_) - PROTOBUF_FIELD_OFFSET(MessageOfBullet, _impl_.type_)>(
reinterpret_cast<char*>(&_impl_.type_),
reinterpret_cast<char*>(&other->_impl_.type_)
);


+ 41
- 41
CAPI/proto/Message2Clients.pb.h View File

@@ -1046,11 +1046,11 @@ namespace protobuf
kTypeFieldNumber = 1,
kXFieldNumber = 2,
kFacingDirectionFieldNumber = 4,
kGuidFieldNumber = 5,
kYFieldNumber = 3,
kPlaceFieldNumber = 7,
kParentTeamIdFieldNumber = 6,
kTeamFieldNumber = 6,
kGuidFieldNumber = 5,
kBombRangeFieldNumber = 8,
kPlaceFieldNumber = 7,
};
// .protobuf.BulletType type = 1;
void clear_type();
@@ -1081,16 +1081,6 @@ namespace protobuf
double _internal_facing_direction() const;
void _internal_set_facing_direction(double value);

public:
// int64 guid = 5;
void clear_guid();
int64_t guid() const;
void set_guid(int64_t value);

private:
int64_t _internal_guid() const;
void _internal_set_guid(int64_t value);

public:
// int32 y = 3;
void clear_y();
@@ -1102,24 +1092,24 @@ namespace protobuf
void _internal_set_y(int32_t value);

public:
// .protobuf.PlaceType place = 7;
void clear_place();
::protobuf::PlaceType place() const;
void set_place(::protobuf::PlaceType value);
// .protobuf.PlayerType team = 6;
void clear_team();
::protobuf::PlayerType team() const;
void set_team(::protobuf::PlayerType value);

private:
::protobuf::PlaceType _internal_place() const;
void _internal_set_place(::protobuf::PlaceType value);
::protobuf::PlayerType _internal_team() const;
void _internal_set_team(::protobuf::PlayerType value);

public:
// int64 parent_team_id = 6;
void clear_parent_team_id();
int64_t parent_team_id() const;
void set_parent_team_id(int64_t value);
// int64 guid = 5;
void clear_guid();
int64_t guid() const;
void set_guid(int64_t value);

private:
int64_t _internal_parent_team_id() const;
void _internal_set_parent_team_id(int64_t value);
int64_t _internal_guid() const;
void _internal_set_guid(int64_t value);

public:
// double bomb_range = 8;
@@ -1131,6 +1121,16 @@ 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:
// @@protoc_insertion_point(class_scope:protobuf.MessageOfBullet)

@@ -1146,11 +1146,11 @@ namespace protobuf
int type_;
int32_t x_;
double facing_direction_;
int64_t guid_;
int32_t y_;
int place_;
int64_t parent_team_id_;
int team_;
int64_t guid_;
double bomb_range_;
int place_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union
@@ -4269,28 +4269,28 @@ namespace protobuf
// @@protoc_insertion_point(field_set:protobuf.MessageOfBullet.guid)
}

// int64 parent_team_id = 6;
inline void MessageOfBullet::clear_parent_team_id()
// .protobuf.PlayerType team = 6;
inline void MessageOfBullet::clear_team()
{
_impl_.parent_team_id_ = int64_t{0};
_impl_.team_ = 0;
}
inline int64_t MessageOfBullet::_internal_parent_team_id() const
inline ::protobuf::PlayerType MessageOfBullet::_internal_team() const
{
return _impl_.parent_team_id_;
return static_cast<::protobuf::PlayerType>(_impl_.team_);
}
inline int64_t MessageOfBullet::parent_team_id() const
inline ::protobuf::PlayerType MessageOfBullet::team() const
{
// @@protoc_insertion_point(field_get:protobuf.MessageOfBullet.parent_team_id)
return _internal_parent_team_id();
// @@protoc_insertion_point(field_get:protobuf.MessageOfBullet.team)
return _internal_team();
}
inline void MessageOfBullet::_internal_set_parent_team_id(int64_t value)
inline void MessageOfBullet::_internal_set_team(::protobuf::PlayerType value)
{
_impl_.parent_team_id_ = value;
_impl_.team_ = value;
}
inline void MessageOfBullet::set_parent_team_id(int64_t value)
inline void MessageOfBullet::set_team(::protobuf::PlayerType value)
{
_internal_set_parent_team_id(value);
// @@protoc_insertion_point(field_set:protobuf.MessageOfBullet.parent_team_id)
_internal_set_team(value);
// @@protoc_insertion_point(field_set:protobuf.MessageOfBullet.team)
}

// .protobuf.PlaceType place = 7;


+ 1
- 1
dependency/proto/Message2Clients.proto View File

@@ -51,7 +51,7 @@ message MessageOfBullet
int32 y = 3;
double facing_direction = 4;
int64 guid = 5;
int64 parent_team_id = 6;
PlayerType team = 6;
PlaceType place = 7;
double bomb_range = 8;
}


Loading…
Cancel
Save