|
|
@ -18,7 +18,7 @@ namespace TheGameExtreme.view
|
|
|
|
OnPropertyChanged("InstructionText");
|
|
|
|
OnPropertyChanged("InstructionText");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public List<string> listNbPlayer = new List<string> { "1", "2", "3", "4", "5" };
|
|
|
|
public List<int> listNbPlayer = new List<int> { 1, 2, 3, 4, 5 };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public GamePreparationPage()
|
|
|
|
public GamePreparationPage()
|
|
|
@ -28,6 +28,7 @@ namespace TheGameExtreme.view
|
|
|
|
Instruction.SetBinding(Label.TextProperty, new Binding("InstructionText", source: this));
|
|
|
|
Instruction.SetBinding(Label.TextProperty, new Binding("InstructionText", source: this));
|
|
|
|
InstructionText = AppRessource.StrPlayerSelection;
|
|
|
|
InstructionText = AppRessource.StrPlayerSelection;
|
|
|
|
PlayerSelecter.ItemsSource = listNbPlayer;
|
|
|
|
PlayerSelecter.ItemsSource = listNbPlayer;
|
|
|
|
|
|
|
|
PlayerSelecter.SelectedIndex = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async void Back(object sender, EventArgs e)
|
|
|
|
private async void Back(object sender, EventArgs e)
|
|
|
@ -37,22 +38,33 @@ namespace TheGameExtreme.view
|
|
|
|
|
|
|
|
|
|
|
|
private async void Play(object sender, EventArgs args)
|
|
|
|
private async void Play(object sender, EventArgs args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await Navigation.PushAsync(new MainPage());
|
|
|
|
List<string> playersNames = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < NameList.Children.Count; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
playersNames.Add(((Entry)NameList.Children[i]).Text);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await Navigation.PushAsync(new MainPage(playersNames));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ChangedPseudo(object sender, EventArgs args)
|
|
|
|
private void ChangedPseudo(object sender, EventArgs args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
while (NameList.Children.Count != (int)PlayerSelecter.SelectedItem)
|
|
|
|
while (NameList.Children.Count != (int)PlayerSelecter.SelectedItem)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (NameList.Children.Count < (int)PlayerSelecter.SelectedItem)
|
|
|
|
if (NameList.Children.Count < (int)PlayerSelecter.SelectedItem)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Editor e = new Editor();
|
|
|
|
Entry e = new Entry
|
|
|
|
e.Placeholder = "Enter your pseudo";
|
|
|
|
{
|
|
|
|
|
|
|
|
Placeholder = "Enter your pseudo",
|
|
|
|
|
|
|
|
BackgroundColor = (Color)Application.Current.Resources["SkyBlueColor"]
|
|
|
|
|
|
|
|
};
|
|
|
|
NameList.Children.Add(e);
|
|
|
|
NameList.Children.Add(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
NameList.Children.RemoveAt(NameList.Children.Count-1);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|