initialize repo

This commit is contained in:
2025-08-08 15:36:09 +02:00
parent d6a2c37a5f
commit cabf13d164
92 changed files with 2160 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
using Civilization.Core.Interfaces;
namespace Civilization.Core.Actions;
public class ActionQueue
{
private readonly Queue<IGameAction> _pending = new();
private readonly Stack<ExecutedAction> _history = new();
public void Enqueue(IGameAction action)
{
_pending.Enqueue(action);
}
public void ExecuteAll(GameActionContext context)
{
while (_pending.Count > 0)
{
var action = _pending.Dequeue();
if (!action.CanExecute(context)) continue;
action.Execute(context);
_history.Push(new ExecutedAction(action, context));
}
}
}