dev foxhunt
This commit is contained in:
parent
86ea4f8640
commit
433b61618d
|
|
@ -34,8 +34,8 @@ namespace Koogle.Application.Games.FoxHunt
|
|||
{
|
||||
FoxIndex = 0, // aktueller Fuchs (Index in PlayerOrder)
|
||||
NonFoxIndex = 0, // Index für Nicht-Fuchs-Spieler
|
||||
FoxTurnsRemaining = 2, // erste 2 Fuchs-Züge
|
||||
FoxTurn = false,
|
||||
FoxTurnsRemaining = options.LeadingThrows - 1, // -1 weil erster Wurf bereits aus PlayerOrder[FoxIndex]
|
||||
FoxTurn = true, // ein fuchs fängt an
|
||||
|
||||
LeadingThrows = options.LeadingThrows,
|
||||
PlayerStates = playerStates,
|
||||
|
|
@ -47,16 +47,7 @@ namespace Koogle.Application.Games.FoxHunt
|
|||
IsGameOver = false,
|
||||
};
|
||||
|
||||
var next = GetNextId(model);
|
||||
|
||||
var res = model with
|
||||
{
|
||||
FoxIndex = model.FoxIndex,
|
||||
FoxTurn = model.FoxTurn,
|
||||
FoxTurnsRemaining = model.FoxTurnsRemaining,
|
||||
NonFoxIndex = model.NonFoxIndex
|
||||
};
|
||||
return res;
|
||||
return model;
|
||||
}
|
||||
|
||||
public (object UpdatedModel, ThrowResult Result) ProcessThrow(object gameModel, AfterThrowState afterThrow)
|
||||
|
|
@ -82,9 +73,8 @@ namespace Koogle.Application.Games.FoxHunt
|
|||
var triggers = new List<TriggerEvent>();
|
||||
|
||||
var foxId = model.PlayerOrder[model.FoxIndex];
|
||||
var isFoxThrow = playerId == foxId;
|
||||
|
||||
if (isFoxThrow)
|
||||
if (model.FoxTurn)
|
||||
{
|
||||
playerStates[foxId].PinCountFox+= afterThrow.PinsKnocked;
|
||||
}
|
||||
|
|
@ -147,10 +137,12 @@ namespace Koogle.Application.Games.FoxHunt
|
|||
if (model.FoxTurnsRemaining > 0)
|
||||
{
|
||||
model.FoxTurnsRemaining--;
|
||||
model.FoxTurn = false; // danach abwechselnd
|
||||
model.FoxTurn = true;
|
||||
return foxId;
|
||||
}
|
||||
|
||||
model.FoxTurn = !model.FoxTurn; // danach abwechselnd
|
||||
|
||||
// 2️⃣ Abwechselnd Nicht-Fuchs → Fuchs
|
||||
if (!model.FoxTurn)
|
||||
{
|
||||
|
|
@ -162,7 +154,7 @@ namespace Koogle.Application.Games.FoxHunt
|
|||
{
|
||||
Guid next = model.PlayerOrder[model.NonFoxIndex];
|
||||
model.NonFoxIndex++;
|
||||
model.FoxTurn = true;
|
||||
//model.FoxTurn = true;
|
||||
return next;
|
||||
}
|
||||
else
|
||||
|
|
@ -170,14 +162,14 @@ namespace Koogle.Application.Games.FoxHunt
|
|||
// Alle Nicht-Füchse durch → neuer Fuchs
|
||||
model.FoxIndex++;
|
||||
model.NonFoxIndex = 0;
|
||||
model.FoxTurnsRemaining = 2;
|
||||
model.FoxTurnsRemaining = model.LeadingThrows - 1;
|
||||
model.FoxTurn = true;
|
||||
return GetNextId(model);
|
||||
}
|
||||
}
|
||||
|
||||
// 3️⃣ Fuchs-Zug im Wechsel
|
||||
model.FoxTurn = false;
|
||||
//model.FoxTurn = false;
|
||||
return foxId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
|
||||
|
||||
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 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
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue