This commit is contained in:
beo3000 2025-12-05 19:54:07 +01:00
parent a663fe62a4
commit 50824ba62d
3 changed files with 244 additions and 539 deletions

View File

@ -97,13 +97,14 @@ namespace KoogleApp.Games.Shit
var nextPlayerAction = progress.NextPlayer(NextPlayerHandler.GetNextPlayerIndex);
if (nextPlayerAction != null)
{
progress.NextThrowState = new ThrowPanelState(true,false,
actions.Add(nextPlayerAction);
progress.NextThrowState = new ThrowPanelState(true, false,
PinStatus.Standing, PinStatus.Standing, PinStatus.Standing, PinStatus.Standing, PinStatus.Standing, PinStatus.Standing, PinStatus.Standing, PinStatus.Standing, PinStatus.Standing,
0, 0, progress.BeforeThrowState.ThrowMode, ThrowPanelStateStatus.BeforeThrow, progress.AfterThrowState.ThrowCounter, progress.BeforeThrowState.DayId);
actions.Add(nextPlayerAction);
}
foreach (var action in actions)
{

View File

@ -68,8 +68,8 @@ namespace KoogleApp.Store.Game.ThrowPanel
}
else // stop action
{
var gameModel = gameService.FinalizeGameModel();
var gameModel = GameService.FinalizeGameModel();
_gameService = null;
var username = await GetUsername();
await dataService.SaveToDatabaseAndReset(new GameStatus
@ -136,9 +136,9 @@ namespace KoogleApp.Store.Game.ThrowPanel
throwAction.ParticipantsState, throwAction.GameModel));
}
private IGameService _gameService = null;
private IGameService? _gameService = null;
private IGameService gameService
private IGameService? GameService
{
get
{
@ -178,7 +178,7 @@ namespace KoogleApp.Store.Game.ThrowPanel
//var participants = throwAction.ParticipantsState;
var gameSpecificProgress = gameService.HandleThrow(generalGameProgress, dispatcher);
var gameSpecificProgress = GameService.HandleThrow(generalGameProgress, dispatcher);
//foreach (var action in actions)
//{
@ -195,7 +195,7 @@ namespace KoogleApp.Store.Game.ThrowPanel
// save the new state after the throw
dispatcher.Dispatch(new TriggerNewThrowPanelStateChangedAction(true,
gameSpecificProgress.AfterParticipantsState, gameSpecificProgress.GameModel,
null)); // this will trigger ThrowPanelStateChangedAction with the new state (not current _throwPanelState.Value)
gameSpecificProgress.NextThrowState)); // this will trigger ThrowPanelStateChangedAction with the new state (not current _throwPanelState.Value)
}
[EffectMethod]
@ -211,7 +211,7 @@ namespace KoogleApp.Store.Game.ThrowPanel
StartParams: dataService.StartParams,
GameModel: beforeStates.Status.GameModel,
NextThrowState: null);
var afterProgress = gameService.HandleGameButton(action.CallbackName, beforeProgress, dispatcher);
var afterProgress = GameService.HandleGameButton(action.CallbackName, beforeProgress, dispatcher);
dispatcher.Dispatch(new TriggerNewThrowPanelStateChangedAction(true,
afterProgress.AfterParticipantsState, afterProgress.GameModel,

View File

@ -6,7 +6,7 @@
"IsStated": true,
"BellValue": false,
"Pin1State": 0,
"Pin2State": 0,
"Pin2State": 2,
"Pin3State": 0,
"Pin4State": 0,
"Pin5State": 0,
@ -18,50 +18,82 @@
"ThrowCounterPerRound": 0,
"ThrowMode": 0,
"ThrowPanelStateStatus": 2,
"ThrowCounter": 4,
"ThrowCounter": 1,
"DayId": 35
},
"ParticipantsState": {
"PlayerIds": [
5,
3,
10,
12,
9,
5
9
],
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"$type": "TrainingState",
"Throws": {
"5": {
"PlayerId": 5,
"Points": 0
"TeamNr": 0,
"PinCount": 2,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 2,
"BellCount": 0
},
"3": {
"PlayerId": 3,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"10": {
"PlayerId": 10,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"12": {
"PlayerId": 12,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"9": {
"PlayerId": 9,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
}
},
"Version": 12,
"LastModified": "2025-12-05T18:47:21.0093866+01:00",
"Version": 5,
"LastModified": "2025-12-05T19:53:05.533106+01:00",
"LastModifiedBy": "test1@test.de"
},
"UndoHistory": [
@ -79,463 +111,8 @@
"Pin6State": 0,
"Pin7State": 0,
"Pin8State": 0,
"Pin9State": 0,
"ThrowsPerRound": 2147483647,
"ThrowCounterPerRound": 5,
"ThrowMode": 0,
"ThrowPanelStateStatus": 3,
"ThrowCounter": 4,
"DayId": 35
},
"ParticipantsState": {
"PlayerIds": [
5,
3,
10,
12,
9
],
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"5": {
"PlayerId": 5,
"Points": 0
},
"3": {
"PlayerId": 3,
"Points": 0
},
"10": {
"PlayerId": 10,
"Points": 0
},
"12": {
"PlayerId": 12,
"Points": 0
},
"9": {
"PlayerId": 9,
"Points": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
},
"Version": 11,
"LastModified": "2025-12-05T18:47:17.8374707+01:00",
"LastModifiedBy": "test1@test.de"
},
{
"Status": {
"SetupModel": null,
"ThrowPanelState": {
"IsStated": true,
"BellValue": false,
"Pin1State": 0,
"Pin2State": 0,
"Pin3State": 0,
"Pin4State": 1,
"Pin5State": 0,
"Pin6State": 0,
"Pin7State": 1,
"Pin8State": 0,
"Pin9State": 0,
"ThrowsPerRound": 2147483647,
"ThrowCounterPerRound": 4,
"ThrowMode": 0,
"ThrowPanelStateStatus": 2,
"ThrowCounter": 3,
"DayId": 35
},
"ParticipantsState": {
"PlayerIds": [
5,
3,
10,
12,
9
],
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"5": {
"PlayerId": 5,
"Points": 0
},
"3": {
"PlayerId": 3,
"Points": 0
},
"10": {
"PlayerId": 10,
"Points": 0
},
"12": {
"PlayerId": 12,
"Points": 0
},
"9": {
"PlayerId": 9,
"Points": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
},
"Version": 10,
"LastModified": "2025-12-05T18:47:17.8343241+01:00",
"LastModifiedBy": "test1@test.de"
},
{
"Status": {
"SetupModel": null,
"ThrowPanelState": {
"IsStated": true,
"BellValue": false,
"Pin1State": 0,
"Pin2State": 0,
"Pin3State": 0,
"Pin4State": 0,
"Pin5State": 0,
"Pin6State": 0,
"Pin7State": 0,
"Pin8State": 0,
"Pin9State": 0,
"ThrowsPerRound": 2147483647,
"ThrowCounterPerRound": 4,
"ThrowMode": 0,
"ThrowPanelStateStatus": 3,
"ThrowCounter": 3,
"DayId": 35
},
"ParticipantsState": {
"PlayerIds": [
5,
3,
10,
12,
9
],
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"5": {
"PlayerId": 5,
"Points": 0
},
"3": {
"PlayerId": 3,
"Points": 0
},
"10": {
"PlayerId": 10,
"Points": 0
},
"12": {
"PlayerId": 12,
"Points": 0
},
"9": {
"PlayerId": 9,
"Points": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
},
"Version": 9,
"LastModified": "2025-12-05T18:47:13.1885186+01:00",
"LastModifiedBy": "test1@test.de"
},
{
"Status": {
"SetupModel": null,
"ThrowPanelState": {
"IsStated": true,
"BellValue": false,
"Pin1State": 0,
"Pin2State": 0,
"Pin3State": 0,
"Pin4State": 0,
"Pin5State": 0,
"Pin6State": 0,
"Pin7State": 1,
"Pin8State": 0,
"Pin9State": 1,
"ThrowsPerRound": 2147483647,
"ThrowCounterPerRound": 3,
"ThrowMode": 0,
"ThrowPanelStateStatus": 2,
"ThrowCounter": 2,
"DayId": 35
},
"ParticipantsState": {
"PlayerIds": [
5,
3,
10,
12,
9
],
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"5": {
"PlayerId": 5,
"Points": 0
},
"3": {
"PlayerId": 3,
"Points": 0
},
"10": {
"PlayerId": 10,
"Points": 0
},
"12": {
"PlayerId": 12,
"Points": 0
},
"9": {
"PlayerId": 9,
"Points": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
},
"Version": 8,
"LastModified": "2025-12-05T18:47:13.1843425+01:00",
"LastModifiedBy": "test1@test.de"
},
{
"Status": {
"SetupModel": null,
"ThrowPanelState": {
"IsStated": true,
"BellValue": false,
"Pin1State": 0,
"Pin2State": 0,
"Pin3State": 0,
"Pin4State": 0,
"Pin5State": 0,
"Pin6State": 0,
"Pin7State": 0,
"Pin8State": 0,
"Pin9State": 0,
"ThrowsPerRound": 2147483647,
"ThrowCounterPerRound": 3,
"ThrowMode": 0,
"ThrowPanelStateStatus": 3,
"ThrowCounter": 2,
"DayId": 35
},
"ParticipantsState": {
"PlayerIds": [
5,
3,
10,
12,
9
],
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"5": {
"PlayerId": 5,
"Points": 0
},
"3": {
"PlayerId": 3,
"Points": 0
},
"10": {
"PlayerId": 10,
"Points": 0
},
"12": {
"PlayerId": 12,
"Points": 0
},
"9": {
"PlayerId": 9,
"Points": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
},
"Version": 7,
"LastModified": "2025-12-05T18:47:10.8053116+01:00",
"LastModifiedBy": "test1@test.de"
},
{
"Status": {
"SetupModel": null,
"ThrowPanelState": {
"IsStated": true,
"BellValue": false,
"Pin1State": 0,
"Pin2State": 0,
"Pin3State": 0,
"Pin4State": 0,
"Pin5State": 0,
"Pin6State": 0,
"Pin7State": 0,
"Pin8State": 0,
"Pin9State": 0,
"ThrowsPerRound": 2147483647,
"ThrowCounterPerRound": 3,
"ThrowMode": 0,
"ThrowPanelStateStatus": 3,
"ThrowCounter": 2,
"DayId": 35
},
"ParticipantsState": {
"PlayerIds": [
5,
3,
10,
12,
9
],
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"5": {
"PlayerId": 5,
"Points": 0
},
"3": {
"PlayerId": 3,
"Points": 0
},
"10": {
"PlayerId": 10,
"Points": 0
},
"12": {
"PlayerId": 12,
"Points": 0
},
"9": {
"PlayerId": 9,
"Points": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
},
"Version": 6,
"LastModified": "2025-12-05T18:47:10.1805126+01:00",
"LastModifiedBy": "test1@test.de"
},
{
"Status": {
"SetupModel": null,
"ThrowPanelState": {
"IsStated": true,
"BellValue": false,
"Pin1State": 0,
"Pin2State": 0,
"Pin3State": 0,
"Pin4State": 0,
"Pin5State": 0,
"Pin6State": 0,
"Pin7State": 0,
"Pin8State": 0,
"Pin9State": 0,
"ThrowsPerRound": 2147483647,
"ThrowCounterPerRound": 3,
"ThrowMode": 0,
"ThrowPanelStateStatus": 3,
"ThrowCounter": 2,
"DayId": 35
},
"ParticipantsState": {
"PlayerIds": [
5,
3,
10,
12,
9
],
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"5": {
"PlayerId": 5,
"Points": 0
},
"3": {
"PlayerId": 3,
"Points": 0
},
"10": {
"PlayerId": 10,
"Points": 0
},
"12": {
"PlayerId": 12,
"Points": 0
},
"9": {
"PlayerId": 9,
"Points": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
},
"Version": 5,
"LastModified": "2025-12-05T18:47:08.1834513+01:00",
"LastModifiedBy": "test1@test.de"
},
{
"Status": {
"SetupModel": null,
"ThrowPanelState": {
"IsStated": true,
"BellValue": false,
"Pin1State": 0,
"Pin2State": 0,
"Pin3State": 0,
"Pin4State": 0,
"Pin5State": 0,
"Pin6State": 0,
"Pin7State": 1,
"Pin8State": 0,
"Pin9State": 1,
"ThrowsPerRound": 2147483647,
"ThrowsPerRound": 3,
"ThrowCounterPerRound": 2,
"ThrowMode": 0,
"ThrowPanelStateStatus": 2,
@ -553,36 +130,68 @@
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"$type": "TrainingState",
"Throws": {
"5": {
"PlayerId": 5,
"Points": 0
"TeamNr": 0,
"PinCount": 1,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 1,
"BellCount": 0
},
"3": {
"PlayerId": 3,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"10": {
"PlayerId": 10,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"12": {
"PlayerId": 12,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"9": {
"PlayerId": 9,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
}
},
"Version": 4,
"LastModified": "2025-12-05T18:47:08.1754635+01:00",
"LastModified": "2025-12-05T19:53:05.5213738+01:00",
"LastModifiedBy": "test1@test.de"
},
{
@ -600,7 +209,7 @@
"Pin7State": 0,
"Pin8State": 0,
"Pin9State": 0,
"ThrowsPerRound": 2147483647,
"ThrowsPerRound": 3,
"ThrowCounterPerRound": 2,
"ThrowMode": 0,
"ThrowPanelStateStatus": 3,
@ -618,36 +227,68 @@
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"$type": "TrainingState",
"Throws": {
"5": {
"PlayerId": 5,
"Points": 0
"TeamNr": 0,
"PinCount": 1,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 1,
"BellCount": 0
},
"3": {
"PlayerId": 3,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"10": {
"PlayerId": 10,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"12": {
"PlayerId": 12,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"9": {
"PlayerId": 9,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
}
},
"Version": 3,
"LastModified": "2025-12-05T18:47:02.5437025+01:00",
"LastModified": "2025-12-05T19:51:31.2636865+01:00",
"LastModifiedBy": "test1@test.de"
},
{
@ -662,10 +303,10 @@
"Pin4State": 0,
"Pin5State": 0,
"Pin6State": 0,
"Pin7State": 1,
"Pin7State": 0,
"Pin8State": 0,
"Pin9State": 1,
"ThrowsPerRound": 2147483647,
"ThrowsPerRound": 3,
"ThrowCounterPerRound": 1,
"ThrowMode": 0,
"ThrowPanelStateStatus": 2,
@ -683,46 +324,77 @@
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"$type": "TrainingState",
"Throws": {
"5": {
"PlayerId": 5,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"3": {
"PlayerId": 3,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"10": {
"PlayerId": 10,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"12": {
"PlayerId": 12,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"9": {
"PlayerId": 9,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
}
},
"Version": 2,
"LastModified": "2025-12-05T18:47:02.5379121+01:00",
"LastModified": "2025-12-05T19:51:31.2598989+01:00",
"LastModifiedBy": "test1@test.de"
},
{
"Status": {
"SetupModel": {
"$type": "ShitSetupState",
"ShitNumber": 5,
"$type": "TrainingSetupState",
"DayId": 35,
"ThrowMode": 0,
"ThrowsPerRound": 2147483647,
"ThrowsPerRound": 3,
"Participants": [
5,
3,
@ -731,7 +403,7 @@
9
],
"ParticipantsMode": 0,
"KnownGameType": "ShitGame"
"KnownGameType": "GameTraining"
},
"ThrowPanelState": {
"IsStated": true,
@ -745,7 +417,7 @@
"Pin7State": 0,
"Pin8State": 0,
"Pin9State": 0,
"ThrowsPerRound": 2147483647,
"ThrowsPerRound": 3,
"ThrowCounterPerRound": 1,
"ThrowMode": 0,
"ThrowPanelStateStatus": 1,
@ -763,36 +435,68 @@
"Eliminated": []
},
"GameModel": {
"$type": "ShitState",
"Points": {
"$type": "TrainingState",
"Throws": {
"5": {
"PlayerId": 5,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"3": {
"PlayerId": 3,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"10": {
"PlayerId": 10,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"12": {
"PlayerId": 12,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
},
"9": {
"PlayerId": 9,
"Points": 0
"TeamNr": 0,
"PinCount": 0,
"CircleCount": 0,
"SinkCount": 0,
"StrikeCount": 0,
"ClearedCount": 0,
"ThrowCount": 0,
"BellCount": 0
}
},
"CollectedPoints": 0,
"PreviewPointsOk": 0,
"PreviewPointsShit": 0
}
}
},
"Version": 1,
"LastModified": "2025-12-05T17:47:00.1641436Z",
"LastModified": "2025-12-05T18:51:25.875404Z",
"LastModifiedBy": "test1@test.de"
}
],