Пример #1
0
        /// <summary>
        /// Create a standard card of type
        /// </summary>
        /// <param name="type">
        /// A <see cref="StandardCardTypes"/>
        /// </param>
        public StandardCard(StandardCardTypes type, StandardCardValues value)
            : base()
        {
            if (type == StandardCardTypes.Joker && value != StandardCardValues.None)
            {
                string message = string.Format("Unable to create Standard Card of type {0} with a value assigned. (Expected {1} for value.)", type, StandardCardValues.None);
                throw new ArgumentException(message);
            }

            Id = Guid.NewGuid();
            Name = Type.ToString();
            Type = type;
            Value = value;
            ValidateStandardCardArguments();
        }
Пример #2
0
 /// <summary>
 /// Create a card that has the specified id and name
 /// </summary>
 /// <param name="id">
 /// The id of the card
 /// </param>
 /// <param name="name">
 /// The name of the card
 /// </param>
 public StandardCard(Guid id, string name, StandardCardTypes type, StandardCardValues value)
     : this(type, value)
 {
     Id = id;
 }
Пример #3
0
 /// <summary>
 /// Create a card with the specified name
 /// </summary>
 /// <param name="name">
 /// A <see cref="System.String"/>
 /// </param>
 public StandardCard(string name, StandardCardTypes type, StandardCardValues value)
     : this(type, value)
 {
     Name = name;
 }
Пример #4
0
 /// <summary>
 /// Create a standard card without a value. For now, this can only be used to create a joker.
 /// </summary>
 /// <param name="type"></param>
 public StandardCard(StandardCardTypes type)
     : base()
 {
     Type = type;
     ValidateStandardCardArguments();
 }