public bool RaiseHand(Participant participant, Hand.EHandType handType) { lock (this.hands) { if (this.hands.IsEmpty(h => h.Participant == participant)) { int idx = 0; for (; idx < this.hands.Count; ++idx) { if (GetPrio(this.hands[idx].HandType) > GetPrio(handType)) { break; } } this.hands.Insert(idx, new Hand(participant, handType)); return(true); } } return(false); }
private void RaiseHand(Hand.EHandType hand) { Participant participant = ConnectionMapping <Participant> .Instance[this.Context.ConnectionId]; participant?.RaiseHand(hand); }
private static int GetPrio(Hand.EHandType handType) => (int)handType;