foxhunt part2
This commit is contained in:
parent
29fa9c5e84
commit
86ea4f8640
|
|
@ -30,14 +30,14 @@ namespace Koogle.Application.Games.FoxHunt
|
|||
id => id,
|
||||
_ => new FoxHuntPlayerState());
|
||||
|
||||
return new FoxHuntGameModel
|
||||
var model = new FoxHuntGameModel
|
||||
{
|
||||
FoxIndex = 0, // aktueller Fuchs (Index in PlayerOrder)
|
||||
NonFoxIndex = 0, // Index für Nicht-Fuchs-Spieler
|
||||
FoxTurnsRemaining = 2, // erste 2 Fuchs-Züge
|
||||
FoxTurn = false,
|
||||
FoxIndex = 0, // aktueller Fuchs (Index in PlayerOrder)
|
||||
NonFoxIndex = 0, // Index für Nicht-Fuchs-Spieler
|
||||
FoxTurnsRemaining = 2, // erste 2 Fuchs-Züge
|
||||
FoxTurn = false,
|
||||
|
||||
LeadingThrows = options.LeadingThrows,
|
||||
LeadingThrows = options.LeadingThrows,
|
||||
PlayerStates = playerStates,
|
||||
PlayerOrder = playerOrder,
|
||||
//CurrentPlayerIndex = 0,
|
||||
|
|
@ -46,6 +46,17 @@ namespace Koogle.Application.Games.FoxHunt
|
|||
WinnerId = null,
|
||||
IsGameOver = false,
|
||||
};
|
||||
|
||||
var next = GetNextId(model);
|
||||
|
||||
var res = model with
|
||||
{
|
||||
FoxIndex = model.FoxIndex,
|
||||
FoxTurn = model.FoxTurn,
|
||||
FoxTurnsRemaining = model.FoxTurnsRemaining,
|
||||
NonFoxIndex = model.NonFoxIndex
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
public (object UpdatedModel, ThrowResult Result) ProcessThrow(object gameModel, AfterThrowState afterThrow)
|
||||
|
|
@ -72,9 +83,17 @@ namespace Koogle.Application.Games.FoxHunt
|
|||
|
||||
var foxId = model.PlayerOrder[model.FoxIndex];
|
||||
var isFoxThrow = playerId == foxId;
|
||||
|
||||
|
||||
// 5. Check GAME END
|
||||
if (isFoxThrow)
|
||||
{
|
||||
playerStates[foxId].PinCountFox+= afterThrow.PinsKnocked;
|
||||
}
|
||||
else
|
||||
{
|
||||
playerStates[foxId].PinCountHunters+= afterThrow.PinsKnocked;
|
||||
}
|
||||
|
||||
// 5. Check GAME END
|
||||
bool isGameOver = false;
|
||||
Guid? winnerId = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@
|
|||
|
||||
public record FoxHuntPlayerState
|
||||
{
|
||||
public int PinCountFox { get; set; }
|
||||
|
||||
public int PinCount { get; set; }
|
||||
public int PinCountHunters { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue