|
|
@ -21,18 +21,29 @@ namespace TheGameExtreme.view
|
|
|
|
LoadParameterNbPlayerGamePreparation();
|
|
|
|
LoadParameterNbPlayerGamePreparation();
|
|
|
|
|
|
|
|
|
|
|
|
SelectMode.ItemsSource = listGameMode;
|
|
|
|
SelectMode.ItemsSource = listGameMode;
|
|
|
|
SelectMode.SelectedIndex = 0;
|
|
|
|
LoadParameterGameModeValueGamePreparation();
|
|
|
|
|
|
|
|
|
|
|
|
SelectNbStack.ItemsSource = listNbStack;
|
|
|
|
SelectNbStack.ItemsSource = listNbStack;
|
|
|
|
SelectNbStack.SelectedIndex = 0;
|
|
|
|
LoadParameterNbStacksGamePreparation();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async void Back(object sender, EventArgs e)
|
|
|
|
private async void Back(object sender, EventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
IOGamePreparation.SaveParamaterGamePreparationNbPlayers(PlayerSelecter.SelectedIndex);
|
|
|
|
|
|
|
|
IOGamePreparation.SaveParameterGamePreparationGameModeValue(SelectMode.SelectedIndex);
|
|
|
|
|
|
|
|
IOGamePreparation.SaveParameterGamePreparationNbStacks(SelectNbStack.SelectedIndex);
|
|
|
|
await Navigation.PopAsync();
|
|
|
|
await Navigation.PopAsync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override bool OnBackButtonPressed()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
IOGamePreparation.SaveParamaterGamePreparationNbPlayers(PlayerSelecter.SelectedIndex);
|
|
|
|
|
|
|
|
IOGamePreparation.SaveParameterGamePreparationGameModeValue(SelectMode.SelectedIndex);
|
|
|
|
|
|
|
|
IOGamePreparation.SaveParameterGamePreparationNbStacks(SelectNbStack.SelectedIndex);
|
|
|
|
|
|
|
|
return base.OnBackButtonPressed();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async void Play(object sender, EventArgs args)
|
|
|
|
private async void Play(object sender, EventArgs args)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -48,7 +59,9 @@ namespace TheGameExtreme.view
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
IOGamePreparation.SaveParamaterGamePreparation(PlayerSelecter.SelectedIndex);
|
|
|
|
IOGamePreparation.SaveParamaterGamePreparationNbPlayers(PlayerSelecter.SelectedIndex);
|
|
|
|
|
|
|
|
IOGamePreparation.SaveParameterGamePreparationGameModeValue(SelectMode.SelectedIndex);
|
|
|
|
|
|
|
|
IOGamePreparation.SaveParameterGamePreparationNbStacks(SelectNbStack.SelectedIndex);
|
|
|
|
await Navigation.PushAsync(new MainPage(playersNames, (int)SelectNbStack.SelectedItem, (int)SelectMode.SelectedIndex));
|
|
|
|
await Navigation.PushAsync(new MainPage(playersNames, (int)SelectNbStack.SelectedItem, (int)SelectMode.SelectedIndex));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -80,10 +93,22 @@ namespace TheGameExtreme.view
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public void LoadParameterNbPlayerGamePreparation()
|
|
|
|
public void LoadParameterNbPlayerGamePreparation()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int nbJoueurs = IOGamePreparation.LoadParameterGamePreparation();
|
|
|
|
int nbJoueurs = IOGamePreparation.LoadParameterGamePreparationNbPlayers();
|
|
|
|
PlayerSelecter.SelectedIndex = nbJoueurs;
|
|
|
|
PlayerSelecter.SelectedIndex = nbJoueurs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void LoadParameterGameModeValueGamePreparation()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int gameModeValue = IOGamePreparation.LoadParameterGamePreparationGameModeValue();
|
|
|
|
|
|
|
|
SelectMode.SelectedIndex = gameModeValue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void LoadParameterNbStacksGamePreparation()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int nbStackSer = IOGamePreparation.LoadParamaterGamePreparationNbStacks();
|
|
|
|
|
|
|
|
SelectNbStack.SelectedIndex = nbStackSer;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|