mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
fixed pw loyalty in oracle, PB code working
This commit is contained in:
parent
d5c628966f
commit
6344b987de
8 changed files with 67 additions and 51 deletions
13
common/get_pb_extension.cpp
Normal file
13
common/get_pb_extension.cpp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include "get_pb_extension.h"
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/descriptor.h>
|
||||
|
||||
int getPbExtension(const ::google::protobuf::Message &message)
|
||||
{
|
||||
std::vector< const ::google::protobuf::FieldDescriptor * > fieldList;
|
||||
message.GetReflection()->ListFields(message, &fieldList);
|
||||
for (unsigned int j = 0; j < fieldList.size(); ++j)
|
||||
if (fieldList[j]->is_extension())
|
||||
return fieldList[j]->number();
|
||||
return -1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue