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++)
{
Cell? cell = board.GetCell(y, i);
if (cell != null && cell.IsFree == false)
if (cell != null && !cell.IsFree)
{
Tile? tile = cell.GetTile;
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
{
@ -7,6 +11,8 @@
InitializeComponent();
MainPage = new AppShell();
Routing.RegisterRoute(nameof(SetPlayers), typeof(SetPlayers));
}
}
}

@ -20,23 +20,25 @@
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></controls:ButtonShadow>
<controls:ButtonShadow></controls:ButtonShadow>
<controls:ButtonShadow Text="{Binding Button5.Text}"/>
<controls:ButtonShadow Text="{Binding Button6.Text}"/>
</VerticalStackLayout>
</ScrollView>
</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
{
int count = 0;
public MainPage()
{
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>()
.ConfigureFonts(fonts =>
{
//fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
//fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("DiloWorld.ttf", "DiloWorld");
fonts.AddFont("Lexend-Medium.ttf", "Lexend-Meduim");
});

@ -11,17 +11,22 @@
Text="SetPlayers"
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></controls:EntryPlayer>
<controls:EntryPlayer TextIn="{Binding Entry4.TextIn}"
TextOn="{Binding Entry4.TextOn}"/>
<Button Text="Confirm"
Style="{StaticResource ConfirmButton}"/>
Style="{StaticResource ConfirmButton}"
Clicked="OnButtonContinueClick"/>
</VerticalStackLayout>
</ScrollView>

@ -1,3 +1,6 @@
using Qwirkle.Views;
using QwirkleClassLibrary.Games;
namespace Qwirkle.Pages;
public partial class SetPlayers : ContentPage
@ -5,5 +8,39 @@ public partial class SetPlayers : ContentPage
public SetPlayers()
{
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" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\QwirkleClassLibrary\QwirkleClassLibrary.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Pages\Leaderboard.xaml.cs">
<DependentUpon>Leaderboard.xaml</DependentUpon>

@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
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">
<Button
Text="Example"
Style="{StaticResource MainButton}"/>
<Border.Shadow>
<Shadow></Shadow>
</Border.Shadow>
<Button
Text="{Binding Text, Source={x:Reference root}}"
Style="{StaticResource MainButton}"
Clicked="OnInfoClicked"/>
<Border.Shadow>
<Shadow></Shadow>
</Border.Shadow>
</Border>
</ContentView>

@ -1,3 +1,5 @@
using Microsoft.Maui;
namespace Qwirkle.Views;
public partial class ButtonShadow : ContentView
@ -6,4 +8,20 @@ public partial class ButtonShadow : ContentView
{
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" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
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">
<Label
Text="Players X"
Text="{Binding TextOn, Source={x:Reference root}}"
Style="{StaticResource ContentStart}"/>
<Entry Text="Entry tag of player X"/>
<Entry Text="{Binding TextIn, Source={x:Reference root}}"/>
</VerticalStackLayout>
</ContentView>

@ -1,9 +1,27 @@
namespace Qwirkle.Views;
using Microsoft.Maui.Controls;
public partial class EntryPlayer : ContentView
{
public EntryPlayer()
{
InitializeComponent();
}
public EntryPlayer()
{
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