mirror of
https://github.com/EQEmu/Server.git
synced 2026-11-24 05:37:17 +00:00
Added overloads for to_string to handle xyz_heading, xyz_location, and xy_location
This commit is contained in:
1 parent
408fdc7178
commit
f63c5ab6ba
2 files changed
+20
No files matched your search
@@ -1,4 +1,6 @@
|
||||
#include "position.h"
|
||||
#include <string>
|
||||
#include "../common/string_util.h"
|
||||
|
||||
xy_location::xy_location(float x, float y) :
|
||||
m_X(x),
|
||||
@@ -104,3 +106,16 @@ void xyz_location::ABS_XYZ(void) {
|
||||
if (m_Z < 0)
|
||||
m_Z = -m_Z;
|
||||
}
|
||||
|
||||
std::string to_string(const xyz_heading &position) {
|
||||
return StringFormat("(%.3f, %.3f, %.3f, %.3f)", position.m_X,position.m_Y,position.m_Z,position.m_Heading);
|
||||
}
|
||||
|
||||
std::string to_string(const xyz_location &position){
|
||||
return StringFormat("(%.3f, %.3f, %.3f)", position.m_X,position.m_Y,position.m_Z);
|
||||
}
|
||||
|
||||
std::string to_string(const xy_location &position){
|
||||
return StringFormat("(%.3f, %.3f)", position.m_X,position.m_Y);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user