This commit is contained in:
2026-03-08 01:14:55 +02:00
parent 04e70a9e93
commit f9149b3a13

View File

@@ -4,17 +4,18 @@
#include <Tourmaline/Systems/Logging.hpp>
#include <Tourmaline/Systems/Random.hpp>
#include <Tourmaline/Types.hpp>
#include <print>
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::Position>(player);
std::print("Entity {}, x = {}, y = {}, z = {}\n", player.asString(),
coordinates.x, coordinates.y, coordinates.z);
auto &coordinates = game.GetComponent<Components::Base>(player);
/*
for (int x = 0; x < 100000; x++) {
@@ -24,10 +25,11 @@ int main() {
*/
coordinates.x += 4;
coordinates.y -= 2.5;
coordinates.z = -10;
Logging::LogFormatted("x = {}", "test", Logging::LogLevel::Info,
coordinates.x);
// This should fail
auto &testComp = game.GetComponent<test>(player);
std::print("Entity {}, x = {}, y = {}, z = {}\n", player.asString(),
coordinates.x, coordinates.y, coordinates.z);
return 0;
}