Architektur-Redesign: SignalR-Multiplayer & MVVM
Umfassende Umstrukturierung der SlipItIn-App für eine moderne, zustandsbasierte und SignalR-gestützte Multiplayer-Architektur. Einführung neuer Services für Auth, API, SignalR, lokalen Speicher und Game-State-Management via Dependency Injection. Komplette Neugestaltung der Views (Login, Registrierung, Lobby, Spielbrett) mit MVVM und CommunityToolkit.Mvvm. Navigation jetzt über MAUI Shell mit expliziten Routen. Game-Logik auf Events/Messaging umgestellt, UI und Logik entkoppelt, Echtzeit-Updates integriert. SignalR für alle Spielaktionen inkl. Wiederverbindung und Offline-Queueing. Lokaler Speicher für Auth, Userdaten, GameState und Aktionen. MainPage entfernt, neue Views implementiert. Projektdatei um NuGet-Pakete und Shared-Projekt erweitert. Backend-Änderungen für direkte Spieler-Zuordnung und korrekte EF Core-Relationen. App ist nun robust, testbar und unterstützt Multiplayer- sowie Offline-Szenarien.
This commit is contained in:
49
SlipItIn/Views/GameBoardPage.xaml
Normal file
49
SlipItIn/Views/GameBoardPage.xaml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:views="clr-namespace:SlipItIn.Views"
|
||||
x:Class="SlipItIn.Views.GameBoardPage"
|
||||
Title="Game Board">
|
||||
<Grid>
|
||||
<ScrollView>
|
||||
<VerticalStackLayout Padding="24" Spacing="12">
|
||||
<Label Text="Spielbrett" FontSize="24" FontAttributes="Bold" />
|
||||
<Label Text="{Binding CurrentRound, StringFormat='Runde: {0}'}" />
|
||||
<Label Text="{Binding RoundTimeRemaining, StringFormat='Verbleibende Zeit: {0}s'}" />
|
||||
|
||||
<Button Text="Status aktualisieren" Command="{Binding RefreshStateCommand}" />
|
||||
|
||||
<Label Text="Meine Phrasen" FontAttributes="Bold" />
|
||||
<CollectionView ItemsSource="{Binding MyCards}">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Frame Margin="0,4" Padding="10">
|
||||
<VerticalStackLayout>
|
||||
<Label Text="{Binding Text}" />
|
||||
<HorizontalStackLayout>
|
||||
<Button Text="Slip" Command="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.SubmitSlipCommand}" CommandParameter="{Binding .}" />
|
||||
<Button Text="Beschuldigen" Command="{Binding Source={RelativeSource AncestorType={x:Type ContentPage}}, Path=BindingContext.ChallengeCardCommand}" CommandParameter="{Binding .}" />
|
||||
</HorizontalStackLayout>
|
||||
</VerticalStackLayout>
|
||||
</Frame>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
|
||||
<Label Text="Andere Spieler" FontAttributes="Bold" />
|
||||
<CollectionView ItemsSource="{Binding OtherPlayers}">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Text="{Binding Username}" />
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
|
||||
<ActivityIndicator IsVisible="{Binding IsBusy}" IsRunning="{Binding IsBusy}" />
|
||||
<Label Text="{Binding StatusMessage}" TextColor="OrangeRed" />
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
|
||||
<views:ChallengeNotificationOverlay />
|
||||
</Grid>
|
||||
</ContentPage>
|
||||
Reference in New Issue
Block a user