ported from perforce
This commit is contained in:
22
RobotAndDonkey.Game/Execution/Commands/DiscardCommand.cs
Normal file
22
RobotAndDonkey.Game/Execution/Commands/DiscardCommand.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using RobotAndDonkey.Game.Data;
|
||||
using RobotAndDonkey.Game.Execution.Requests;
|
||||
using RobotAndDonkey.Game.GameState;
|
||||
using RobotAndDonkey.Game.Intents;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Commands;
|
||||
|
||||
public sealed record DiscardCommand(Guid RequestId, Guid[] CardIds) : Command(RequestId, typeof(ExecuteProgramRequest))
|
||||
{
|
||||
protected override void CreateIntents(CoreLoop coreLoop, List<Intent> intents)
|
||||
{
|
||||
var cost = CardIds.Length * Balancing.Instance.DiscardEnergyCost;
|
||||
intents.Add(new Discard(CardIds, cost));
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Discard cards command {string.Join(", ", CardIds.Select(id => id.ToString()))}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user