ported from perforce
This commit is contained in:
11
RobotAndDonkey.Game/Execution/Results/CellTypeResult.cs
Normal file
11
RobotAndDonkey.Game/Execution/Results/CellTypeResult.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using RobotAndDonkey.Game.Utils;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record CellTypeResult(Guid RequestId, Board.Board Board, Hex Hex) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Cell type result: {Hex}";
|
||||
}
|
||||
}
|
||||
13
RobotAndDonkey.Game/Execution/Results/CurrencyResult.cs
Normal file
13
RobotAndDonkey.Game/Execution/Results/CurrencyResult.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using RobotAndDonkey.Game.Board;
|
||||
using RobotAndDonkey.Game.GameState;
|
||||
using System;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record CurrencyResult(Guid RequestId, Currency NewCurrency) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Currency result: {NewCurrency}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record DeferGlitchCountResult(Guid RequestId, int NewDeferGlitchCount) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Defer glitch count result: {NewDeferGlitchCount}";
|
||||
}
|
||||
}
|
||||
13
RobotAndDonkey.Game/Execution/Results/DiscardResult.cs
Normal file
13
RobotAndDonkey.Game/Execution/Results/DiscardResult.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RobotAndDonkey.Game.Cards;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record DiscardResult(Guid RequestId, IReadOnlyList<Card> Discard) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Discard result: {string.Join(", ", Discard.Select(c => c.ToString()))}";
|
||||
}
|
||||
}
|
||||
13
RobotAndDonkey.Game/Execution/Results/HandResult.cs
Normal file
13
RobotAndDonkey.Game/Execution/Results/HandResult.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RobotAndDonkey.Game.Cards;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record HandResult(Guid RequestId, IReadOnlyList<Card> Hand) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Hand result: {string.Join(", ", Hand.Select(c => c.ToString()))}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using RobotAndDonkey.Game.Board;
|
||||
using RobotAndDonkey.Game.Cards;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public enum EInvalidReason
|
||||
{
|
||||
NotFound,
|
||||
Invariant,
|
||||
Blocked,
|
||||
OutOfBounds,
|
||||
NoEnergy,
|
||||
NoTarget,
|
||||
NoAmount,
|
||||
AlreadyExecuted,
|
||||
Invalid,
|
||||
NoSpace
|
||||
}
|
||||
|
||||
public record InvalidInstructionResult(Guid RequestId, EInvalidReason Reason, Card? Card, Cell? Cell) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Invalid instruction result: {Reason}, {Card}, {Cell}";
|
||||
}
|
||||
}
|
||||
13
RobotAndDonkey.Game/Execution/Results/InventoryResult.cs
Normal file
13
RobotAndDonkey.Game/Execution/Results/InventoryResult.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using RobotAndDonkey.Game.Cards;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record DeckResult(Guid RequestId, IReadOnlyList<Card> Deck) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Deck result: {string.Join(", ", Deck.Select(c => c.ToString()))}";
|
||||
}
|
||||
}
|
||||
22
RobotAndDonkey.Game/Execution/Results/ModifyCardResult.cs
Normal file
22
RobotAndDonkey.Game/Execution/Results/ModifyCardResult.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using RobotAndDonkey.Game.Cards;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public enum ECardLocation
|
||||
{
|
||||
Tape,
|
||||
Hand,
|
||||
Deck,
|
||||
Discard,
|
||||
Robot,
|
||||
Board
|
||||
}
|
||||
|
||||
public record ModifyCardResult(Guid RequestId, Card Card, EModifierId Modifier, ECardLocation Location) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Modify card result in {Location}: {Card} - {Modifier}";
|
||||
}
|
||||
}
|
||||
11
RobotAndDonkey.Game/Execution/Results/ModifyCellResult.cs
Normal file
11
RobotAndDonkey.Game/Execution/Results/ModifyCellResult.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using RobotAndDonkey.Game.Utils;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record ModifyCellResult(Guid RequestId, Board.Board Board, EModifierId Modifier, Hex Hex) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Modify Cell result: {Hex} {Modifier}";
|
||||
}
|
||||
}
|
||||
11
RobotAndDonkey.Game/Execution/Results/ModifyRobotResult.cs
Normal file
11
RobotAndDonkey.Game/Execution/Results/ModifyRobotResult.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record ModifyRobotResult(Guid RequestId) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return "Modify robot result";
|
||||
}
|
||||
}
|
||||
11
RobotAndDonkey.Game/Execution/Results/NextGlitchResult.cs
Normal file
11
RobotAndDonkey.Game/Execution/Results/NextGlitchResult.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record NextGlitchResult(Guid RequestId, int NewNextGlitch) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Next glitch result: {NewNextGlitch}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record NoMoreBufferOverflowResult(Guid RequestId) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"No more buffer overflow result";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record NoMoreGamblingResult(Guid RequestId) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return "No more gambling result";
|
||||
}
|
||||
}
|
||||
12
RobotAndDonkey.Game/Execution/Results/PoiResult.cs
Normal file
12
RobotAndDonkey.Game/Execution/Results/PoiResult.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using RobotAndDonkey.Game.Pois;
|
||||
using RobotAndDonkey.Game.Utils;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record PoiResult(Guid RequestId, Board.Board Board, Poi? Poi, Hex Hex) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Poi result: {Hex}";
|
||||
}
|
||||
}
|
||||
11
RobotAndDonkey.Game/Execution/Results/ProgramResult.cs
Normal file
11
RobotAndDonkey.Game/Execution/Results/ProgramResult.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record ProgramResult(Guid RequestId, int NewProgram) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Program result: {NewProgram}";
|
||||
}
|
||||
}
|
||||
14
RobotAndDonkey.Game/Execution/Results/ProgramRowResult.cs
Normal file
14
RobotAndDonkey.Game/Execution/Results/ProgramRowResult.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RobotAndDonkey.Game.Cards;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record ProgramRowResult(Guid RequestId, IReadOnlyList<Card> OrderedCards, IReadOnlyCollection<Guid> TapeCardIds) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Program row result: {string.Join(", ", OrderedCards.Select(c => c.ToString()))}; tape={string.Join(", ", TapeCardIds.Select(id => id.ToString()))}";
|
||||
}
|
||||
}
|
||||
5
RobotAndDonkey.Game/Execution/Results/Result.cs
Normal file
5
RobotAndDonkey.Game/Execution/Results/Result.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using System;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public abstract record Result(Guid RequestId);
|
||||
12
RobotAndDonkey.Game/Execution/Results/RunCardResult.cs
Normal file
12
RobotAndDonkey.Game/Execution/Results/RunCardResult.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using RobotAndDonkey.Game.Cards;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record RunCardResult(Guid RequestId, Card? Card) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Run card result: {Card}";
|
||||
}
|
||||
}
|
||||
11
RobotAndDonkey.Game/Execution/Results/RunPhaseResult.cs
Normal file
11
RobotAndDonkey.Game/Execution/Results/RunPhaseResult.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record RunPhaseResult(Guid RequestId, ERunPhase NewRunPhase) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Run phase result: {NewRunPhase}";
|
||||
}
|
||||
}
|
||||
11
RobotAndDonkey.Game/Execution/Results/ShopResult.cs
Normal file
11
RobotAndDonkey.Game/Execution/Results/ShopResult.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using RobotAndDonkey.Game.Cards;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record ShopResult(Guid RequestId, Card[] Shop) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Shop result: {string.Join(", ", Shop.Select(c => c.ToString()))}";
|
||||
}
|
||||
}
|
||||
11
RobotAndDonkey.Game/Execution/Results/TapeResult.cs
Normal file
11
RobotAndDonkey.Game/Execution/Results/TapeResult.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using RobotAndDonkey.Game.Cards;
|
||||
|
||||
namespace RobotAndDonkey.Game.Execution.Results;
|
||||
|
||||
public record TapeResult(Guid RequestId, IReadOnlyList<Card> Tape) : Result(RequestId)
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Tape result: {string.Join(", ", Tape.Select(c => c.ToString()))}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user