diff --git a/Bigfoot/Sources/System/Include/System/Time/FlatTime.hpp b/Bigfoot/Sources/System/Include/System/Time/FlatTime.hpp new file mode 100644 index 0000000..0ccd1f0 --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/Time/FlatTime.hpp @@ -0,0 +1,18 @@ +/********************************************************************* + * \file FlatTime.hpp + * + * \author Romain BOULLARD + * \date February 2026 + *********************************************************************/ +#ifndef BIGFOOT_SYSTEM_FLATTIME_HPP +#define BIGFOOT_SYSTEM_FLATTIME_HPP +#include +#include + +namespace flatbuffers +{ +Bigfoot::Flat::Time Pack(const Bigfoot::Time& p_time); +Bigfoot::Time UnPack(const Bigfoot::Flat::Time& p_flatTime); +} // namespace flatbuffers + +#endif diff --git a/Bigfoot/Sources/System/Include/System/Time/Time.fbs b/Bigfoot/Sources/System/Include/System/Time/Time.fbs new file mode 100644 index 0000000..10bb49e --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/Time/Time.fbs @@ -0,0 +1,8 @@ +native_include "System/Time/FlatTime.hpp"; + +namespace Bigfoot.Flat; + +struct Time (native_type: "::Bigfoot::Time") +{ + epoch:ulong; +} \ No newline at end of file diff --git a/Bigfoot/Sources/System/Include/System/Time.hpp b/Bigfoot/Sources/System/Include/System/Time/Time.hpp similarity index 100% rename from Bigfoot/Sources/System/Include/System/Time.hpp rename to Bigfoot/Sources/System/Include/System/Time/Time.hpp diff --git a/Bigfoot/Sources/System/Include/System/Time/Time_generated.hpp b/Bigfoot/Sources/System/Include/System/Time/Time_generated.hpp new file mode 100644 index 0000000..d939ddb --- /dev/null +++ b/Bigfoot/Sources/System/Include/System/Time/Time_generated.hpp @@ -0,0 +1,73 @@ +// automatically generated by the FlatBuffers compiler, do not modify + + +#ifndef FLATBUFFERS_GENERATED_TIME_BIGFOOT_FLAT_H_ +#define FLATBUFFERS_GENERATED_TIME_BIGFOOT_FLAT_H_ + +#include "flatbuffers/flatbuffers.h" + +// Ensure the included flatbuffers.h is the same version as when this file was +// generated, otherwise it may not be compatible. +static_assert(FLATBUFFERS_VERSION_MAJOR == 25 && + FLATBUFFERS_VERSION_MINOR == 12 && + FLATBUFFERS_VERSION_REVISION == 19, + "Non-compatible flatbuffers version included"); + +#include "System/Time/FlatTime.hpp" + +#include "EASTL/unique_ptr.h" +#include "EASTL/string.h" + +namespace Bigfoot { +namespace Flat { + +struct Time; + +inline const ::flatbuffers::TypeTable *TimeTypeTable(); + +FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Time FLATBUFFERS_FINAL_CLASS { + private: + uint64_t epoch_; + + public: + struct Traits; + static const ::flatbuffers::TypeTable *MiniReflectTypeTable() { + return TimeTypeTable(); + } + static FLATBUFFERS_CONSTEXPR_CPP11 const char *GetFullyQualifiedName() { + return "Bigfoot.Flat.Time"; + } + Time() + : epoch_(0) { + } + Time(uint64_t _epoch) + : epoch_(::flatbuffers::EndianScalar(_epoch)) { + } + uint64_t epoch() const { + return ::flatbuffers::EndianScalar(epoch_); + } +}; +FLATBUFFERS_STRUCT_END(Time, 8); + +struct Time::Traits { + using type = Time; +}; + +inline const ::flatbuffers::TypeTable *TimeTypeTable() { + static const ::flatbuffers::TypeCode type_codes[] = { + { ::flatbuffers::ET_ULONG, 0, -1 } + }; + static const int64_t values[] = { 0, 8 }; + static const char * const names[] = { + "epoch" + }; + static const ::flatbuffers::TypeTable tt = { + ::flatbuffers::ST_STRUCT, 1, type_codes, nullptr, nullptr, values, names + }; + return &tt; +} + +} // namespace Flat +} // namespace Bigfoot + +#endif // FLATBUFFERS_GENERATED_TIME_BIGFOOT_FLAT_H_ diff --git a/Bigfoot/Sources/System/Time/FlatTime.cpp b/Bigfoot/Sources/System/Time/FlatTime.cpp new file mode 100644 index 0000000..7b885f2 --- /dev/null +++ b/Bigfoot/Sources/System/Time/FlatTime.cpp @@ -0,0 +1,22 @@ +/********************************************************************* + * \file FlatTime.cpp + * + * \author Romain BOULLARD + * \date February 2026 + *********************************************************************/ +#include + +namespace flatbuffers +{ +Bigfoot::Flat::Time Pack(const Bigfoot::Time& p_time) +{ + return Bigfoot::Flat::Time {p_time.Epoch()}; +} + +/****************************************************************************************/ + +Bigfoot::Time UnPack(const Bigfoot::Flat::Time& p_flatTime) +{ + return Bigfoot::Time {p_flatTime.epoch()}; +} +} // namespace flatbuffers diff --git a/Bigfoot/Sources/System/Time.cpp b/Bigfoot/Sources/System/Time/Time.cpp similarity index 99% rename from Bigfoot/Sources/System/Time.cpp rename to Bigfoot/Sources/System/Time/Time.cpp index 672f027..e71141c 100644 --- a/Bigfoot/Sources/System/Time.cpp +++ b/Bigfoot/Sources/System/Time/Time.cpp @@ -4,7 +4,7 @@ * \author Romain BOULLARD * \date December 2025 *********************************************************************/ -#include +#include #include diff --git a/Bigfoot/Tests/Engine/BigFile/BigFile.cpp b/Bigfoot/Tests/Engine/BigFile/BigFile.cpp index 1db95e2..be49e50 100644 --- a/Bigfoot/Tests/Engine/BigFile/BigFile.cpp +++ b/Bigfoot/Tests/Engine/BigFile/BigFile.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include diff --git a/Bigfoot/Tests/System/Time.cpp b/Bigfoot/Tests/System/Time/Time.cpp similarity index 98% rename from Bigfoot/Tests/System/Time.cpp rename to Bigfoot/Tests/System/Time/Time.cpp index 6a9b602..522a527 100644 --- a/Bigfoot/Tests/System/Time.cpp +++ b/Bigfoot/Tests/System/Time/Time.cpp @@ -4,7 +4,7 @@ * \author Romain BOULLARD * \date December 2025 *********************************************************************/ -#include +#include #include