Add attribute system with core stats and gameplay components

This commit is contained in:
2025-10-13 12:10:45 +02:00
commit ce3596efaa
55 changed files with 1161 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using GameCore.ECS;
using GameCore.ECS.Interfaces;
using GameCore.Player;
namespace GameCore.Input;
public class PlayerInputSystem : ISystem
{
public void Update(World world, float deltaTime)
{
var playerEntities = world.GetEntitiesWith<PlayerComponent>();
if (!playerEntities.Any()) return;
var playerEntity = playerEntities.First();
var inputState = world.GetComponent<InputStateComponent>(playerEntity);
if (inputState == null) return;
inputState.MoveDirection = world.InputService.MoveDirection.Normalize();
inputState.LookDirection = world.InputService.LookDirection;
inputState.IsJumping = world.InputService.IsJumping;
inputState.IsInteracting = world.InputService.IsInteracting;
inputState.IsFiring = world.InputService.IsFiring;
}
}