feat: safe delegate invocation helper added

This commit is contained in:
2025-04-13 19:08:47 +03:00
parent 00f7b1aaab
commit 58eb373c79
21 changed files with 116 additions and 91 deletions

View File

@@ -23,7 +23,7 @@ public class StateEnable : IStateEnable
bool previousState = _enabled;
_enabled = value;
OnEnabledChanged?.Invoke(this, previousState);
OnEnabledChanged?.InvokeSafe(this, previousState);
}
}
@@ -35,7 +35,7 @@ public class StateEnable : IStateEnable
_entity = entity;
OnAssign(entity);
OnEntityAssigned?.Invoke(this);
OnEntityAssigned?.InvokeSafe(this);
return true;
}
@@ -45,7 +45,7 @@ public class StateEnable : IStateEnable
return false;
_entity = null!;
OnUnassigned?.Invoke(this);
OnUnassigned?.InvokeSafe(this);
return true;
}
}