Ejemplo n.º 1
0
        /// <summary>
        /// Pair this joycon with an other joycon and around
        /// </summary>
        /// <param name="joyCon"></param>
        internal void PairWith(JoyCon joyCon)
        {
            if (IsPaired)
            {
                throw new InvalidOperationException("Already paired");
            }

            Logger.Info("Pairing " + joyCon + " with " + this);

            PairedJoyCon        = joyCon;
            joyCon.PairedJoyCon = this;
        }
Ejemplo n.º 2
0
        internal JoyConPair(JoyCon leftJoyCon, JoyCon rightJoyCon)
        {
            if (leftJoyCon.Type != JoyConType.Left)
            {
                throw new ArgumentException("Left JoyCon is not marked as LEFT");
            }
            if (rightJoyCon.Type != JoyConType.Right)
            {
                throw new ArgumentException("Right JoyCon is not marked as RIGHT");
            }

            LeftJoyCon  = leftJoyCon;
            RightJoyCon = rightJoyCon;

            LeftJoyCon.DataUpdated  += (sender, args) => DataUpdated?.Invoke(this, new JoyConDataUpdateEventArgs(this, args.JoyConState));
            RightJoyCon.DataUpdated += (sender, args) => DataUpdated?.Invoke(this, new JoyConDataUpdateEventArgs(this, args.JoyConState));
        }
Ejemplo n.º 3
0
 public JoyConPairingEventArgs(JoyCon sourceJoyCon, PairingType pairingType)
 {
     SourceJoyCon = sourceJoyCon;
     PairingType  = pairingType;
 }
Ejemplo n.º 4
0
 public JoyConSplittingEventArgs(JoyCon sourceJoyCon, SplittingType splittingType)
 {
     SourceJoyCon  = sourceJoyCon;
     SplittingType = splittingType;
 }
Ejemplo n.º 5
0
 private bool Equals(JoyCon other)
 {
     return(Equals(Guid, other.Guid));
 }