Removing needless entity pointer storing in BaseComponent

This commit is contained in:
2026-01-28 14:02:28 +02:00
parent 12796fa31b
commit 7000aa712b
2 changed files with 0 additions and 17 deletions

View File

@@ -13,7 +13,6 @@
#include <concepts>
#include <format>
#include <typeindex>
#include <utility>
#include "../Containers/DualkeyMap.hpp"
#include "../Types.hpp"
@@ -26,10 +25,8 @@ class World;
struct BaseComponent {
public:
virtual ~BaseComponent() = default;
const Entity &GetOwner();
private:
const Entity *owner;
friend World;
};

View File

@@ -1,14 +0,0 @@
/*
* SPDX-FileCopyrightText: Dora "cat" <cat@thenight.club>
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <Systems/ECS.hpp>
using namespace Tourmaline::Systems::ECS;
const Entity &BaseComponent::GetOwner() { return *this->owner; }