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,27 @@
using RobotAndDonkey.Game.Board;
using RobotAndDonkey.Game.Execution.Results;
using RobotAndDonkey.Game.GameState;
using RobotAndDonkey.Game.Pois;
namespace RobotAndDonkey.Game.Intents;
public class Turn(Cell cell, int delta) : Intent
{
public override void Run(Guid requestId, CoreLoop coreLoop, List<Intent> newIntents, List<Result> results)
{
var avatar = (Avatar)cell.Poi!;
var newDirection = ((int)avatar.Direction + Delta) % 6;
if (newDirection < 0)
newDirection += 6;
avatar.Direction = (EDirection)newDirection;
results.Add(new PoiResult(requestId, new(coreLoop.Board), avatar, cell.Hex));
base.Run(requestId, coreLoop, newIntents, results);
}
public override bool IsValid(CoreLoop coreLoop) => base.IsValid(coreLoop) && cell.Poi is Avatar;
public int Delta { get; set; } = delta;
public override string ToString() => $"Turn by {Delta}, " + base.ToString();
}