Пример #1
0
        /// <summary>
        /// Compare to another state.
        /// </summary>
        /// <param name="state"></param>
        /// <returns></returns>
        public string[] CompareTo(DirectInputActivity state)
        {
            var list = new List <string>();

            list.AddRange(CompareAxisAndSliders(Axis, state.Axis, "Axis"));
            list.AddRange(CompareAxisAndSliders(Sliders, state.Sliders, "Slider"));
            // Compare Buttons
            if (Buttons.Length == state.Buttons.Length)
            {
                for (int i = 0; i < Buttons.Length; i++)
                {
                    if (Buttons[i] != state.Buttons[i])
                    {
                        list.Add(string.Format("Button{0}", i + 1));
                    }
                }
            }
            ;
            // Compare Pows.
            if (Pows.Length == state.Pows.Length)
            {
                for (int i = 0; i < Pows.Length; i++)
                {
                    if (Pows[i] != state.Pows[i])
                    {
                        list.Add(string.Format("DPad{0} {1}", i + 1, ""));
                    }
                }
            }
            ;
            return(list.ToArray());
        }
		/// <summary>
		/// Compare to another state.
		/// </summary>
		/// <param name="state"></param>
		/// <returns></returns>
		public string[] CompareTo(DirectInputActivity state)
		{
			var list = new List<string>();
			list.AddRange(CompareAxisAndSliders(Axis, state.Axis, "Axis"));
			list.AddRange(CompareAxisAndSliders(Sliders, state.Sliders, "Slider"));
			// Compare Buttons
			if (Buttons.Length == state.Buttons.Length)
			{
				for (int i = 0; i < Buttons.Length; i++)
				{
					if (Buttons[i] != state.Buttons[i])
					{
						list.Add(string.Format("Button{0}", i + 1));
					}
				}
			};
			// Compare Pows.
			if (Pows.Length == state.Pows.Length)
			{
				for (int i = 0; i < Pows.Length; i++)
				{
					if (Pows[i] != state.Pows[i])
					{
						list.Add(string.Format("DPad{0} {1}", i + 1, ""));
					}
				}
			};
			return list.ToArray();
		}