示例#1
0
        /// <summary>
        /// Get the corresponding <see cref="DPadItem"/> given a <see cref="DPadValue"/>.
        /// </summary>
        /// <param name="value">Value</param>
        /// <returns>Item</returns>
        public static DPadItem From(DPadValue value)
        {
            var all = All();

            foreach (var item in all)
            {
                if (item.Value == value)
                {
                    return(item);
                }
            }
            return(null);
        }
示例#2
0
        private void HandleDPad(byte[] data)
        {
            DPadValue dpad = (DPadValue)data[12];

            if (m_DPadState != dpad)
            {
                if (DPadStateChanged != null)
                {
                    DPadStateChanged(m_GuiTranslater.TranslateDPad((byte)dpad));
                }
                m_DPadState = dpad;
            }
        }
 private void HandleDPad(byte[] data)
 {
     DPadValue dpad = (DPadValue)data[12];
     if (m_DPadState != dpad)
     {
         if (DPadStateChanged != null)
             DPadStateChanged(m_GuiTranslater.TranslateDPad((byte)dpad));
         m_DPadState = dpad;
     }
 }
示例#4
0
 public DPad(DPadValue up, DPadValue right, DPadValue down, DPadValue left)
 {
     Values = new DPadValue[] { up, right, down, left };
 }
示例#5
0
 public DPadItem(DPadValue value, DPadCategory category, string name)
 {
     this.Value    = value;
     this.Category = category;
     this.Name     = name;
 }