Esempio n. 1
0
        public JoyStickXYZ AnalyseDataForRotationJoyStickXYZ(List <JoystickUpdate> joystickUpdates)
        {
            JoyStickXYZ current = _previousRotationJoyStickXYZ.Clone();

            foreach (var ju in joystickUpdates)
            {
                if (ju.Offset == JoystickOffset.RotationX)
                {
                    current.X = ju.Value;
                }
                else if (ju.Offset == JoystickOffset.RotationY)
                {
                    current.Y = ju.Value;
                }
                else if (ju.Offset == JoystickOffset.RotationZ)
                {
                    current.Z = ju.Value;
                }
            }

            if (current.Equals(this._previousRotationJoyStickXYZ))
            {
                return(null);
            }
            else
            {
                this._previousRotationJoyStickXYZ = current;
                return(current);
            }
        }
            public override bool Equals(object obj)
            {
                JoyStickXYZ o = obj as JoyStickXYZ;

                return(this.X == o.X && this.Y == o.Y && this.Z == o.Z);
            }