Skip to content
Snippets Groups Projects
Commit 53f37adb authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

type-safe entity classes

parent 1203b30c
No related branches found
No related tags found
No related merge requests found
/*
* This file is part of FGGL.
*
* FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* FGGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with FGGL.
* If not, see <https://www.gnu.org/licenses/>.
*/
//
// Created by webpigeon on 22/06/22.
//
#ifndef FGGL_ECS_TYPES_HPP
#define FGGL_ECS_TYPES_HPP
#include <cstdint>
namespace fggl::ecs {
struct entity {
std::uint32_t id;
};
constexpr const entity NULL_ENTITY = {0};
constexpr const entity MAX_ENTITY = {0xFFFFFFFF};
struct componentID {
std::uint32_t id;
};
constexpr const entity NULL_COMPONENT = {0};
}
#endif //FGGL_ECS_TYPES_HPP
......@@ -37,7 +37,7 @@ namespace fggl::ecs {
}
};
template<class T> IDType TypeIdGenerator<T>::m_count = 0;
template<class T> IDType TypeIdGenerator<T>::m_count = 1;
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment