Magnamura_de

Untitled

Apr 6th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. /// <summary>
  6. /// Object Class for a Card
  7. /// </summary>
  8. public class Card
  9. {
  10.     private string face;
  11.     private string suit;
  12.  
  13.     /// <summary>
  14.     /// Initiates the Class.
  15.     /// </summary>
  16.     /// <param name="face">string</param>
  17.     /// <param name="suit">string</param>
  18.     public Card(string face, string suit)
  19.     {
  20.         // Neat Stuff happens here with the "this" Keyword
  21.         this.face = face;
  22.         this.suit = suit;
  23.     }
  24.     /// <summary>
  25.     /// Returns readable Stuff instead of "Class.Card"
  26.     /// </summary>
  27.     /// <returns>string: x of y</returns>
  28.     /// <remarks>
  29.     /// https://www.dotnetperls.com/override
  30.     /// </remarks>
  31.     public override string ToString()
  32.     {
  33.         return this.face + " of " + this.suit;
  34.  
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment