You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Challenge.py 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # automatically generated by the FlatBuffers compiler, do not modify
  2. # namespace: proto
  3. import flatbuffers
  4. class Challenge(object):
  5. __slots__ = ['_tab']
  6. @classmethod
  7. def GetRootAsChallenge(cls, buf, offset):
  8. n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
  9. x = Challenge()
  10. x.Init(buf, n + offset)
  11. return x
  12. # Challenge
  13. def Init(self, buf, pos):
  14. self._tab = flatbuffers.table.Table(buf, pos)
  15. # Challenge
  16. def Method(self):
  17. o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
  18. if o != 0:
  19. return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
  20. return 0
  21. # Challenge
  22. def Extra(self):
  23. o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
  24. if o != 0:
  25. x = self._tab.Indirect(o + self._tab.Pos)
  26. from .Map import Map
  27. obj = Map()
  28. obj.Init(self._tab.Bytes, x)
  29. return obj
  30. return None
  31. def ChallengeStart(builder): builder.StartObject(2)
  32. def ChallengeAddMethod(builder, method): builder.PrependUint8Slot(0, method, 0)
  33. def ChallengeAddExtra(builder, extra): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(extra), 0)
  34. def ChallengeEnd(builder): return builder.EndObject()