53650e4bfe
* Fixed dependency * Updates to NeoDictionary * Changes to NeoDictionary * Started working on a Git implementation to integrate into Game Engines in the future * Added commit functionality to the git library * New changes * Added select for NeoDictionary.cs * Fixed issue with previous new method * Added a Benchmarking Tool to be used mostly in game engines * Added IndexOf to NeoDictionary.cs * Added new method for BenchmarkUtility.cs * added an instacedobject class * Added a new shuffle method for lists * fixed return type * Added new Changelog generator * Added new Game logic library to assist with game projects * Added Web Project * Added Nuget package configs * Add workflow for publishing game library NuGet package * Add README for OmegaLeo's Helper Library * Updated Website to reflect all libraries * Fixed missing library in Changelog * Added Contributing and Code of Conduct * Fixed web project * new documentation changes * fix packages * Fixed DocumentationHelper package dependencies * Added Serilog * Added logging * Fixed documentation * Added logging for cache * fixed documentation * Updated README.md * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update OmegaLeo.HelperLib.Web/Controllers/HomeController.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update OmegaLeo.HelperLib.Web/Controllers/HomeController.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix error --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
30 lines
924 B
C#
30 lines
924 B
C#
using NetFlow.DocumentationHelper.Library.Attributes;
|
|
using OmegaLeo.HelperLib.Game.Models;
|
|
|
|
namespace OmegaLeo.HelperLib.Game.Handlers
|
|
{
|
|
[Documentation(nameof(DelayedActionHandler), "Handler for managing delayed actions, allowing cancellation and status checking.", null, @"```csharp
|
|
var action = new DelayedAction(...);
|
|
var handler = new DelayedActionHandler(action);
|
|
```")]
|
|
public class DelayedActionHandler
|
|
{
|
|
private readonly DelayedAction _action;
|
|
|
|
internal DelayedActionHandler(DelayedAction action)
|
|
{
|
|
_action = action;
|
|
}
|
|
|
|
[Documentation(nameof(Cancel), "Cancels the delayed action if it has not yet executed.", null, @"```csharp
|
|
handler.Cancel();
|
|
```")]
|
|
public void Cancel()
|
|
{
|
|
if (_action != null)
|
|
_action.IsCancelled = true;
|
|
}
|
|
|
|
public bool IsCancelled => _action?.IsCancelled ?? true;
|
|
}
|
|
} |