Exemple #1
0
 /// <inheritdoc />
 private void Start()
 {
     InteractControl          = Resources.Load <Control>("Managers/InputManager/Interact");
     CurrentDialogueReference = Resources.Load <CurrentDialogue>("DialogueSystem/CurrentDialogue");
     paramsInstance           = new QuestNpcParams()
     {
         NpcTransform       = transform,
         Npc                = this,
         NavAgent           = GetComponent <NavMeshAgent>(),
         Animator           = GetComponent <Animator>(),
         OriginPosistion    = transform.position,
         MovementType       = Options.MovementType,
         WanderDistance     = Options.WanderDistance,
         IdleTime           = Options.IdleTime,
         TimeLeftIdle       = Options.IdleTime,
         PatrolPoints       = Options.PatrolPoints,
         CurrentPatrolPoint = Options.StartingPatrolPoint,
         Player             = FindObjectOfType <PlayerController>(),
         Dialogue           = Options.Dialogue
     };
     stateMachine = new UStateMachine <QuestNpcParams>(paramsInstance, new Conversing(), new Idle(), new Move());
     stateMachine.SetState(typeof(Idle), paramsInstance);
     _manipulationType             = Manipulations.Normal;
     paramsInstance.NavAgent.speed = paramsInstance.MovementSpeed * TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier;
     paramsInstance.Animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;
 }
        public IActionResult Post()
        {
            var randomPerson = Manipulations.GetDataByUrl(Settings.RandomUser);
            var quote        = Manipulations.GetDataByUrl(Settings.Quote);

            var person = Manipulations.PersonParseFromJson(randomPerson, quote);

            try
            {
                db.Persons.Add(person);
                db.SaveChanges();

                using (var client = new HttpClient())
                {
                    client.BaseAddress = new Uri(Settings.Localhost);
                    var response = client.GetAsync($"getpoem/{person.Id}").Result;

                    if (response.StatusCode == System.Net.HttpStatusCode.InternalServerError)
                    {
                        return(StatusCode(StatusCodes.Status500InternalServerError));
                    }
                    else
                    {
                        return(StatusCode(StatusCodes.Status201Created));
                    }
                }
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
Exemple #3
0
        public IActionResult Get(int id)
        {
            try
            {
                var poemsString = Manipulations.GetDataByUrl(Settings.Poems);
                var poems       = JsonSerializer.Deserialize <List <Poem> >(poemsString);
                var etalonPoem  = Settings.EtalonPoem;

                var poem     = Manipulations.GetRandomPoem(poems);
                var distance = JaroWinklerDistance.distance(poem, etalonPoem);

                var person = new Person()
                {
                    Poem     = poem,
                    Distance = Math.Round(distance, 2)
                };

                using (var client = new HttpClient())
                {
                    client.BaseAddress = new Uri(Settings.Localhost);
                    var res = client.PostAsJsonAsync($"getinfo/{id}", person).Result;
                }

                return(StatusCode(StatusCodes.Status200OK));
            }
            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
 public Assign(Manipulations logic)
 {
     InitializeComponent();
     this.Logic = logic;
     cbStudent.Items.AddRange(Logic.GetAllStudents().OrderBy(student => student.Name).ToArray());
     Courses = Logic.GetAllCourses();
 }
Exemple #5
0
 /// <summary>
 /// Starts time manipulation on the gameobject.
 /// </summary>
 /// <param name="type">The integer index of the Manipulations enum that represents the type of manipulation.</param>
 public void StartTimeManipulation(int type)
 {
     _timeBeingManipulated         = true;
     _manipulationType             = (Manipulations)type;
     paramsInstance.NavAgent.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier;
     paramsInstance.Animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;
     //_animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;
 }
Exemple #6
0
 /// <summary>
 /// Stops the time manipulation.
 /// </summary>
 public void StopTimeManipulation()
 {
     _timeBeingManipulated = false;
     _manipulationType     = Manipulations.Normal;
     Animator.speed        = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;
     _localTimeScale       = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.PhysicsModifier;
     //_animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;
 }
Exemple #7
0
 public void Reset()
 {
     if (File != null)
     {
         File.Reset(Manipulations.Keys.Select(m => ( int )m.SetId));
         Manipulations.Clear();
     }
 }
 public Edit(Manipulations logic, string objectName)
 {
     InitializeComponent();
     tId.ReadOnly    = false;
     bDelete.Visible = false;
     this.Logic      = logic;
     this.ObjectName = objectName;
 }
Exemple #9
0
 /// <summary>
 /// Stops time manipulation on the gameobject.
 /// </summary>
 public void StopTimeManipulation()
 {
     _timeBeingManipulated         = false;
     _manipulationType             = Manipulations.Normal;
     paramsInstance.NavAgent.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier;
     paramsInstance.Animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;
     //_animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;
 }
Exemple #10
0
 public void Reset()
 {
     FaceFile?.Reset();
     HairFile?.Reset();
     BodyFile?.Reset();
     HeadFile?.Reset();
     Manipulations.Clear();
 }
Exemple #11
0
 /// <summary>
 /// Starts the time manipulation.
 /// </summary>
 /// <param name="type">The type.</param>
 public void StartTimeManipulation(int type)
 {
     _timeBeingManipulated = true;
     _manipulationType     = (Manipulations)type;
     Animator.speed        = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;;
     _localTimeScale       = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.PhysicsModifier;
     //_animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;
 }
 public Edit(Manipulations logic, Course course)
 {
     InitializeComponent();
     this.Logic  = logic;
     this.Course = course;
     tId.Text    = Course.Id.ToString();
     tName.Text  = Course.Name;
     tYear.Text  = Course.Year;
 }
 public Edit(Manipulations logic, Student student)
 {
     InitializeComponent();
     this.Logic   = logic;
     this.Student = student;
     tId.Text     = Student.Id.ToString();
     tName.Text   = Student.Name;
     tYear.Text   = Student.Year;
 }
Exemple #14
0
        public void Reset()
        {
            foreach (var file in Files)
            {
                file?.Reset(Manipulations.Keys.Where(m => m.FileIndex() == file.Index).Select(m => ( int )m.SetId));
            }

            Manipulations.Clear();
        }
Exemple #15
0
        public void Reset()
        {
            if (File == null)
            {
                return;
            }

            File.Reset(Manipulations.Keys.Select(m => (m.SubRace, m.Attribute)));
            Manipulations.Clear();
        }
Exemple #16
0
        => Files[Array.IndexOf(CharacterUtility.EqdpIndices, CharacterUtility.EqdpIdx(race, accessory))];           // TODO: female Hrothgar

        public void Dispose()
        {
            for (var i = 0; i < Files.Length; ++i)
            {
                Files[i]?.Dispose();
                Files[i] = null;
            }

            Manipulations.Clear();
        }
Exemple #17
0
        public bool RevertMod(RspManipulation m)
        {
#if USE_CMP
            if (Manipulations.Remove(m))
            {
                var def   = CmpFile.GetDefault(m.SubRace, m.Attribute);
                var manip = new RspManipulation(m.SubRace, m.Attribute, def);
                return(manip.Apply(File !));
            }
#endif
            return(false);
        }
Exemple #18
0
 public void Dispose()
 {
     FaceFile?.Dispose();
     HairFile?.Dispose();
     BodyFile?.Dispose();
     HeadFile?.Dispose();
     FaceFile = null;
     HairFile = null;
     BodyFile = null;
     HeadFile = null;
     Manipulations.Clear();
 }
Exemple #19
0
        public bool RevertMod(GmpManipulation m)
        {
#if USE_GMP
            if (Manipulations.Remove(m))
            {
                var def   = ExpandedGmpFile.GetDefault(m.SetId);
                var manip = new GmpManipulation(def, m.SetId);
                return(manip.Apply(File !));
            }
#endif
            return(false);
        }
        public OPOForm(Manipulations logic)
        {
            InitializeComponent();
            this.logic = logic;
            comboBoxFase.Items.Add(Enums.Fase.fase1);
            comboBoxFase.Items.Add(Enums.Fase.fase2);
            comboBoxFase.Items.Add(Enums.Fase.fase3);

            comboBoxSemester.Items.Add(Semester.sem1);
            comboBoxSemester.Items.Add(Semester.sem2);

            comboBoxResp.Items.AddRange(logic.lecturers.ToArray());
        }
Exemple #21
0
        public bool RevertMod(EqdpManipulation m)
        {
#if USE_EQDP
            if (Manipulations.Remove(m))
            {
                var def   = ExpandedEqdpFile.GetDefault(Names.CombinedRace(m.Gender, m.Race), m.Slot.IsAccessory(), m.SetId);
                var file  = Files[Array.IndexOf(CharacterUtility.EqdpIndices, m.FileIndex())] !;
                var manip = new EqdpManipulation(def, m.Slot, m.Gender, m.Race, m.SetId);
                return(manip.Apply(file));
            }
#endif
            return(false);
        }
        /// <summary>
        /// Implementation of <see cref="FilterManipulation"/> that forces the center of mass of the
        /// manipulation target to remain inside its container.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public static void ClampCenterOfMass(object sender, Manipulations.FilterManipulationEventArgs args)
        {
            var inputProcessor = sender as Manipulations.InputProcessor;
            var target = inputProcessor.Target;
            var container = inputProcessor.Reference;

            // Get the bounding box and the center of mass of the manipulation target,
            // expressed in the coordinate system of its container
            var rect = target.RenderTransform.TransformBounds(
                new Windows.Foundation.Rect(0, 0, target.ActualWidth, target.ActualHeight));

            var centerOfMass = new Windows.Foundation.Point
            {
                X = rect.Left + (rect.Width / 2),
                Y = rect.Top + (rect.Height / 2)
            };

            // Apply delta transform to the center of mass
            var transform = new Windows.UI.Xaml.Media.CompositeTransform
            {
                CenterX = args.Pivot.X,
                CenterY = args.Pivot.Y,
                Rotation = args.Delta.Rotation,
                ScaleX = args.Delta.Scale,
                ScaleY = args.Delta.Scale,
                TranslateX = args.Delta.Translation.X,
                TranslateY = args.Delta.Translation.Y
            };

            var transformedCenterOfMass = transform.TransformPoint(centerOfMass);

            // Reset the transformation if the transformed center of mass falls outside the container
            if (transformedCenterOfMass.X < 0 || transformedCenterOfMass.X > container.ActualWidth ||
                transformedCenterOfMass.Y < 0 || transformedCenterOfMass.Y > container.ActualHeight)
            {
                args.Delta = new Windows.UI.Input.ManipulationDelta
                {
                    Rotation = 0F,
                    Scale = 1F,
                    Translation = new Windows.Foundation.Point(0, 0)
                };
            }
        }
Exemple #23
0
        public bool RevertMod(EstManipulation m)
        {
#if USE_EST
            if (Manipulations.Remove(m))
            {
                var def   = EstFile.GetDefault(m.Slot, Names.CombinedRace(m.Gender, m.Race), m.SetId);
                var manip = new EstManipulation(m.Gender, m.Race, m.Slot, m.SetId, def);
                var file  = m.Slot switch
                {
                    EstManipulation.EstType.Hair => HairFile !,
                    EstManipulation.EstType.Face => FaceFile !,
                    EstManipulation.EstType.Body => BodyFile !,
                    EstManipulation.EstType.Head => HeadFile !,
                    _ => throw new ArgumentOutOfRangeException(),
                };
                return(manip.Apply(file));
            }
#endif
            return(false);
        }
 private void Start()
 {
     Setup();
     DeathSound = Options.DeathSound;
     GetAudioQueue();
     paramsInstance = new ShootingAIParams()
     {
         NpcTransform       = transform,
         Npc                = this,
         NavAgent           = GetComponent <NavMeshAgent>(),
         Animator           = GetComponent <Animator>(),
         OriginPosistion    = transform.position,
         MovementType       = Options.MovementType,
         WanderDistance     = Options.WanderDistance,
         IdleTime           = Options.IdleTime,
         TimeLeftIdle       = Options.IdleTime,
         PatrolPoints       = Options.PatrolPoints,
         CurrentPatrolPoint = Options.StartingPatorlPoint,
         Player             = FindObjectOfType <PlayerController>(),
         AggroDistance      = Options.AggroDistance,
         LoseAggroDistance  = Options.LoseAggroDistance,
         RigidBody          = GetComponent <Rigidbody>(),
         MovementSpeed      = Options.MovementSpeed,
         TimeBetweenAttacks = Options.TimeBetweenAttacks,
         BulletPrefab       = Options.BulletPrefab,
         ShootDelay         = Options.ShootDelay,
         Renderer           = Renderer,
         Chase              = Options.Chase,
         ChaseDistance      = Options.ChaseDistance,
         ShootingSound      = Options.ShootingSound,
         DeathSound         = Options.DeathSound
     };
     stateMachine = new UStateMachine <ShootingAIParams>(paramsInstance, new Chase(), new Attacking(), new Idle(), new Move());
     stateMachine.SetState(typeof(Idle), paramsInstance);
     _manipulationType             = Manipulations.Normal;
     paramsInstance.NavAgent.speed = paramsInstance.MovementSpeed * TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier;
     paramsInstance.Animator.speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.AnimationModifier;
     //paramsInstance.MovementModifier = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier;
     _localTimeScale = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.PhysicsModifier;
 }
        /// <summary>
        /// Implementation of <see cref="FilterManipulation"/> that forces at least <see cref="ManipulationFilter.TargetMinSize"/>
        /// pixels of the manipulation target to remain inside its container.
        /// This filter also makes sure the manipulation target does not become too small or too big.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public static void Clamp(object sender, Manipulations.FilterManipulationEventArgs args)
        {
            var inputProcessor = sender as Manipulations.InputProcessor;
            var target = inputProcessor.Target;
            var container = inputProcessor.Reference;

            // Get the bounding box of the manipulation target, expressed in the coordinate system of its container
            var rect = target.RenderTransform.TransformBounds(
                new Windows.Foundation.Rect(0, 0, target.ActualWidth, target.ActualHeight));

            // Make sure the manipulation target does not go completely outside the boundaries of its container
            var translate = new Windows.Foundation.Point
            {
                X = args.Delta.Translation.X,
                Y = args.Delta.Translation.Y
            };
            if ((args.Delta.Translation.X > 0 && args.Delta.Translation.X > container.ActualWidth - rect.Left - ManipulationFilter.TargetMinInside) ||
                (args.Delta.Translation.X < 0 && args.Delta.Translation.X < ManipulationFilter.TargetMinInside - rect.Right) ||
                (args.Delta.Translation.Y > 0 && args.Delta.Translation.Y > container.ActualHeight - rect.Top - ManipulationFilter.TargetMinInside) ||
                (args.Delta.Translation.Y < 0 && args.Delta.Translation.Y < ManipulationFilter.TargetMinInside - rect.Bottom))
            {
                translate.X = 0;
                translate.Y = 0;
            }

            // Make sure the manipulation target does not become too small, or too big
            float scale = args.Delta.Scale < 1F ?
                (float)System.Math.Max(ManipulationFilter.TargetMinSize / System.Math.Min(rect.Width, rect.Height), args.Delta.Scale) :
                (float)System.Math.Min(ManipulationFilter.TargetMaxSize / System.Math.Max(rect.Width, rect.Height), args.Delta.Scale);

            args.Delta = new Windows.UI.Input.ManipulationDelta
            {
                Expansion = args.Delta.Expansion,
                Rotation = args.Delta.Rotation,
                Scale = scale,
                Translation = translate
            };
        }
 //Set events for buttons
 public Overview()
 {
     InitializeComponent();
     Logic = new Manipulations();
 }
Exemple #27
0
 public NewLecturer(Manipulations logic)
 {
     InitializeComponent();
     this.logic = logic;
 }
Exemple #28
0
 public void Dispose()
 {
     File?.Dispose();
     File = null;
     Manipulations.Clear();
 }
 /// <summary>
 /// Starts the time manipulation.
 /// </summary>
 /// <param name="type">The type.</param>
 public void StartTimeManipulation(int type)
 {
     _timeBeingManipulated = true;
     _manipulationType     = (Manipulations)type;
     Speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier;
 }
 /// <summary>
 /// Stops the time manipulation.
 /// </summary>
 public void StopTimeManipulation()
 {
     _timeBeingManipulated = true;
     _manipulationType     = Manipulations.Normal;
     Speed = TimeInfo.Data.SingleOrDefault(x => x.Type == _manipulationType).Stats.MovementModifier;
 }
Exemple #31
0
 public MainForm()
 {
     InitializeComponent();
     logic = new Manipulations();
     Reload();
 }
Exemple #32
0
 public OLAForm(Manipulations logic, OLA ola)
 {
     InitializeComponent();
     this.logic = logic;
     this.ola   = ola;
 }