Add attribute system with core stats and gameplay components
This commit is contained in:
12
GameCore/ECS/Interfaces/IComponent.cs
Normal file
12
GameCore/ECS/Interfaces/IComponent.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace GameCore.ECS.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// A marker interface for all components.
|
||||
/// Components are simple data containers (structs or classes) that hold the state
|
||||
/// for a specific aspect of an Entity (e.g., its position, health, or inventory).
|
||||
/// They contain no logic.
|
||||
/// </summary>
|
||||
public interface IComponent
|
||||
{
|
||||
|
||||
}
|
||||
6
GameCore/ECS/Interfaces/IEntityPresenter.cs
Normal file
6
GameCore/ECS/Interfaces/IEntityPresenter.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace GameCore.ECS.Interfaces;
|
||||
|
||||
public interface IEntityPresenter
|
||||
{
|
||||
public Entity CoreEntity { get; set; }
|
||||
}
|
||||
8
GameCore/ECS/Interfaces/IPresenterComponent.cs
Normal file
8
GameCore/ECS/Interfaces/IPresenterComponent.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace GameCore.ECS.Interfaces;
|
||||
|
||||
public interface IPresenterComponent
|
||||
{
|
||||
void Initialize(Entity coreEntity, World world);
|
||||
void SyncToPresentation(float delta);
|
||||
void SyncToCore(float delta);
|
||||
}
|
||||
17
GameCore/ECS/Interfaces/ISystem.cs
Normal file
17
GameCore/ECS/Interfaces/ISystem.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace GameCore.ECS.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// The contract for all game logic systems.
|
||||
/// Systems are stateless classes that contain all the logic.
|
||||
/// They operate on entities that possess a specific set of components.
|
||||
/// For example, a MovementSystem would operate on entities with PositionComponent and VelocityComponent.
|
||||
/// </summary>
|
||||
public interface ISystem
|
||||
{
|
||||
/// <summary>
|
||||
/// The main update method for a system, called once per game loop.
|
||||
/// </summary>
|
||||
/// <param name="world">A reference to the main World object to query for entities and components.</param>
|
||||
/// <param name="deltaTime">The time elapsed since the last frame.</param>
|
||||
void Update(World world, float deltaTime);
|
||||
}
|
||||
9
GameCore/ECS/Interfaces/IWorldQuery.cs
Normal file
9
GameCore/ECS/Interfaces/IWorldQuery.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using GameCore.Math;
|
||||
|
||||
namespace GameCore.ECS.Interfaces;
|
||||
|
||||
public interface IWorldQuery
|
||||
{
|
||||
HitResult Raycast(Vector3 from, Vector3 to, Entity? ownerToExclude = null);
|
||||
Vector3 RotateVectorByYaw(Vector3 vector, float yawRadians);
|
||||
}
|
||||
Reference in New Issue
Block a user