ported from perforce

This commit is contained in:
2026-04-19 00:43:27 +02:00
commit 6c0c33f5d4
700 changed files with 19735 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using RobotAndDonkey.Game.Board;
using RobotAndDonkey.Game.Cards;
using RobotAndDonkey.Game.Data;
using RobotAndDonkey.Game.Execution.Results;
using RobotAndDonkey.Game.GameState;
using RobotAndDonkey.Game.Pois;
namespace RobotAndDonkey.Game.Intents;
public class DonkeyIntent(Card card, Cell donkeyCell, int energyCost) : Intent(energyCost)
{
public override void Run(Guid requestId, CoreLoop coreLoop, List<Intent> newIntents, List<Result> results)
{
if (coreLoop.HasDonkey && donkeyCell.Poi == null)
{
coreLoop.HasDonkey = false;
donkeyCell.Poi = new Donkey();
results.Add(new PoiResult(requestId, new(coreLoop.Board), donkeyCell.Poi, donkeyCell.Hex));
newIntents.Add(new ModifyCurrency(new(0, -Balancing.Instance.DonkeyMaxCarryBonus, 0, 0, 0, 0)));
}
else if (!coreLoop.HasDonkey && donkeyCell.Poi is Donkey donkey)
{
coreLoop.HasDonkey = true;
donkeyCell.Poi = null;
results.Add(new PoiResult(requestId, new(coreLoop.Board), donkey, donkeyCell.Hex));
newIntents.Add(new ModifyCurrency(new(0, Balancing.Instance.DonkeyMaxCarryBonus, 0, 0, 0, 0)));
}
else
{
results.Add(new InvalidInstructionResult(requestId, EInvalidReason.NoTarget, card, donkeyCell));
}
}
public override string ToString() => "Donkey, " + base.ToString();
}