You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.7 KiB
C++
75 lines
1.7 KiB
C++
/******************************************************************************
|
|
* File - world.h
|
|
* Author - Joey Pollack
|
|
* Date - 2022/06/28 (y/m/d)
|
|
* Mod Date - 2022/06/28 (y/m/d)
|
|
* Description - Editor asset for a World object
|
|
******************************************************************************/
|
|
|
|
#include "world.h"
|
|
#include <LunariumConfig.h>
|
|
|
|
#include <world/world.h>
|
|
|
|
namespace lunarium { namespace editor
|
|
{
|
|
World::World(std::filesystem::path name)
|
|
: EditorAsset(AssetType::EATYPE_WORLD), mpWorld(new lunarium::World)
|
|
{
|
|
mLocation = name;
|
|
}
|
|
|
|
World::~World()
|
|
{
|
|
delete mpWorld;
|
|
}
|
|
|
|
lunarium::World* World::GetWorld()
|
|
{
|
|
return mpWorld;
|
|
}
|
|
|
|
OpRes World::LoadRawFile()
|
|
{
|
|
return OpRes::OK();
|
|
}
|
|
|
|
OpRes World::Deserialize(nlohmann::json& node)
|
|
{
|
|
// TODO: Implement World::LoadFromJSON
|
|
// Create the lunarium::World Object here
|
|
// Replace the one created in the constructor
|
|
#if !BUILD_NO_EDITOR // Only does this when this is an editor build
|
|
|
|
#endif
|
|
return OpRes::OK();
|
|
}
|
|
|
|
OpRes World::Serialize(nlohmann::json& node)
|
|
{
|
|
// TODO: Implement World::SaveToJSON
|
|
// Store the entities UUID - the Entity class will serialize itself
|
|
#if !BUILD_NO_EDITOR // Only does this when this is an editor build
|
|
|
|
#endif
|
|
return OpRes::OK();
|
|
}
|
|
|
|
|
|
bool World::IsValidNode(nlohmann::json& node)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
nlohmann::json World::AsJSON()
|
|
{
|
|
#if !BUILD_NO_EDITOR // Only does this when this is an editor build
|
|
nlohmann::json node;
|
|
|
|
return node;
|
|
#endif
|
|
|
|
return nlohmann::json();
|
|
}
|
|
|
|
}} |