27 std::ostringstream
ss;
28 ss << std::fixed << std::setprecision(6);
30 ss <<
" \"uid\": " <<
GetUID() <<
",\n";
32 ss <<
" \"className\": \"GameObject\",\n";
33 ss <<
" \"entityType\": " <<
static_cast<int>(
GetEntityType()) <<
",\n";
35 ss <<
" \"width\": " <<
width <<
",\n";
36 ss <<
" \"height\": " <<
height <<
",\n";
37 ss <<
" \"isDynamic\": " << (
isDynamic ?
"true" :
"false") <<
"\n";
49 size_t pos =
json.find(
"\"position\"");
50 if (
pos != std::string::npos)
53 if (
brace != std::string::npos)
56 if (
endb != std::string::npos)
ComponentTypeID GetComponentTypeID_Static()
static bool FactoryRegistered
bool Load(const std::string &json)
virtual void OnEvent(const Message &msg) override
virtual EntityType GetEntityType() const
bool Register(const std::string &className, CreatorFunction creator)
Enregistre une fonction de cr�ation pour un nom de classe donn�.
static ObjectFactory & Get()
static std::string escape_json_string(const std::string &s)
static bool extract_json_double(const std::string &json, const std::string &key, double &out)
static bool extract_json_bool(const std::string &json, const std::string &key, bool &out)
static bool extract_json_int(const std::string &json, const std::string &key, int &out)
static bool extract_json_string(const std::string &json, const std::string &key, std::string &out)