using GameCore.ECS; using GameCore.ECS.Interfaces; namespace GameCore.Attributes; public class AttributeSystem : ISystem { public void Update(World world, float deltaTime) { var entities = world.GetEntitiesWith(); foreach (var entity in entities) { var attributes = world.GetComponent(entity); if (attributes == null) continue; var maxHealth = attributes.GetValue(Attribute.MaxHealth); var currentHealth = attributes.GetValue(Attribute.Health); if (currentHealth > maxHealth) attributes.SetCurrentValue(Attribute.Health, maxHealth); } } }