fix game setup
This commit is contained in:
parent
304caa1d9e
commit
8aff1f5d48
|
|
@ -32,7 +32,14 @@
|
||||||
<MudPaper Class="d-flex align-center justify-center mud-width-full py-0" Style="height: 76px;">
|
<MudPaper Class="d-flex align-center justify-center mud-width-full py-0" Style="height: 76px;">
|
||||||
<MudStack Spacing="0" Wrap="Wrap.Wrap">
|
<MudStack Spacing="0" Wrap="Wrap.Wrap">
|
||||||
<MudChip T="string" Color="Color.Dark" Size="Size.Small">@(ThrowPanelSelectors.GetThrowModeName(ThrowPanelState.Value))</MudChip>
|
<MudChip T="string" Color="Color.Dark" Size="Size.Small">@(ThrowPanelSelectors.GetThrowModeName(ThrowPanelState.Value))</MudChip>
|
||||||
|
@if (@ThrowPanelState.Value.ThrowsPerRound == int.MaxValue)
|
||||||
|
{
|
||||||
|
<MudChip T="string" Color="Color.Dark" Size="Size.Small">Wurf @ThrowPanelState.Value.ThrowCounterPerRound</MudChip>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
<MudChip T="string" Color="Color.Dark" Size="Size.Small">Wurf @ThrowPanelState.Value.ThrowCounterPerRound von @ThrowPanelState.Value.ThrowsPerRound</MudChip>
|
<MudChip T="string" Color="Color.Dark" Size="Size.Small">Wurf @ThrowPanelState.Value.ThrowCounterPerRound von @ThrowPanelState.Value.ThrowsPerRound</MudChip>
|
||||||
|
}
|
||||||
</MudStack>
|
</MudStack>
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
|
|
|
||||||
|
|
@ -106,21 +106,10 @@
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
var setupModel = (dynamicComponentRef.Instance as ISetupControl).GameSetupModel;
|
var setupModel = (dynamicComponentRef.Instance as ISetupControl).GameSetupModel;
|
||||||
setupModel.ParticipantsMode = SetupState.Value.ParticipantsMode;
|
|
||||||
setupModel.DayId = DayState.Value.Id;
|
setupModel.DayId = DayState.Value.Id;
|
||||||
setupModel.KnownGameType = SetupState.Value.Game.GetType().Name;
|
setupModel.KnownGameType = SetupState.Value.Game.GetType().Name;
|
||||||
setupModel.Participants = PlayerIds;
|
setupModel.Participants = PlayerIds;
|
||||||
|
|
||||||
|
|
||||||
// MudDialog.Close(DialogResult.Ok(new StartParams(
|
|
||||||
// DayState.Value.Id,
|
|
||||||
// SetupState.Value.ThrowMode,
|
|
||||||
// SetupState.Value.ThrowsPerRound,
|
|
||||||
// PlayerIds,
|
|
||||||
// SetupState.Value.ParticipantsMode,
|
|
||||||
// SetupState.Value.Game.GetType().Name
|
|
||||||
// )));
|
|
||||||
|
|
||||||
MudDialog.Close(DialogResult.Ok(setupModel));
|
MudDialog.Close(DialogResult.Ok(setupModel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,14 @@
|
||||||
|
|
||||||
@implements ISetupControl
|
@implements ISetupControl
|
||||||
|
|
||||||
<h3>Setup</h3>
|
|
||||||
|
|
||||||
|
<MudItem>
|
||||||
|
<MudNumericField @bind-Value="_shitNumber" Label="Scheiss-Zahl" HelperText="Bei welcher Zahl verliehrt man?" Min="1" Max="9"/>
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
int _shitNumber = 5;
|
||||||
|
|
||||||
public IGameSetupModel GameSetupModel =>
|
public IGameSetupModel GameSetupModel =>
|
||||||
new ShitSetupState()
|
new ShitSetupState()
|
||||||
{
|
{
|
||||||
|
|
@ -17,6 +21,9 @@
|
||||||
ThrowsPerRound = int.MaxValue,
|
ThrowsPerRound = int.MaxValue,
|
||||||
ParticipantsMode = ParticipantsMode.GameLogic,
|
ParticipantsMode = ParticipantsMode.GameLogic,
|
||||||
|
|
||||||
|
} with
|
||||||
|
{
|
||||||
|
ShitNumber = _shitNumber
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@ namespace KoogleApp.Services
|
||||||
}
|
}
|
||||||
services.AddSingleton<IDayRepository, DayRepository>();
|
services.AddSingleton<IDayRepository, DayRepository>();
|
||||||
|
|
||||||
services.AddTransient<GameTrainingService>(); // TODO: add all automatically
|
|
||||||
|
AddAllGameServices(services);
|
||||||
|
|
||||||
services.AddSingleton<IGameStatusDataService, GameStatusDataService>();
|
services.AddSingleton<IGameStatusDataService, GameStatusDataService>();
|
||||||
services.AddSingleton<IGameServiceFactory, GameServiceFactory>();
|
services.AddSingleton<IGameServiceFactory, GameServiceFactory>();
|
||||||
|
|
@ -78,5 +79,21 @@ namespace KoogleApp.Services
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void AddAllGameServices(IServiceCollection services)
|
||||||
|
{
|
||||||
|
var assembly = Assembly.GetAssembly(typeof(GameTrainingService));
|
||||||
|
|
||||||
|
var ns = assembly.FullName.Split(',')[0] + ".Games";
|
||||||
|
var types = assembly.GetTypes().Where(_ => _.IsClass && _.FullName.StartsWith(ns) && !_.IsNested);
|
||||||
|
|
||||||
|
foreach (var type in types)
|
||||||
|
{
|
||||||
|
if (typeof(IGameService).IsAssignableFrom(type))
|
||||||
|
{
|
||||||
|
services.AddTransient(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,92 @@
|
||||||
"Pin1State": 0,
|
"Pin1State": 0,
|
||||||
"Pin2State": 0,
|
"Pin2State": 0,
|
||||||
"Pin3State": 0,
|
"Pin3State": 0,
|
||||||
"Pin4State": 2,
|
"Pin4State": 0,
|
||||||
"Pin5State": 0,
|
"Pin5State": 0,
|
||||||
"Pin6State": 0,
|
"Pin6State": 0,
|
||||||
"Pin7State": 0,
|
"Pin7State": 0,
|
||||||
"Pin8State": 0,
|
"Pin8State": 0,
|
||||||
"Pin9State": 0,
|
"Pin9State": 0,
|
||||||
"ThrowsPerRound": 4,
|
"ThrowsPerRound": 2147483647,
|
||||||
|
"ThrowCounterPerRound": 3,
|
||||||
|
"ThrowMode": 0,
|
||||||
|
"ThrowPanelStateStatus": 3,
|
||||||
|
"ThrowCounter": 2,
|
||||||
|
"DayId": 35
|
||||||
|
},
|
||||||
|
"ParticipantsState": {
|
||||||
|
"PlayerIds": [
|
||||||
|
5,
|
||||||
|
3,
|
||||||
|
10,
|
||||||
|
12,
|
||||||
|
9
|
||||||
|
],
|
||||||
|
"Eliminated": []
|
||||||
|
},
|
||||||
|
"GameModel": null
|
||||||
|
},
|
||||||
|
"Version": 5,
|
||||||
|
"LastModified": "2025-11-28T20:21:51.2059061+01:00",
|
||||||
|
"LastModifiedBy": "test1@test.de"
|
||||||
|
},
|
||||||
|
"UndoHistory": [
|
||||||
|
{
|
||||||
|
"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": 2,
|
"ThrowCounterPerRound": 2,
|
||||||
"ThrowMode": 1,
|
"ThrowMode": 0,
|
||||||
|
"ThrowPanelStateStatus": 2,
|
||||||
|
"ThrowCounter": 1,
|
||||||
|
"DayId": 35
|
||||||
|
},
|
||||||
|
"ParticipantsState": {
|
||||||
|
"PlayerIds": [
|
||||||
|
5,
|
||||||
|
3,
|
||||||
|
10,
|
||||||
|
12,
|
||||||
|
9
|
||||||
|
],
|
||||||
|
"Eliminated": []
|
||||||
|
},
|
||||||
|
"GameModel": null
|
||||||
|
},
|
||||||
|
"Version": 4,
|
||||||
|
"LastModified": "2025-11-28T20:21:51.2025106+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": 2,
|
||||||
|
"ThrowMode": 0,
|
||||||
"ThrowPanelStateStatus": 3,
|
"ThrowPanelStateStatus": 3,
|
||||||
"ThrowCounter": 1,
|
"ThrowCounter": 1,
|
||||||
"DayId": 35
|
"DayId": 35
|
||||||
|
|
@ -31,72 +108,12 @@
|
||||||
],
|
],
|
||||||
"Eliminated": []
|
"Eliminated": []
|
||||||
},
|
},
|
||||||
"GameModel": {
|
"GameModel": null
|
||||||
"$type": "TrainingState",
|
|
||||||
"Throws": {
|
|
||||||
"5": {
|
|
||||||
"PlayerId": 5,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 1,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 1,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"PlayerId": 3,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"10": {
|
|
||||||
"PlayerId": 10,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"12": {
|
|
||||||
"PlayerId": 12,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"9": {
|
|
||||||
"PlayerId": 9,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"Version": 3,
|
"Version": 3,
|
||||||
"LastModified": "2025-11-27T21:06:17.9099848+01:00",
|
"LastModified": "2025-11-28T20:21:37.3278595+01:00",
|
||||||
"LastModifiedBy": "test1@test.de"
|
"LastModifiedBy": "test1@test.de"
|
||||||
},
|
},
|
||||||
"UndoHistory": [
|
|
||||||
{
|
{
|
||||||
"Status": {
|
"Status": {
|
||||||
"SetupModel": null,
|
"SetupModel": null,
|
||||||
|
|
@ -106,15 +123,15 @@
|
||||||
"Pin1State": 0,
|
"Pin1State": 0,
|
||||||
"Pin2State": 0,
|
"Pin2State": 0,
|
||||||
"Pin3State": 0,
|
"Pin3State": 0,
|
||||||
"Pin4State": 1,
|
"Pin4State": 0,
|
||||||
"Pin5State": 0,
|
"Pin5State": 0,
|
||||||
"Pin6State": 0,
|
"Pin6State": 0,
|
||||||
"Pin7State": 0,
|
"Pin7State": 0,
|
||||||
"Pin8State": 0,
|
"Pin8State": 0,
|
||||||
"Pin9State": 0,
|
"Pin9State": 1,
|
||||||
"ThrowsPerRound": 4,
|
"ThrowsPerRound": 2147483647,
|
||||||
"ThrowCounterPerRound": 1,
|
"ThrowCounterPerRound": 1,
|
||||||
"ThrowMode": 1,
|
"ThrowMode": 0,
|
||||||
"ThrowPanelStateStatus": 2,
|
"ThrowPanelStateStatus": 2,
|
||||||
"ThrowCounter": 0,
|
"ThrowCounter": 0,
|
||||||
"DayId": 35
|
"DayId": 35
|
||||||
|
|
@ -129,78 +146,20 @@
|
||||||
],
|
],
|
||||||
"Eliminated": []
|
"Eliminated": []
|
||||||
},
|
},
|
||||||
"GameModel": {
|
"GameModel": null
|
||||||
"$type": "TrainingState",
|
|
||||||
"Throws": {
|
|
||||||
"5": {
|
|
||||||
"PlayerId": 5,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"PlayerId": 3,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"10": {
|
|
||||||
"PlayerId": 10,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"12": {
|
|
||||||
"PlayerId": 12,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"9": {
|
|
||||||
"PlayerId": 9,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"Version": 2,
|
"Version": 2,
|
||||||
"LastModified": "2025-11-27T21:06:17.8971982+01:00",
|
"LastModified": "2025-11-28T20:21:37.3160306+01:00",
|
||||||
"LastModifiedBy": "test1@test.de"
|
"LastModifiedBy": "test1@test.de"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Status": {
|
"Status": {
|
||||||
"SetupModel": {
|
"SetupModel": {
|
||||||
"$type": "TrainingSetupState",
|
"$type": "ShitSetupState",
|
||||||
|
"ShitNumber": 6,
|
||||||
"DayId": 35,
|
"DayId": 35,
|
||||||
"ThrowMode": 1,
|
"ThrowMode": 0,
|
||||||
"ThrowsPerRound": 4,
|
"ThrowsPerRound": 2147483647,
|
||||||
"Participants": [
|
"Participants": [
|
||||||
5,
|
5,
|
||||||
3,
|
3,
|
||||||
|
|
@ -208,8 +167,8 @@
|
||||||
12,
|
12,
|
||||||
9
|
9
|
||||||
],
|
],
|
||||||
"ParticipantsMode": 1,
|
"ParticipantsMode": 0,
|
||||||
"KnownGameType": "GameTraining"
|
"KnownGameType": "ShitGame"
|
||||||
},
|
},
|
||||||
"ThrowPanelState": {
|
"ThrowPanelState": {
|
||||||
"IsStated": true,
|
"IsStated": true,
|
||||||
|
|
@ -223,9 +182,9 @@
|
||||||
"Pin7State": 0,
|
"Pin7State": 0,
|
||||||
"Pin8State": 0,
|
"Pin8State": 0,
|
||||||
"Pin9State": 0,
|
"Pin9State": 0,
|
||||||
"ThrowsPerRound": 4,
|
"ThrowsPerRound": 2147483647,
|
||||||
"ThrowCounterPerRound": 1,
|
"ThrowCounterPerRound": 1,
|
||||||
"ThrowMode": 1,
|
"ThrowMode": 0,
|
||||||
"ThrowPanelStateStatus": 1,
|
"ThrowPanelStateStatus": 1,
|
||||||
"ThrowCounter": 0,
|
"ThrowCounter": 0,
|
||||||
"DayId": 35
|
"DayId": 35
|
||||||
|
|
@ -240,69 +199,10 @@
|
||||||
],
|
],
|
||||||
"Eliminated": []
|
"Eliminated": []
|
||||||
},
|
},
|
||||||
"GameModel": {
|
"GameModel": null
|
||||||
"$type": "TrainingState",
|
|
||||||
"Throws": {
|
|
||||||
"5": {
|
|
||||||
"PlayerId": 5,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"3": {
|
|
||||||
"PlayerId": 3,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"10": {
|
|
||||||
"PlayerId": 10,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"12": {
|
|
||||||
"PlayerId": 12,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
},
|
|
||||||
"9": {
|
|
||||||
"PlayerId": 9,
|
|
||||||
"TeamNr": 0,
|
|
||||||
"PinCount": 0,
|
|
||||||
"CircleCount": 0,
|
|
||||||
"SinkCount": 0,
|
|
||||||
"StrikeCount": 0,
|
|
||||||
"ClearedCount": 0,
|
|
||||||
"ThrowCount": 0,
|
|
||||||
"BellCount": 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"Version": 1,
|
"Version": 1,
|
||||||
"LastModified": "2025-11-27T20:06:09.3170916Z",
|
"LastModified": "2025-11-28T19:21:26.4095956Z",
|
||||||
"LastModifiedBy": "test1@test.de"
|
"LastModifiedBy": "test1@test.de"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue