/// <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; }
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)); }
public JoyConPairingEventArgs(JoyCon sourceJoyCon, PairingType pairingType) { SourceJoyCon = sourceJoyCon; PairingType = pairingType; }
public JoyConSplittingEventArgs(JoyCon sourceJoyCon, SplittingType splittingType) { SourceJoyCon = sourceJoyCon; SplittingType = splittingType; }
private bool Equals(JoyCon other) { return(Equals(Guid, other.Guid)); }