-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework environment switching and allow other entities to switch
- Loading branch information
Showing
37 changed files
with
774 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
include/ServerLib/Components/ServerEnvironmentSwitchComponent.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq ([email protected]) | ||
// This file is part of the "This Space Of Mine" project | ||
// For conditions of distribution and use, see copyright notice in LICENSE | ||
|
||
#pragma once | ||
|
||
#ifndef TSOM_SERVERLIB_COMPONENTS_SERVERENVIRONMENTSWITCHCOMPONENT_HPP | ||
#define TSOM_SERVERLIB_COMPONENTS_SERVERENVIRONMENTSWITCHCOMPONENT_HPP | ||
|
||
#include <CommonLib/EnvironmentTransform.hpp> | ||
#include <entt/fwd.hpp> | ||
#include <functional> | ||
|
||
namespace tsom | ||
{ | ||
class ServerEnvironment; | ||
|
||
struct ServerEnvironmentSwitchComponent | ||
{ | ||
std::function<void(entt::handle entity, ServerEnvironment* newEnvironment, const EnvironmentTransform& /*environmentTransform*/)> handleEnvironmentSwitch; | ||
|
||
NazaraSignal(OnEntitySwitchedEnvironment, entt::handle /*previousEntity*/, entt::handle /*newEntity*/, ServerEnvironment* /*newEnvironment*/, const EnvironmentTransform& /*environmentTransform*/); | ||
}; | ||
} | ||
|
||
#endif // TSOM_SERVERLIB_COMPONENTS_SERVERENVIRONMENTSWITCHCOMPONENT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq ([email protected]) | ||
// This file is part of the "This Space Of Mine" project | ||
// For conditions of distribution and use, see copyright notice in LICENSE | ||
|
||
#pragma once | ||
|
||
#ifndef TSOM_SERVERLIB_COMPONENTS_SHIPEXTERIORCOMPONENT_HPP | ||
#define TSOM_SERVERLIB_COMPONENTS_SHIPEXTERIORCOMPONENT_HPP | ||
|
||
#include <ServerLib/ServerShipEnvironment.hpp> | ||
|
||
namespace tsom | ||
{ | ||
class ServerShipEnvironment; | ||
|
||
struct ShipExteriorComponent | ||
{ | ||
ServerShipEnvironment* ownerShip; | ||
|
||
NazaraSlot(ServerShipEnvironment, OnInteriorColliderUpdated, onInteriorColliderUpdated); | ||
}; | ||
} | ||
|
||
#endif // TSOM_SERVERLIB_COMPONENTS_SHIPEXTERIORCOMPONENT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq ([email protected]) | ||
// This file is part of the "This Space Of Mine" project | ||
// For conditions of distribution and use, see copyright notice in LICENSE | ||
|
||
#pragma once | ||
|
||
#ifndef TSOM_SERVERLIB_ENTITIES_SERVERCLASSLIBRARY_HPP | ||
#define TSOM_SERVERLIB_ENTITIES_SERVERCLASSLIBRARY_HPP | ||
|
||
#include <ServerLib/Export.hpp> | ||
#include <CommonLib/Entities/EntityClassLibrary.hpp> | ||
|
||
namespace Nz | ||
{ | ||
class ApplicationBase; | ||
} | ||
|
||
namespace tsom | ||
{ | ||
class BlockLibrary; | ||
class ChunkContainer; | ||
class ChunkEntities; | ||
|
||
class TSOM_SERVERLIB_API ServerClassLibrary : public EntityClassLibrary | ||
{ | ||
public: | ||
inline ServerClassLibrary(Nz::ApplicationBase& app); | ||
ServerClassLibrary(const ServerClassLibrary&) = delete; | ||
ServerClassLibrary(ServerClassLibrary&&) = delete; | ||
~ServerClassLibrary() = default; | ||
|
||
void Register(EntityRegistry& registry) override; | ||
|
||
ServerClassLibrary& operator=(const ServerClassLibrary&) = delete; | ||
ServerClassLibrary& operator=(ServerClassLibrary&&) = delete; | ||
|
||
protected: | ||
Nz::ApplicationBase& m_app; | ||
}; | ||
} | ||
|
||
#include <ServerLib/Entities/ServerClassLibrary.inl> | ||
|
||
#endif // TSOM_SERVERLIB_ENTITIES_SERVERCLASSLIBRARY_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq ([email protected]) | ||
// This file is part of the "This Space Of Mine" project | ||
// For conditions of distribution and use, see copyright notice in LICENSE | ||
|
||
namespace tsom | ||
{ | ||
inline ServerClassLibrary::ServerClassLibrary(Nz::ApplicationBase& app) : | ||
m_app(app) | ||
{ | ||
} | ||
} |
Oops, something went wrong.