public static Card56ErrorData GetRoundSuitCardExistsErrorData(string suit) { Card56ErrorData error = new Card56ErrorData(); error.Suit = suit; return(error); }
public static Card56ErrorData GetMustPlayTheTrumpCardErrorData(string thuruppuCard) { Card56ErrorData error = new Card56ErrorData(); error.ThuruppuCard = thuruppuCard; return(error); }
public static Card56ErrorData GetMustPlayTrumpSuitErrorData(string trumpSuit) { Card56ErrorData error = new Card56ErrorData(); error.TrumpSuit = trumpSuit; return(error); }
public static Card56ErrorData GetNotHighBidderErrorData(string playerName) { Card56ErrorData error = new Card56ErrorData(); error.PlayerName = playerName; return(error); }
public static Card56ErrorData GetCardNotOfRoundSuitErrorData(string suit) { Card56ErrorData error = new Card56ErrorData(); error.Suit = suit; return(error); }
public static Card56ErrorData GetBidOutOfRangeErrorData(int MinBid, int MaxBid) { Card56ErrorData error = new Card56ErrorData(); error.MinBid = MinBid; error.MaxBid = MaxBid; return(error); }
public RoundSuitCardExistsException(string suit) : base(Cards56Error.RoundSuitCardExistsException, Card56ErrorData.GetRoundSuitCardExistsErrorData(suit)) { }
public MustPlayTheTrumpCardException(string thuruppuCard) : base(Cards56Error.MustPlayTheTrumpCardException, Card56ErrorData.GetMustPlayTheTrumpCardErrorData(thuruppuCard)) { }
public MustPlayTrumpSuitException(string trumpSuit) : base(Cards56Error.MustPlayTrumpSuitException, Card56ErrorData.GetMustPlayTrumpSuitErrorData(trumpSuit)) { }
public CardNotOfRoundSuitException(string suit) : base(Cards56Error.CardNotOfRoundSuitException, Card56ErrorData.GetCardNotOfRoundSuitErrorData(suit)) { }
public NotHighBidderException(string playerName) : base(Cards56Error.NotHighBidderException, Card56ErrorData.GetNotHighBidderErrorData(playerName)) { }
public BidOutOfRangeException(int MinBid, int MaxBid) : base(Cards56Error.BidOutOfRangeException, Card56ErrorData.GetBidOutOfRangeErrorData(MinBid, MaxBid)) { }
public NotPlayersTurnException(string playerName) : base(Cards56Error.NotPlayersTurnException, Card56ErrorData.GetNotPlayersTurnErrorData(playerName)) { }
public Card56Exception(int errorCode, Card56ErrorData errorData = null) : base() { ErrorData = (errorData != null)? errorData: new Card56ErrorData(); ErrorData.ErrorCode = errorCode; ErrorData.ErrorName = this.GetType().Name; string StringsDir = Card56Exception.AssemblyDirectory + System.IO.Path.DirectorySeparatorChar + "locale"; _catalog = new Catalog("strings", StringsDir, Thread.CurrentThread.CurrentCulture); Message = _catalog.GetString(Cards56Error.MSG[errorCode]); switch (errorCode) { case Cards56Error.NotPlayersTurnException: Debug.Assert(errorData != null); if (errorData != null) { Message = string.Format(Message, errorData.PlayerName); } break; case Cards56Error.BidOutOfRangeException: Debug.Assert(errorData != null); if (errorData != null) { Message = string.Format(Message, errorData.MinBid, errorData.MaxBid); } break; case Cards56Error.NotHighBidderException: Debug.Assert(errorData != null); if (errorData != null) { Message = string.Format(Message, errorData.PlayerName); } break; case Cards56Error.CardNotOfRoundSuitException: Debug.Assert(errorData != null); if (errorData != null) { Message = string.Format(Message, errorData.Suit); } break; case Cards56Error.MustPlayTheTrumpCardException: Debug.Assert(errorData != null); if (errorData != null) { Message = string.Format(Message, errorData.ThuruppuCard); } break; case Cards56Error.MustPlayTrumpSuitException: Debug.Assert(errorData != null); if (errorData != null) { Message = string.Format(Message, errorData.TrumpSuit); } break; case Cards56Error.RoundSuitCardExistsException: Debug.Assert(errorData != null); if (errorData != null) { Message = string.Format(Message, errorData.Suit); } break; } }