New animation step constructor

This commit is contained in:
2021-02-25 16:32:48 -05:00
parent 1814f39e1a
commit 9076666b2b
4 changed files with 145 additions and 23 deletions

View File

@@ -47,7 +47,7 @@ private:
int64_t id_;
std::string action_;
int bits_;
float facing_;
util::XYZ xyz_;
std::string graphic_;
@@ -84,13 +84,30 @@ public:
const AnimStep &nth(int n) const { return steps_[n]; }
int size() const { return steps_.size(); }
// Mutators to create new steps.
// Mutators to create new steps from C++
//
void add(int64_t id, const std::string &action);
void set_facing(float f);
void set_xyz(util::XYZ xyz);
void set_graphic(const std::string &g);
void set_plane(const std::string &p);
// Mutator to create new steps from lua.
//
// Lua stack must contain a table, which may contain:
// action: "action"
// facing: 0.0 - 360.0
// x: x-coordinate
// y: y-coordinate
// z: z-coordinate
// dx: delta-x
// dy: delta-y
// dz: delta-z
// graphic: "graphic"
// plane: "plane"
//
void add(int64_t id, lua_State *L, int idx);
// Get the final resting place after all animations are complete.
const std::string &get_graphic() const;
const std::string &get_plane() const;