Implement too many changes to list

This commit is contained in:
2026-07-07 11:46:31 +02:00
parent 8f66e83b65
commit 28486bff8c
50 changed files with 6344 additions and 1131 deletions
+30 -6
View File
@@ -1,5 +1,5 @@
using System;
using System.Collections.Generic;
using KernelPanic.Core;
namespace KernelPanic.Combat
{
@@ -8,23 +8,47 @@ namespace KernelPanic.Combat
/// </summary>
public sealed class LazyStack : IResolutionTrack
{
private readonly Stack<CardInstance> stackedCards = new();
private readonly Stack<CardInstance> _stackedCards = new();
private readonly List<CardInstance> _stackedView = new();
public int Count => stackedCards.Count;
public int Count => _stackedCards.Count;
public IReadOnlyList<CardInstance> Cards => _stackedView;
public void Enqueue(CardInstance card)
{
throw new NotImplementedException();
if (card == null)
{
return;
}
_stackedCards.Push(card);
_stackedView.Insert(0, card);
}
public void Resolve(CombatContext context)
{
throw new NotImplementedException();
ForceEvaluate(context);
}
public void ForceEvaluate(CombatContext context)
{
throw new NotImplementedException();
while (TryPop(out CardInstance card))
{
GameEvents.RaiseCardResolved(new CardResolvedEvent(card, ResolutionTrack.LazyStack));
}
}
public bool TryPop(out CardInstance card)
{
if (_stackedCards.Count == 0)
{
card = null;
return false;
}
card = _stackedCards.Pop();
_stackedView.Remove(card);
return true;
}
}
}