ported from perforce
This commit is contained in:
22
RobotAndDonkey.Game/Execution/Commands/DestroyCardCommand.cs
Normal file
22
RobotAndDonkey.Game/Execution/Commands/DestroyCardCommand.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using RobotAndDonkey.Game.Execution.Requests;
|
||||
using RobotAndDonkey.Game.GameState;
|
||||
using RobotAndDonkey.Game.Intents;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Commands;
|
||||
|
||||
public sealed record DestroyCardCommand(Guid RequestId, int HandIndex) : Command(RequestId, typeof(BufferOverflowRequest))
|
||||
{
|
||||
protected override void CreateIntents(CoreLoop coreLoop, List<Intent> intents)
|
||||
{
|
||||
var handCards = coreLoop.GetHandCards();
|
||||
if (HandIndex < 0 || HandIndex >= handCards.Count)
|
||||
return;
|
||||
|
||||
intents.Add(new DestroyCard(handCards[HandIndex]));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Destroy card command {HandIndex}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user