Compare commits

..

No commits in common. "433b61618d9a77f96c6d5871e1d6c73214cb63f9" and "29fa9c5e84dae0df83ce4c4dda17913efd675149" have entirely different histories.

2 changed files with 18 additions and 30 deletions

View File

@ -30,14 +30,14 @@ namespace Koogle.Application.Games.FoxHunt
id => id,
_ => new FoxHuntPlayerState());
var model = new FoxHuntGameModel
return new FoxHuntGameModel
{
FoxIndex = 0, // aktueller Fuchs (Index in PlayerOrder)
NonFoxIndex = 0, // Index für Nicht-Fuchs-Spieler
FoxTurnsRemaining = options.LeadingThrows - 1, // -1 weil erster Wurf bereits aus PlayerOrder[FoxIndex]
FoxTurn = true, // ein fuchs fängt an
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,8 +46,6 @@ namespace Koogle.Application.Games.FoxHunt
WinnerId = null,
IsGameOver = false,
};
return model;
}
public (object UpdatedModel, ThrowResult Result) ProcessThrow(object gameModel, AfterThrowState afterThrow)
@ -73,17 +71,10 @@ namespace Koogle.Application.Games.FoxHunt
var triggers = new List<TriggerEvent>();
var foxId = model.PlayerOrder[model.FoxIndex];
var isFoxThrow = playerId == foxId;
if (model.FoxTurn)
{
playerStates[foxId].PinCountFox+= afterThrow.PinsKnocked;
}
else
{
playerStates[foxId].PinCountHunters+= afterThrow.PinsKnocked;
}
// 5. Check GAME END
// 5. Check GAME END
bool isGameOver = false;
Guid? winnerId = null;
@ -137,12 +128,10 @@ namespace Koogle.Application.Games.FoxHunt
if (model.FoxTurnsRemaining > 0)
{
model.FoxTurnsRemaining--;
model.FoxTurn = true;
model.FoxTurn = false; // danach abwechselnd
return foxId;
}
model.FoxTurn = !model.FoxTurn; // danach abwechselnd
// 2⃣ Abwechselnd Nicht-Fuchs → Fuchs
if (!model.FoxTurn)
{
@ -154,7 +143,7 @@ namespace Koogle.Application.Games.FoxHunt
{
Guid next = model.PlayerOrder[model.NonFoxIndex];
model.NonFoxIndex++;
//model.FoxTurn = true;
model.FoxTurn = true;
return next;
}
else
@ -162,14 +151,14 @@ namespace Koogle.Application.Games.FoxHunt
// Alle Nicht-Füchse durch → neuer Fuchs
model.FoxIndex++;
model.NonFoxIndex = 0;
model.FoxTurnsRemaining = model.LeadingThrows - 1;
model.FoxTurnsRemaining = 2;
model.FoxTurn = true;
return GetNextId(model);
}
}
// 3⃣ Fuchs-Zug im Wechsel
//model.FoxTurn = false;
model.FoxTurn = false;
return foxId;
}

View File

@ -23,17 +23,16 @@
public int FoxIndex { get; set; } // aktueller Fuchs (Index in PlayerOrder)
public int NonFoxIndex { get; set; } // Index für Nicht-Fuchs-Spieler
public int FoxTurnsRemaining { get; set; } // verbleibende Fuchs-Züge
public bool FoxTurn { get; set; } // true = Fuchs dran im Wechsel
public int FoxIndex = 0; // aktueller Fuchs (Index in PlayerOrder)
public int NonFoxIndex = 0; // Index für Nicht-Fuchs-Spieler
public int FoxTurnsRemaining = 2; // erste 2 Fuchs-Züge
public bool FoxTurn = true; // wer ist dran
}
public record FoxHuntPlayerState
{
public int PinCountFox { get; set; }
public int PinCountHunters { get; set; }
public int PinCount { get; set; }
}
}