Init
This commit is contained in:
33
test_getcomponent.cpp
Normal file
33
test_getcomponent.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#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>
|
||||
#include <print>
|
||||
|
||||
using namespace Tourmaline;
|
||||
using namespace Systems;
|
||||
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);
|
||||
|
||||
/*
|
||||
for (int x = 0; x < 100000; x++) {
|
||||
// Bad idea, for testing we do need to do this
|
||||
game.CreateEntity();
|
||||
}
|
||||
*/
|
||||
|
||||
coordinates.x += 4;
|
||||
coordinates.y -= 2.5;
|
||||
coordinates.z = -10;
|
||||
|
||||
std::print("Entity {}, x = {}, y = {}, z = {}\n", player.asString(),
|
||||
coordinates.x, coordinates.y, coordinates.z);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user