Monty.Frameworks.Actions.ActionJSONEncoder (ExTbpMonty.Core v0.1.0)

Copy Markdown View Source

An action as the map it crosses a boundary as.

Mirrors tbp/monty/frameworks/actions/actions.py::ActionJSONEncoder, which is a JSONEncoder subclass whose only job is dict(action). The JSON library is not this module's business — Jason.encode!/1 on the map it answers is the same object Monty produces — so what is ported here is the value mapping, not the encoder plumbing.

Summary

Functions

The action as a map: its name under "action", then every parameter.

Functions

encode(action)

@spec encode(Monty.Frameworks.Actions.Action.t()) :: map()

The action as a map: its name under "action", then every parameter.

A tuple is not JSON, and the two pose actions carry their rotation as one {w, x, y, z} — Monty's quaternion crosses its boundary as those four numbers, so they cross this one as a list.