Browse Source

feat(proto): add act_success to move

tags/0.1.0
DragonAura 3 years ago
parent
commit
4f4db6ac36
3 changed files with 80 additions and 14 deletions
  1. +43
    -14
      CAPI/proto/Message2Clients.pb.cc
  2. +36
    -0
      CAPI/proto/Message2Clients.pb.h
  3. +1
    -0
      dependency/proto/Message2Clients.proto

+ 43
- 14
CAPI/proto/Message2Clients.pb.cc View File

@@ -180,7 +180,7 @@ namespace protobuf
::_pbi::ConstantInitialized
) :
_impl_{
/*decltype(_impl_.actual_speed_)*/ int64_t{0}, /*decltype(_impl_.actual_angle_)*/ 0, /*decltype(_impl_._cached_size_)*/ {}}
/*decltype(_impl_.actual_speed_)*/ int64_t{0}, /*decltype(_impl_.actual_angle_)*/ 0, /*decltype(_impl_.act_success_)*/ false, /*decltype(_impl_._cached_size_)*/ {}}
{
}
struct MoveResDefaultTypeInternal
@@ -349,6 +349,7 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::protobuf::MoveRes, _impl_.actual_speed_),
PROTOBUF_FIELD_OFFSET(::protobuf::MoveRes, _impl_.actual_angle_),
PROTOBUF_FIELD_OFFSET(::protobuf::MoveRes, _impl_.act_success_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::protobuf::BoolRes, _internal_metadata_),
~0u, // no _extensions_
@@ -375,8 +376,8 @@ static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protode
{76, -1, -1, sizeof(::protobuf::MessageOfMap)},
{83, -1, -1, sizeof(::protobuf::MessageToClient)},
{93, -1, -1, sizeof(::protobuf::MoveRes)},
{101, -1, -1, sizeof(::protobuf::BoolRes)},
{108, -1, -1, sizeof(::protobuf::MsgRes)},
{102, -1, -1, sizeof(::protobuf::BoolRes)},
{109, -1, -1, sizeof(::protobuf::MsgRes)},
};

static const ::_pb::Message* const file_default_instances[] = {
@@ -429,11 +430,12 @@ const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_
"ge\030\002 \003(\0132\032.protobuf.MessageOfButcher\022-\n\014"
"prop_message\030\003 \003(\0132\027.protobuf.MessageOfP"
"rop\022+\n\013map_message\030\004 \001(\0132\026.protobuf.Mess"
"ageOfMap\"5\n\007MoveRes\022\024\n\014actual_speed\030\001 \001("
"\003\022\024\n\014actual_angle\030\002 \001(\001\"\036\n\007BoolRes\022\023\n\013ac"
"t_success\030\001 \001(\010\"P\n\006MsgRes\022\024\n\014have_messag"
"e\030\001 \001(\010\022\026\n\016from_player_id\030\002 \001(\003\022\030\n\020messa"
"ge_received\030\003 \001(\tb\006proto3";
"ageOfMap\"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(\010\"P\n\006"
"MsgRes\022\024\n\014have_message\030\001 \001(\010\022\026\n\016from_pla"
"yer_id\030\002 \001(\003\022\030\n\020message_received\030\003 \001(\tb\006"
"proto3";
static const ::_pbi::DescriptorTable* const descriptor_table_Message2Clients_2eproto_deps[1] = {
&::descriptor_table_MessageType_2eproto,
};
@@ -441,7 +443,7 @@ static ::_pbi::once_flag descriptor_table_Message2Clients_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_Message2Clients_2eproto = {
false,
false,
1625,
1646,
descriptor_table_protodef_Message2Clients_2eproto,
"Message2Clients.proto",
&descriptor_table_Message2Clients_2eproto_once,
@@ -3410,10 +3412,10 @@ namespace protobuf
MoveRes* const _this = this;
(void)_this;
new (&_impl_) Impl_{
decltype(_impl_.actual_speed_){}, decltype(_impl_.actual_angle_){}, /*decltype(_impl_._cached_size_)*/ {}};
decltype(_impl_.actual_speed_){}, decltype(_impl_.actual_angle_){}, decltype(_impl_.act_success_){}, /*decltype(_impl_._cached_size_)*/ {}};

_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::memcpy(&_impl_.actual_speed_, &from._impl_.actual_speed_, static_cast<size_t>(reinterpret_cast<char*>(&_impl_.actual_angle_) - reinterpret_cast<char*>(&_impl_.actual_speed_)) + sizeof(_impl_.actual_angle_));
::memcpy(&_impl_.actual_speed_, &from._impl_.actual_speed_, static_cast<size_t>(reinterpret_cast<char*>(&_impl_.act_success_) - reinterpret_cast<char*>(&_impl_.actual_speed_)) + sizeof(_impl_.act_success_));
// @@protoc_insertion_point(copy_constructor:protobuf.MoveRes)
}

@@ -3424,7 +3426,7 @@ namespace protobuf
(void)arena;
(void)is_message_owned;
new (&_impl_) Impl_{
decltype(_impl_.actual_speed_){int64_t{0}}, decltype(_impl_.actual_angle_){0}, /*decltype(_impl_._cached_size_)*/ {}};
decltype(_impl_.actual_speed_){int64_t{0}}, decltype(_impl_.actual_angle_){0}, decltype(_impl_.act_success_){false}, /*decltype(_impl_._cached_size_)*/ {}};
}

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

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

@@ -3490,6 +3492,16 @@ namespace protobuf
else
goto handle_unusual;
continue;
// bool act_success = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24))
{
_impl_.act_success_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
}
else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
@@ -3542,6 +3554,13 @@ namespace protobuf
target = ::_pbi::WireFormatLite::WriteDoubleToArray(2, this->_internal_actual_angle(), target);
}

// bool act_success = 3;
if (this->_internal_act_success() != 0)
{
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_act_success(), target);
}

if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields()))
{
target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
@@ -3577,6 +3596,12 @@ namespace protobuf
total_size += 1 + 8;
}

// bool act_success = 3;
if (this->_internal_act_success() != 0)
{
total_size += 1 + 1;
}

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

@@ -3609,6 +3634,10 @@ namespace protobuf
{
_this->_internal_set_actual_angle(from._internal_actual_angle());
}
if (from._internal_act_success() != 0)
{
_this->_internal_set_act_success(from._internal_act_success());
}
_this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

@@ -3631,7 +3660,7 @@ namespace protobuf
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(MoveRes, _impl_.actual_angle_) + sizeof(MoveRes::_impl_.actual_angle_) - PROTOBUF_FIELD_OFFSET(MoveRes, _impl_.actual_speed_)>(
PROTOBUF_FIELD_OFFSET(MoveRes, _impl_.act_success_) + sizeof(MoveRes::_impl_.act_success_) - PROTOBUF_FIELD_OFFSET(MoveRes, _impl_.actual_speed_)>(
reinterpret_cast<char*>(&_impl_.actual_speed_),
reinterpret_cast<char*>(&other->_impl_.actual_speed_)
);


+ 36
- 0
CAPI/proto/Message2Clients.pb.h View File

@@ -2238,6 +2238,7 @@ namespace protobuf
{
kActualSpeedFieldNumber = 1,
kActualAngleFieldNumber = 2,
kActSuccessFieldNumber = 3,
};
// int64 actual_speed = 1;
void clear_actual_speed();
@@ -2258,6 +2259,16 @@ namespace protobuf
double _internal_actual_angle() const;
void _internal_set_actual_angle(double value);

public:
// bool act_success = 3;
void clear_act_success();
bool act_success() const;
void set_act_success(bool value);

private:
bool _internal_act_success() const;
void _internal_set_act_success(bool value);

public:
// @@protoc_insertion_point(class_scope:protobuf.MoveRes)

@@ -2272,6 +2283,7 @@ namespace protobuf
{
int64_t actual_speed_;
double actual_angle_;
bool act_success_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union
@@ -4284,6 +4296,30 @@ namespace protobuf
// @@protoc_insertion_point(field_set:protobuf.MoveRes.actual_angle)
}

// bool act_success = 3;
inline void MoveRes::clear_act_success()
{
_impl_.act_success_ = false;
}
inline bool MoveRes::_internal_act_success() const
{
return _impl_.act_success_;
}
inline bool MoveRes::act_success() const
{
// @@protoc_insertion_point(field_get:protobuf.MoveRes.act_success)
return _internal_act_success();
}
inline void MoveRes::_internal_set_act_success(bool value)
{
_impl_.act_success_ = value;
}
inline void MoveRes::set_act_success(bool value)
{
_internal_set_act_success(value);
// @@protoc_insertion_point(field_set:protobuf.MoveRes.act_success)
}

// -------------------------------------------------------------------

// BoolRes


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

@@ -86,6 +86,7 @@ message MoveRes // 如果打算设计撞墙保留平行速度分量,且需要
{
int64 actual_speed = 1;
double actual_angle = 2;
bool act_success = 3;
}

message BoolRes // 用于只需要判断执行操作是否成功的行为,如捡起道具、使用道具


Loading…
Cancel
Save