Beispiel #1
0
        /// <summary>
        /// Protected because it does not need to be access by inherrited subclasses
        /// If statements would indeed trim the code down quite significantly
        /// </summary>
        /// <param name="suite"></param>
        /// <returns></returns>
        protected string CardColor(Suite_Type suite)
        {
            string colour = "";

            switch (suite)
            {
            case Suite_Type.Diamond:
            case Suite_Type.Hearts:
                colour = "red";
                break;

            case Suite_Type.Clubs:
            case Suite_Type.Spades:
                colour = "black";
                break;
            }
            return(colour);
        }
Beispiel #2
0
 /// <summary>
 /// Implementing the Change of Suite which is an abstract method from Card
 /// This can be different for each card that is instantiated from the abstract card class
 /// </summary>
 /// <param name="suite"></param>
 public override void ChangeSuite(Suite_Type suite)
 {
     this.Suite = suite;
 }
Beispiel #3
0
 /// <summary>
 /// Abstract method that MUST be implemented and can be overriden
 /// </summary>
 /// <param name="suite"></param>
 public abstract void ChangeSuite(Suite_Type suite);