mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 08:47:58 +03:00
Add __tostring metamethod to GameScriptPosition, GameScriptRotation and GameScriptColor.
Make their properties lowercase to keep them consistent with the properties of other classes. Move documentation from GameScriptPosition.h to GameScriptPosition.cpp.
This commit is contained in:
parent
b264099ff1
commit
dbe6ffdd5c
6 changed files with 82 additions and 40 deletions
|
@ -16,16 +16,16 @@ void GameScriptRotation::Register(sol::state* state)
|
|||
sol::constructors<GameScriptRotation(int, int, int)>(),
|
||||
|
||||
/// (int) rotation about x axis
|
||||
//@mem X
|
||||
"X", &GameScriptRotation::x,
|
||||
//@mem x
|
||||
"x", &GameScriptRotation::x,
|
||||
|
||||
/// (int) rotation about x axis
|
||||
//@mem Y
|
||||
"Y", &GameScriptRotation::y,
|
||||
//@mem y
|
||||
"y", &GameScriptRotation::y,
|
||||
|
||||
/// (int) rotation about x axis
|
||||
//@mem Z
|
||||
"Z", &GameScriptRotation::z
|
||||
//@mem z
|
||||
"z", &GameScriptRotation::z
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -56,3 +56,14 @@ GameScriptRotation::GameScriptRotation(PHD_3DPOS const & pos)
|
|||
y = pos.yRot;
|
||||
z = pos.zRot;
|
||||
}
|
||||
|
||||
/***
|
||||
@tparam Rotation rotation this rotation
|
||||
@treturn string A string showing the x, y, and z values of the rotation
|
||||
@function __tostring
|
||||
*/
|
||||
std::string GameScriptRotation::ToString() const
|
||||
{
|
||||
return "{" + std::to_string(x) + ", " + std::to_string(y) + ", " + std::to_string(z) + "}";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue