the xaml edit is BACCKK BABY ! Welcome to data bidding, wait teacher for 2 question :
continuous-integration/drone/push Build is passing Details

- where create game
- when get back entry
test_old_branch
Jérémy Mouyon 11 months ago
parent bd7d748c7d
commit c5027304b0

@ -227,7 +227,7 @@ static void ShowBoard(Game game)
for (int y = 0; y < board.Columns; y++) for (int y = 0; y < board.Columns; y++)
{ {
Cell? cell = board.GetCell(y, i); Cell? cell = board.GetCell(y, i);
if (cell != null && cell.IsFree == false) if (cell != null && !cell.IsFree)
{ {
Tile? tile = cell.GetTile; Tile? tile = cell.GetTile;
if (tile != null) if (tile != null)

@ -1,4 +1,8 @@
namespace Qwirkle using Qwirkle.Views;
using Microsoft.Maui.Controls;
using Qwirkle.Pages;
namespace Qwirkle
{ {
public partial class App : Application public partial class App : Application
{ {
@ -7,6 +11,8 @@
InitializeComponent(); InitializeComponent();
MainPage = new AppShell(); MainPage = new AppShell();
Routing.RegisterRoute(nameof(SetPlayers), typeof(SetPlayers));
} }
} }
} }

@ -20,23 +20,25 @@
Aspect="AspectFit" Aspect="AspectFit"
/> />
<!-- Play / Continue / Leaderboard / Rules / Settings / Credits -->
<controls:ButtonShadow></controls:ButtonShadow> <controls:ButtonShadow
Text="{Binding Button1.Text}"
InfoClicked="OnInfoClicked"
/>
<!-- <controls:ButtonShadow Text="{Binding button2.Text}"/> -->
<controls:ButtonShadow></controls:ButtonShadow> <controls:ButtonShadow Text="{Binding Button3.Text} "/>
<controls:ButtonShadow></controls:ButtonShadow> <controls:ButtonShadow Text="{Binding Button4.Text}"/>
<controls:ButtonShadow></controls:ButtonShadow> <controls:ButtonShadow Text="{Binding Button5.Text}"/>
<controls:ButtonShadow></controls:ButtonShadow> <controls:ButtonShadow Text="{Binding Button6.Text}"/>
<controls:ButtonShadow></controls:ButtonShadow>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView> </ScrollView>
</ContentPage> </ContentPage>

@ -1,25 +1,68 @@
namespace Qwirkle using Qwirkle.Views;
using QwirkleClassLibrary;
using QwirkleClassLibrary.Games;
using Microsoft.Maui.Controls;
using Qwirkle.Pages;
namespace Qwirkle
{ {
public partial class MainPage : ContentPage public partial class MainPage : ContentPage
{ {
int count = 0;
public MainPage() public MainPage()
{ {
InitializeComponent(); InitializeComponent();
BindingContext = this;
} }
/*private void OnCounterClicked(object sender, EventArgs e)
public ButtonShadow Button1 { get; set; }
= new ButtonShadow
{
Text = "Play"
};
public ButtonShadow Button2 { get; set; }
= new ButtonShadow
{
Text = "Continue"
};
public ButtonShadow Button3 { get; set; }
= new ButtonShadow
{
Text = "Leaderboard"
};
public ButtonShadow Button4 { get; set; }
= new ButtonShadow
{
Text = "Rules"
};
public ButtonShadow Button5 { get; set; }
= new ButtonShadow
{
Text = "Settings"
};
public ButtonShadow Button6 { get; set; }
= new ButtonShadow
{
Text = "Credits"
};
void OnInfoClicked(object sender, EventArgs e)
{ {
count++; Game game = new Game();
DisplayAlert("Game notification", "Enter minimun 2 player and max 4 player !", "Ok ! Lets's go !");
Navigation.PushAsync(new SetPlayers());
}
if (count == 1)
CounterBtn.Text = $"Clicked {count} time";
else
CounterBtn.Text = $"Clicked {count} times";
SemanticScreenReader.Announce(CounterBtn.Text);
}*/
} }
} }

@ -11,8 +11,6 @@ namespace Qwirkle
.UseMauiApp<App>() .UseMauiApp<App>()
.ConfigureFonts(fonts => .ConfigureFonts(fonts =>
{ {
//fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
//fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("DiloWorld.ttf", "DiloWorld"); fonts.AddFont("DiloWorld.ttf", "DiloWorld");
fonts.AddFont("Lexend-Medium.ttf", "Lexend-Meduim"); fonts.AddFont("Lexend-Medium.ttf", "Lexend-Meduim");
}); });

@ -11,17 +11,22 @@
Text="SetPlayers" Text="SetPlayers"
Style="{StaticResource Title}"/> Style="{StaticResource Title}"/>
<controls:EntryPlayer></controls:EntryPlayer> <controls:EntryPlayer TextIn="{Binding Entry1.TextIn}"
TextOn="{Binding Entry1.TextOn}"/>
<controls:EntryPlayer TextIn="{Binding Entry2.TextIn}"
TextOn="{Binding Entry2.TextOn}"/>
<controls:EntryPlayer></controls:EntryPlayer> <controls:EntryPlayer TextIn="{Binding Entry3.TextIn}"
TextOn="{Binding Entry3.TextOn}"/>
<controls:EntryPlayer></controls:EntryPlayer> <controls:EntryPlayer TextIn="{Binding Entry4.TextIn}"
TextOn="{Binding Entry4.TextOn}"/>
<controls:EntryPlayer></controls:EntryPlayer>
<Button Text="Confirm" <Button Text="Confirm"
Style="{StaticResource ConfirmButton}"/> Style="{StaticResource ConfirmButton}"
Clicked="OnButtonContinueClick"/>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView> </ScrollView>

@ -1,3 +1,6 @@
using Qwirkle.Views;
using QwirkleClassLibrary.Games;
namespace Qwirkle.Pages; namespace Qwirkle.Pages;
public partial class SetPlayers : ContentPage public partial class SetPlayers : ContentPage
@ -5,5 +8,39 @@ public partial class SetPlayers : ContentPage
public SetPlayers() public SetPlayers()
{ {
InitializeComponent(); InitializeComponent();
} BindingContext = this;
}
public EntryPlayer Entry1 { get; set; }
= new EntryPlayer
{
TextOn = "Player 1",
TextIn = "Entry tag of player 1"
};
public EntryPlayer Entry2 { get; set; }
= new EntryPlayer
{
TextOn = "Player 2",
TextIn = "Entry tag of player 2"
};
public EntryPlayer Entry3 { get; set; }
= new EntryPlayer
{
TextOn = "Player 3",
TextIn = "Entry tag of player 3"
};
public EntryPlayer Entry4 { get; set; }
= new EntryPlayer
{
TextOn = "Player 4",
TextIn = "Entry tag of player 4"
};
void OnButtonContinueClick(object sender, EventArgs e)
{
string entry1 = Entry1.TextIn;
DisplayAlert("Game notification", entry1, "Ok ! Lets's go !");
}
} }

@ -69,6 +69,10 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\QwirkleClassLibrary\QwirkleClassLibrary.csproj" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Pages\Leaderboard.xaml.cs"> <Compile Update="Pages\Leaderboard.xaml.cs">
<DependentUpon>Leaderboard.xaml</DependentUpon> <DependentUpon>Leaderboard.xaml</DependentUpon>

@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Qwirkle.Views.ButtonShadow"> x:Class="Qwirkle.Views.ButtonShadow"
x:Name="root">
<Border Stroke="Transparent"> <Border Stroke="Transparent">
<Button <Button
Text="Example" Text="{Binding Text, Source={x:Reference root}}"
Style="{StaticResource MainButton}"/> Style="{StaticResource MainButton}"
<Border.Shadow> Clicked="OnInfoClicked"/>
<Shadow></Shadow>
</Border.Shadow> <Border.Shadow>
<Shadow></Shadow>
</Border.Shadow>
</Border> </Border>
</ContentView> </ContentView>

@ -1,3 +1,5 @@
using Microsoft.Maui;
namespace Qwirkle.Views; namespace Qwirkle.Views;
public partial class ButtonShadow : ContentView public partial class ButtonShadow : ContentView
@ -6,4 +8,20 @@ public partial class ButtonShadow : ContentView
{ {
InitializeComponent(); InitializeComponent();
} }
public static readonly BindableProperty TextProperty =
BindableProperty.Create("Text", typeof(string), typeof(Button), "none");
public string Text
{
get => (string)GetValue(TextProperty);
set => SetValue(TextProperty, value);
}
public event EventHandler InfoClicked;
void OnInfoClicked(object sender, EventArgs args)
{
InfoClicked?.Invoke(this, args);
}
} }

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Qwirkle.Views.EntryPlayer"> x:Class="Qwirkle.Views.EntryPlayer"
x:Name="root">
<VerticalStackLayout Padding="10"> <VerticalStackLayout Padding="10">
<Label <Label
Text="Players X" Text="{Binding TextOn, Source={x:Reference root}}"
Style="{StaticResource ContentStart}"/> Style="{StaticResource ContentStart}"/>
<Entry Text="Entry tag of player X"/> <Entry Text="{Binding TextIn, Source={x:Reference root}}"/>
</VerticalStackLayout> </VerticalStackLayout>
</ContentView> </ContentView>

@ -1,9 +1,27 @@
namespace Qwirkle.Views; namespace Qwirkle.Views;
using Microsoft.Maui.Controls;
public partial class EntryPlayer : ContentView public partial class EntryPlayer : ContentView
{ {
public EntryPlayer() public EntryPlayer()
{ {
InitializeComponent(); InitializeComponent();
} }
public static readonly BindableProperty TextInProperty =
BindableProperty.Create("TextIn", typeof(string), typeof(Button), "none");
public string TextIn
{
get => (string)GetValue(TextInProperty);
set => SetValue(TextInProperty, value);
}
public static readonly BindableProperty TextOnProperty =
BindableProperty.Create("TextOn", typeof(string), typeof(Button), "none");
public string TextOn
{
get => (string)GetValue(TextOnProperty);
set => SetValue(TextOnProperty, value);
}
} }
Loading…
Cancel
Save