Advertisement
Guest User

Untitled

a guest
Aug 18th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. public class Player
  2. {
  3.     // Constructor - guarantees that navi and chipset will never be null (unless later changed)
  4.     public Player(Navi navi, ChipSet chipSet)
  5.     {
  6.         if (navi == null) throw new ArgumentNullException();
  7.         if (chipSet == null) throw new ArgumentNullException();
  8.        
  9.         Navi = navi;
  10.         ChipSet = chipSet;
  11.     }
  12.  
  13.     public int Wins { get; set; }
  14.     public Navi Navi { get; set; } // A local variable of the type "Navi" which is also named "Navi"
  15.     public ChipSet ChipSet { get; set; }
  16. }
  17.  
  18. public class Navi
  19. {
  20.     public const int HARD_LIFE_CAP = 2000; // Better as a static object of type "GameSettings" or something similar
  21.    
  22.     public Point Position { get; set; }
  23.     public int Life { get; set; }
  24.     public int LifeMax { get; set; }
  25.    
  26.     public Texture2D Sprite { get; set; } // Ideally there should be a separate class that contains per-sprite frame data
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement