36 lines
852 B
C++
36 lines
852 B
C++
#include <Tourmaline/Containers/DualkeyMap.hpp>
|
|
#include <Tourmaline/Systems/ECS.hpp>
|
|
#include <Tourmaline/Systems/ECS/BuiltinComponents.hpp>
|
|
#include <Tourmaline/Systems/Logging.hpp>
|
|
#include <Tourmaline/Systems/Random.hpp>
|
|
#include <Tourmaline/Types.hpp>
|
|
|
|
using namespace Tourmaline;
|
|
using namespace Systems;
|
|
|
|
struct test : public ECS::Component {
|
|
int x;
|
|
};
|
|
|
|
int main() {
|
|
ECS::World game;
|
|
auto player = game.CreateEntity();
|
|
auto &coordinates = game.GetComponent<Components::Base>(player);
|
|
|
|
/*
|
|
for (int x = 0; x < 100000; x++) {
|
|
// Bad idea, for testing we do need to do this
|
|
game.CreateEntity();
|
|
}
|
|
*/
|
|
|
|
coordinates.x += 4;
|
|
Logging::LogFormatted("x = {}", "test", Logging::LogLevel::Info,
|
|
coordinates.x);
|
|
|
|
// This should fail
|
|
auto &testComp = game.GetComponent<test>(player);
|
|
|
|
return 0;
|
|
}
|