#pragma once

#include <cstdint>

inline int32_t SetFlags(int32_t in, int32_t flags)
{
    return in | flags;
}

inline int32_t ClearFlags(int32_t in, int32_t flags)
{
    return in & ~flags;
}

inline int32_t FlagBool(int32_t in, int32_t flags, bool IsSet)
{
    if (IsSet) return SetFlags(in, flags);
    return ClearFlags(in, flags);
}

inline bool GetFlag(int32_t in, int32_t flags)
{
    return (in & flags) > 0;
}

struct SharedData;

namespace Game
{
    struct GameInstance;

    SharedData& GetShared();
    void SetShared(SharedData& instance);
    GameInstance& GetInstance();
    void SetInstance(GameInstance& instance);
    void* AllocateScratch(size_t byteCount, size_t align = 16);
} // namespace Game
