Пример #1
0
        /// <summary>
        /// Constructor for Position
        /// </summary>
        /// <param name="holder">string holding ID of the office holder</param>
        /// <param name="nat">Nationality associated with the position</param>
        public Position(byte id, TitleName[] ti, byte stat, string holder, Nationality nat)
            : base(id, ti, stat)
        {
            // VALIDATION

            // HOLDER
            if (!String.IsNullOrWhiteSpace(holder))
            {
                // trim and ensure 1st is uppercase
                holder = Utility_Methods.FirstCharToUpper(holder.Trim());

                if (!Utility_Methods.ValidateCharacterID(holder))
                {
                    throw new InvalidDataException("Position officeHolder id must have the format 'Char_' followed by some numbers");
                }
            }

            this.officeHolder = holder;
            this.nationality  = nat;
        }
Пример #2
0
 /// <summary>
 /// Constructor for Kingdom using Kingdom_Serialised object.
 /// For use when de-serialising.
 /// </summary>
 /// <param name="ks">Kingdom_Serialised object to use as source</param>
 public Kingdom(Kingdom_Serialised ks)
     : base(ks: ks)
 {
     // nationality to be inserted later
     this.nationality = null;
 }
Пример #3
0
 /// <summary>
 /// Constructor for Kingdom
 /// </summary>
 /// <param name="nat">Kingdom's Nationality object</param>
 public Kingdom(String id, String nam, Nationality nat, String tiHo = null, PlayerCharacter own = null, Rank r = null)
     : base(id, nam, tiHo, own, r)
 {
     this.nationality = nat;
 }
Пример #4
0
 public ClientNationality(Nationality n)
 {
     this.natID   = n.natID;
     this.natName = n.name;
 }