Exemplo n.º 1
0
 public Contestant(string name, IPDStrategy strategy)
 {
     if (string.IsNullOrEmpty(name)) throw new ArgumentNullException("name", "name can not be null or empty");
       if (strategy == null) throw new NullReferenceException("Strategy not set");
       Name = name;
       Strategy = strategy;
       LastChoice = null;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor used to establish the prisoner name and the strategy that they are adopting
        /// </summary>
        /// <param name="name"></param>
        /// <param name="strategy"></param>
        public Prisoner(string name, IPDStrategy strategy)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name", "name can not be null or empty");
            }
            if (strategy == null)
            {
                throw new NullReferenceException("Strategy not set");
            }

            Name       = name;
            Strategy   = strategy;
            LastChoice = null;
        }