68 lines
1.1 KiB
C++
68 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <string_view>
|
|
|
|
using u8 = uint8_t;
|
|
using u16 = uint16_t;
|
|
using u32 = uint32_t;
|
|
using u64 = uint64_t;
|
|
using s8 = int8_t;
|
|
using s16 = int16_t;
|
|
using s32 = int32_t;
|
|
using s64 = int64_t;
|
|
using tag_type = u8;
|
|
|
|
using EntityIndex = u16;
|
|
|
|
enum class Tag : tag_type
|
|
{
|
|
player,
|
|
tile,
|
|
enemy,
|
|
tagCount
|
|
};
|
|
|
|
namespace util
|
|
{
|
|
using namespace std::string_view_literals;
|
|
|
|
inline constexpr EntityIndex MAX_PLAYERS{1u};
|
|
inline constexpr EntityIndex MAX_TILES {1'000u};
|
|
inline constexpr EntityIndex MAX_ENEMIES {1'000u};
|
|
inline constexpr EntityIndex MAX_ENTITIES {MAX_PLAYERS + MAX_TILES + MAX_ENEMIES};
|
|
inline constexpr tag_type TAG_COUNT {(tag_type)Tag::tagCount};
|
|
|
|
// used for imgui
|
|
inline constexpr char* tagStringsC[TAG_COUNT] =
|
|
{
|
|
"player",
|
|
"tile",
|
|
"enemy",
|
|
};
|
|
|
|
inline constexpr std::string_view tagStrings[TAG_COUNT] =
|
|
{
|
|
"player"sv,
|
|
"tile"sv,
|
|
"enemy"sv,
|
|
};
|
|
|
|
inline constexpr EntityIndex tagStart[TAG_COUNT] =
|
|
{
|
|
0,//player
|
|
1,//tile start
|
|
MAX_TILES,//enemy start
|
|
};
|
|
|
|
inline constexpr EntityIndex tagSize[TAG_COUNT] =
|
|
{
|
|
MAX_PLAYERS,
|
|
MAX_TILES,
|
|
MAX_ENEMIES,
|
|
};
|
|
}
|
|
|
|
|