public bool CheckMyRules(JGPlayer player) { //check for confidition if (this.Tour == 0) { JGHand hand = this.m_hands.GetHand(player); if (hand != null) { enuJGExceptionRule c = hand.IsSevenRule() | hand.IsTweentyOneRule(); if (c != enuJGExceptionRule.None) { this.m_GameStart = false; this.m_gameHand.ControlUser = player; this.Winner = player; JGPartyEndEventArgs e = new JGPartyEndEventArgs(); e.Winner = Winner; foreach (JGCard item in hand) { Console.WriteLine("CARD " + item); } switch (c) { case enuJGExceptionRule.None: break; case enuJGExceptionRule.Threeseven: Console.Write("ThreeSEVEN RULE"); break; case enuJGExceptionRule.FourSeven: Console.Write("FourSEVEN RULE"); break; case enuJGExceptionRule.TwentyOneRule: Console.Write("TwentyOneRule RULE"); break; default: break; } e.Reason = (c != enuJGExceptionRule.None) ? enuJGPartyEndReason.ExceptionRule : enuJGPartyEndReason.Normal; e.Rule = c; OnPartyEnded(e); return(true); } } } return(false); }
public JGPartyEndEventArgs(JGPlayer player, enuJGPartyEndReason reason, enuJGExceptionRule exRule) { this.m_Winner = player; this.m_Reason = reason; this.m_Rule = exRule; }