format: reformat project
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
+26
-26
@@ -1,16 +1,16 @@
|
||||
#ifndef WORLD_WORLD_HPP_
|
||||
#define WORLD_WORLD_HPP_
|
||||
|
||||
#include "../typedefs.hpp"
|
||||
#include "../util/timeutil.hpp"
|
||||
#include "../data/dynamic.hpp"
|
||||
#include "../interfaces/Serializable.hpp"
|
||||
#include "../content/ContentPack.hpp"
|
||||
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <filesystem>
|
||||
|
||||
#include "../content/ContentPack.hpp"
|
||||
#include "../data/dynamic.hpp"
|
||||
#include "../interfaces/Serializable.hpp"
|
||||
#include "../typedefs.hpp"
|
||||
#include "../util/timeutil.hpp"
|
||||
|
||||
class Content;
|
||||
class WorldFiles;
|
||||
@@ -22,7 +22,7 @@ namespace fs = std::filesystem;
|
||||
|
||||
class world_load_error : public std::runtime_error {
|
||||
public:
|
||||
world_load_error(const std::string &message);
|
||||
world_load_error(const std::string& message);
|
||||
};
|
||||
|
||||
/// @brief holds all world data except the level (chunks and objects)
|
||||
@@ -39,27 +39,27 @@ class World : Serializable {
|
||||
public:
|
||||
std::unique_ptr<WorldFiles> wfile;
|
||||
|
||||
/// @brief Day/night loop timer in range 0..1 where
|
||||
/// @brief Day/night loop timer in range 0..1 where
|
||||
/// 0.0 - is midnight and
|
||||
/// 0.5 - is noon
|
||||
float daytime = timeutil::time_value(10, 00, 00);
|
||||
|
||||
// looking bad
|
||||
float daytimeSpeed = 1.0f;
|
||||
|
||||
|
||||
/// @brief total time passed in the world (not depending on daytimeSpeed)
|
||||
double totalTime = 0.0;
|
||||
|
||||
/// @brief will be replaced with weather in future
|
||||
/// @brief will be replaced with weather in future
|
||||
float fog = 0.0f;
|
||||
|
||||
entityid_t nextEntityId = 0;
|
||||
|
||||
World(
|
||||
std::string name,
|
||||
std::string name,
|
||||
std::string generator,
|
||||
const fs::path& directory,
|
||||
uint64_t seed,
|
||||
uint64_t seed,
|
||||
EngineSettings& settings,
|
||||
const Content* content,
|
||||
const std::vector<ContentPack>& packs
|
||||
@@ -70,14 +70,14 @@ public:
|
||||
/// @brief Update world day-time and total time
|
||||
/// @param delta delta-time
|
||||
void updateTimers(float delta);
|
||||
|
||||
|
||||
/// @brief Write all unsaved level data to the world directory
|
||||
void write(Level* level);
|
||||
|
||||
/// @brief Check world indices and generate ContentLUT if convert required
|
||||
/// @brief Check world indices and generate ContentLUT if convert required
|
||||
/// @param directory world directory
|
||||
/// @param content current Content instance
|
||||
/// @return ContentLUT if world convert required else nullptr
|
||||
/// @return ContentLUT if world convert required else nullptr
|
||||
static std::shared_ptr<ContentLUT> checkIndices(
|
||||
const fs::path& directory, const Content* content
|
||||
);
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
/// @param type of the world
|
||||
/// @param seed world generation seed
|
||||
/// @param settings current engine settings
|
||||
/// @param content current engine Content instance
|
||||
/// @param content current engine Content instance
|
||||
/// with all world content-packs applied
|
||||
/// @param packs vector of all world content-packs
|
||||
/// @return Level instance containing World instance
|
||||
@@ -96,16 +96,16 @@ public:
|
||||
const std::string& name,
|
||||
const std::string& generator,
|
||||
const fs::path& directory,
|
||||
uint64_t seed,
|
||||
EngineSettings& settings,
|
||||
uint64_t seed,
|
||||
EngineSettings& settings,
|
||||
const Content* content,
|
||||
const std::vector<ContentPack>& packs
|
||||
);
|
||||
|
||||
/// @brief Load an existing world
|
||||
/// @param directory root world directory
|
||||
/// @param directory root world directory
|
||||
/// @param settings current engine settings
|
||||
/// @param content current engine Content instance
|
||||
/// @param content current engine Content instance
|
||||
/// with all world content-packs applied
|
||||
/// @param packs vector of all world content-packs
|
||||
/// @return Level instance containing World instance
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
void setSeed(uint64_t seed);
|
||||
void setGenerator(const std::string& generator);
|
||||
|
||||
/// @brief Check if world has content-pack installed
|
||||
/// @brief Check if world has content-pack installed
|
||||
/// @param id content-pack id
|
||||
bool hasPack(const std::string& id) const;
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
|
||||
/// @brief Get vector of all content-packs installed in world
|
||||
const std::vector<ContentPack>& getPacks() const;
|
||||
|
||||
|
||||
/// @brief Get next inventory id and increment it's counter
|
||||
/// @return integer >= 1
|
||||
int64_t getNextInventoryId() {
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
}
|
||||
|
||||
std::unique_ptr<dynamic::Map> serialize() const override;
|
||||
void deserialize(dynamic::Map *src) override;
|
||||
void deserialize(dynamic::Map* src) override;
|
||||
};
|
||||
|
||||
#endif // WORLD_WORLD_HPP_
|
||||
#endif // WORLD_WORLD_HPP_
|
||||
|
||||
Reference in New Issue
Block a user