/// <summary> /// Change l'interface en fonction du type d'exercice séléctionné /// </summary> /// <param name="type"></param> private void ChangeExerciceType(int type) { this.currentType = (TypeMazeGame)type; this.MenuEnabled = true; switch (this.currentType) { case TypeMazeGame.Familiarisation: this.CircuitsEnabled = false; break; case TypeMazeGame.BaseLine: this.CircuitsEnabled = true; this.ActiveAllCircuits(); this.MaxRepetionPlot = 3; break; case TypeMazeGame.Training: this.CircuitsEnabled = true; this.ActiveAllCircuits(); this.MaxRepetionPlot = 20; break; case TypeMazeGame.Reaching: this.CircuitsEnabled = false; this.MaxRepetionPlot = 64; break; case TypeMazeGame.NewCircuit: this.CircuitsEnabled = true; // Désactive le circuit qui à déjà été fait this.CircuitsCheck[this.lastCircuit].Activated = false; this.CircuitsCheck[this.lastCircuit].Checked = false; this.MaxRepetionPlot = 3; break; case TypeMazeGame.After: this.CircuitsEnabled = true; this.ActiveAllCircuits(); this.MaxRepetionPlot = 3; break; default: break; } }
public MazeCircuitMenuViewModel() { this.nav = SimpleIoc.Default.GetInstance <INavigation>(); this.pss = SimpleIoc.Default.GetInstance <ActionRobot>(); this.currentType = TypeMazeGame.Null; this.PreviousViewModelCommand = new RelayCommand(this.GoBack); this.HomeViewModelCommand = new RelayCommand(this.GoHome); this.ChangeExerciceTypeCommand = new RelayCommand <int>(this.ChangeExerciceType); this.ChangerCouleurCommand = new RelayCommand <int>(this.ChangerCouleur); this.StartCommand = new RelayCommand(this.StartGame, this.Start_CanExecute); this.StopCommand = new RelayCommand(this.StopGame, this.Stop_CanExecute); this.PauseCommand = new RelayCommand(this.PauseGame, this.Stop_CanExecute); // De base aucun type n'est coché donc le menu n'est pas accessible this.MenuEnabled = false; this.NewCircuitEnabled = false; // Création de la liste de radio button pour la séléction du circuit this.CircuitsEnabled = false; this.CircuitsCheck = new ObservableCollection <CircuitRadio>(); for (int i = 1; i < 9; i++) { var radio = new CircuitRadio(i.ToString()); this.CircuitsCheck.Add(radio); } this.pathToFile = "Files/Patients/" + singleton.Patient.Nom + singleton.Patient.Prenom + singleton.Patient.DateDeNaissance.ToString().Replace("/", string.Empty) + "/Maze_Circuit"; this.ErrorPlotPoint = new List <DataPoint>(); this.VitessePlotPoint = new List <DataPoint>(); this.MaxRepetionPlot = 10; this.currentColor = TypeColors.Default; this.inPause = false; }