Removing needless entity pointer storing in BaseComponent
This commit is contained in:
@@ -13,7 +13,6 @@
|
|||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <format>
|
#include <format>
|
||||||
#include <typeindex>
|
#include <typeindex>
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
#include "../Containers/DualkeyMap.hpp"
|
#include "../Containers/DualkeyMap.hpp"
|
||||||
#include "../Types.hpp"
|
#include "../Types.hpp"
|
||||||
@@ -26,10 +25,8 @@ class World;
|
|||||||
struct BaseComponent {
|
struct BaseComponent {
|
||||||
public:
|
public:
|
||||||
virtual ~BaseComponent() = default;
|
virtual ~BaseComponent() = default;
|
||||||
const Entity &GetOwner();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const Entity *owner;
|
|
||||||
friend World;
|
friend World;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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; }
|
|
||||||
Reference in New Issue
Block a user