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,18 @@
using RobotAndDonkey.Game.GameState;
namespace RobotAndDonkey.Game.Execution.Requests;
public sealed record BufferOverflowRequest(Guid RequestId) : Request(RequestId)
{
public static BufferOverflowRequest Create(CoreLoop coreLoop)
{
coreLoop.ShuffleDeck();
coreLoop.DrawHand();
return new(Guid.NewGuid());
}
public override string ToString()
{
return "Buffer overflow request";
}
}

View File

@@ -0,0 +1,18 @@
using System;
using RobotAndDonkey.Game.Cards;
using RobotAndDonkey.Game.GameState;
namespace RobotAndDonkey.Game.Execution.Requests;
public sealed record DrawGlitchRequest(Guid RequestId, Card Card) : Request(RequestId)
{
public static DrawGlitchRequest Create(CoreLoop coreLoop)
{
return new(Guid.NewGuid(), coreLoop.GlitchDeck[coreLoop.NextGlitch]);
}
public override string ToString()
{
return $"Draw glitch request: {Card}";
}
}

View File

@@ -0,0 +1,18 @@
using System;
using RobotAndDonkey.Game.Execution.Commands;
using RobotAndDonkey.Game.GameState;
namespace RobotAndDonkey.Game.Execution.Requests;
public sealed record ExecuteProgramRequest(Guid RequestId) : Request(RequestId)
{
public static ExecuteProgramRequest Create(CoreLoop coreLoop)
{
return new(Guid.NewGuid());
}
public override string ToString()
{
return "Execute program request";
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Immutable;
using RobotAndDonkey.Game.Cards;
using RobotAndDonkey.Game.Data;
using RobotAndDonkey.Game.GameState;
namespace RobotAndDonkey.Game.Execution.Requests;
public sealed record GambleRequest(Guid RequestId) : Request(RequestId)
{
public static GambleRequest Create(CoreLoop coreLoop)
{
return new(Guid.NewGuid());
}
public override string ToString()
{
return "Gamble request";
}
}

View File

@@ -0,0 +1,18 @@
using System;
using RobotAndDonkey.Game.Execution.Commands;
using RobotAndDonkey.Game.GameState;
namespace RobotAndDonkey.Game.Execution.Requests;
public sealed record ImproveRequest(Guid RequestId) : Request(RequestId)
{
public static ImproveRequest Create(CoreLoop coreLoop)
{
return new(Guid.NewGuid());
}
public override string ToString()
{
return "Improve request";
}
}

View File

@@ -0,0 +1,22 @@
using System;
using RobotAndDonkey.Game.Execution.Commands;
namespace RobotAndDonkey.Game.Execution.Requests;
public abstract record Request(Guid RequestId)
{
public bool IsCommandCompatible(Command command)
{
foreach (var requestType in command.RequestTypes)
{
if (requestType == GetType())
return true;
}
return false;
}
public static readonly EmptyRequest s_Empty = new();
}
public sealed record EmptyRequest() : Request(Guid.Empty);

View File

@@ -0,0 +1,18 @@
using System;
using RobotAndDonkey.Game.Execution.Commands;
using RobotAndDonkey.Game.GameState;
namespace RobotAndDonkey.Game.Execution.Requests;
public sealed record ScoringRequest(Guid RequestId) : Request(RequestId)
{
public static ScoringRequest Create(CoreLoop coreLoop)
{
return new(Guid.NewGuid());
}
public override string ToString()
{
return "Scoring request";
}
}