//Ajuste le X de la poulie en fonction de la symétrie choisie private void DefinirX(TypeSymetriePoulies typeSymetrie, double x) { double tempX; if (Type == TypePoulies.Gauche) { if (typeSymetrie == TypeSymetriePoulies.VsHorloge || typeSymetrie == TypeSymetriePoulies.JssHorloge) { X = (x + Rayon); } else if (typeSymetrie == TypeSymetriePoulies.VsAntiHorloge || typeSymetrie == TypeSymetriePoulies.JssAntiHorloge) { X = (x - Rayon); } tempX = (int)EchelleUtils.MiseEchelleEnvoyerX(this.X); this.X = (int)EchelleUtils.MiseEchelleX(tempX); } else if (Type == TypePoulies.Droite) { //if (typeSymetrie == TypeSymetriePoulies.VsHorloge || typeSymetrie == TypeSymetriePoulies.JssAntiHorloge) // this.X = (x + Rayon); if (typeSymetrie == TypeSymetriePoulies.VsAntiHorloge || typeSymetrie == TypeSymetriePoulies.JssHorloge) { this.X = (x - (2 * Rayon)); } else { this.X = x; } //tempX = (int)EchelleUtils.MiseEchelleEnvoyerX2(this.X); //this.X = (int)EchelleUtils.MiseEchelleX2(tempX); } }
public ExercicePoulies(ExerciceBaseConfig baseConf, ExerciceBorneConfig borneConf, ThemeEvaluationModel theme, InteractionConfig configInt, TypeSymetriePoulies typeS, TypeExercicePoulies typeE, int decalage) : base(baseConf, borneConf, theme) { TypeSymetrie = typeS; TypeExercice = typeE; Decalage = decalage; ConfigInteraction = configInt; if (this.TypeSymetrie == TypeSymetriePoulies.JssHorloge || this.TypeSymetrie == TypeSymetriePoulies.JssAntiHorloge) { ConfigInteraction.Jss = true; } else { ConfigInteraction.Vs = true; } Plats = new ObservableCollection <Plateau>(); Plateau plat = new Plateau(850, 70, TypePlateau.Normal, typeE); Plateau platFantome = new Plateau(850, 70, TypePlateau.Fantome, typeE); Plats.Add(platFantome); Plats.Add(plat); //ajuste l'emplacement des poulies en fonction de la taille du plateau. double xPoulieGauche = Plats[1].X; PoulieGauche = new Poulie(xPoulieGauche, TypePoulies.Gauche, TypeSymetrie); double xPoulieDroite = PoulieGauche.X + Plats[1].Width; PoulieDroite = new Poulie(xPoulieDroite, TypePoulies.Droite, TypeSymetrie); //Permet aux plateaux de ne pas dépacer les poulies Plats[0].HauteurMax = PoulieGauche.Y + PoulieGauche.Rayon + PoulieGauche.Taille; Plats[1].HauteurMax = PoulieGauche.Y + PoulieGauche.Rayon + PoulieGauche.Taille; BarreVerticale = new PointCollection(); BarreVerticale.Add(new Point(Plats[1].X + Plats[1].Width / 2, (PoulieGauche.Y + PoulieGauche.Rayon + PoulieGauche.Taille) - 50)); BarreVerticale.Add(new Point(Plats[1].X + Plats[1].Width / 2, Plats[1].Y + Plats[1].Height / 2)); this.PourcentageAssistance = 0; this.ValeurSliderAssist = -1; DefinirDureePause(); }
public Poulie(double x, TypePoulies type, TypeSymetriePoulies typeSymetrie) { _nbrSegements = 50; Points = new PointCollection(); Rayon = 8; Y = 89; Taille = 15;//30 MiseEchelle(); this.Type = type; DefinirX(typeSymetrie, x); Couleur = new SolidColorBrush(Color.FromRgb(153, 76, 0)); CreerCercle(); }
public static ExerciceEvaluation GetExerciceEvaluation(string type, ThemeEvaluationModel themeEnfant, TypeExercicePoulies typeExopoulies, TypeSymetriePoulies sym, int decalage) { ExerciceEvaluation exo; switch (type) { case "poulies": exo = new ExercicePoulies(ExerciceConfig.GetBaseConfig(), ExerciceConfig.GetBigBorne(), themeEnfant, new InteractionConfig(), sym, typeExopoulies, decalage); break; default: exo = new ExerciceEvaluation(ExerciceConfig.GetBaseConfig(), ExerciceConfig.GetBigBorne(), null); break; } return(exo); }