Skip to content

Commit

Permalink
Merge pull request #237 from threedworld-mit/magnebot_wheels_success
Browse files Browse the repository at this point in the history
Magnebot wheels success
  • Loading branch information
alters-mit authored Jul 23, 2021
2 parents 59a80be + 502012e commit 7784cdc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/api/output_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ A message sent when a Magnebot arrives at a target.
| Function | Description | Return type |
| --- | --- | --- |
| `get_id()` | The ID of the Magnebot. | `int` |
| `get_success()` | If True, the Magnebot arrived at the target. | `bool` |

## Meshes

Expand Down
10 changes: 9 additions & 1 deletion Python/tdw/FBOutput/MagnebotWheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ def Id(self):
return self._tab.Get(tdw.flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
return 0

def MagnebotWheelsStart(builder): builder.StartObject(1)
# MagnebotWheels
def Success(self):
o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return bool(self._tab.Get(tdw.flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
return False

def MagnebotWheelsStart(builder): builder.StartObject(2)
def MagnebotWheelsAddId(builder, id): builder.PrependInt32Slot(0, id, 0)
def MagnebotWheelsAddSuccess(builder, success): builder.PrependBoolSlot(1, success, 0)
def MagnebotWheelsEnd(builder): return builder.EndObject()
3 changes: 3 additions & 0 deletions Python/tdw/output_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,3 +1054,6 @@ def get_data(self) -> MWheels.MagnebotWheels:

def get_id(self) -> int:
return self.data.Id()

def get_success(self) -> bool:
return self.data.Success()

0 comments on commit 7784cdc

Please sign in to comment.