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,50 @@ namespace KernelPanic.Combat
|
||||
/// </summary>
|
||||
public sealed class InterpreterQueue : IResolutionTrack
|
||||
{
|
||||
private readonly Queue<CardInstance> queuedCards = new();
|
||||
private readonly Queue<CardInstance> _queuedCards = new();
|
||||
private readonly List<CardInstance> _queuedView = new();
|
||||
|
||||
public int Count => queuedCards.Count;
|
||||
public int Count => _queuedCards.Count;
|
||||
public IReadOnlyList<CardInstance> Cards => _queuedView;
|
||||
|
||||
public void Enqueue(CardInstance card)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (card == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_queuedCards.Enqueue(card);
|
||||
_queuedView.Add(card);
|
||||
}
|
||||
|
||||
public void Resolve(CombatContext context)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
while (_queuedCards.Count > 0)
|
||||
{
|
||||
CardInstance card = _queuedCards.Dequeue();
|
||||
_queuedView.Remove(card);
|
||||
GameEvents.RaiseCardResolved(new CardResolvedEvent(card, ResolutionTrack.InterpreterQueue));
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryDequeue(out CardInstance card)
|
||||
{
|
||||
if (_queuedCards.Count == 0)
|
||||
{
|
||||
card = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
card = _queuedCards.Dequeue();
|
||||
_queuedView.Remove(card);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
_queuedCards.Clear();
|
||||
_queuedView.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user