chore: bumped dotnet version to 10

This commit is contained in:
2026-01-23 12:16:07 +03:00
parent 097f1897c2
commit 90e59802c6
32 changed files with 210 additions and 257 deletions

View File

@@ -6,32 +6,29 @@ public class StateEnable : IStateEnable
public Event<IHasEntity> OnEntityAssigned { get; } = new();
public Event<IAssignable>? OnUnassigned { get; } = new();
private bool _enabled = true;
private IEntity _entity = null!;
public IEntity Entity => _entity;
public IEntity Entity { get; private set; } = null!;
public bool Enabled
{
get => _enabled;
get;
set
{
if (value == _enabled)
if (value == field)
return;
bool previousState = _enabled;
_enabled = value;
bool previousState = field;
field = value;
OnEnabledChanged?.Invoke(this, new(previousState));
}
}
} = true;
protected virtual void OnAssign(IEntity entity) { }
public bool Assign(IEntity entity)
{
if (_entity is not null && _entity.IsInitialized)
if (Entity is not null && Entity.IsInitialized)
return false;
_entity = entity;
Entity = entity;
OnAssign(entity);
OnEntityAssigned?.Invoke(this);
return true;
@@ -39,10 +36,10 @@ public class StateEnable : IStateEnable
public bool Unassign()
{
if (_entity is null)
if (Entity is null)
return false;
_entity = null!;
Entity = null!;
OnUnassigned?.Invoke(this);
return true;
}