2d-platformer/include/utility.h

57 lines
893 B
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 EntityIndex = u16;
enum EntityTag : u8
{
player,
tile,
enemy,
tagCount
};
namespace util
{
using namespace std::string_view_literals;
inline constexpr EntityIndex MAX_ENTITIES {60'000u};
inline constexpr EntityIndex MAX_TILES {1'000u};
inline constexpr EntityIndex MAX_ENEMIES {1'000u};
// used for imgui
inline constexpr std::array<const char*, tagCount> tagStringsC =
{
"player"
};
inline constexpr std::array<std::string_view, tagCount> tagStrings =
{
"player"sv
};
inline constexpr std::array<EntityIndex, tagCount> tagStart =
{
0,//player
1,//tile start
MAX_TILES,//enemy start
};
}