Implement too many changes to list
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user