Example #1
0
        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();
        }
Example #2
0
        protected override void OnInitialize(ModuleConfiguration configuration)
        {
            InteractionConfig interactionConfig = configuration as InteractionConfig;

            DefaultInteraction     = interactionConfig.DefaultInteraction;
            DefaultDeadInteraction = interactionConfig.DefaultDeadInteraction;

            var circleCollider = Owner.GetComponent <CircleCollider2D>();

            if (circleCollider != null)
            {
                InteractionRange = circleCollider.radius;
            }
            else
            {
                InteractionRange = 0;
            }
        }
Example #3
0
    public void ChangeInteraction(InteractionType interactionId)
    {
        var config = GetConfigForId(interactionId);

        Debug.Assert(config != null);

        if (currentInteraction != null)
        {
            currentInteraction.interactionInterface.SetActive(false);
        }

        currentInteraction = config;

        if (currentInteraction != null)
        {
            currentInteraction.interactionInterface.SetActive(true);
        }

        ChartEditor.Instance.events.editorInteractionTypeChangedEvent.Fire(interactionId);
    }