Advertisement
Coinage

Class (Players)

May 25th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. // Class for players
  2.  
  3. // Create a class that gets and sets values for each object of a player
  4.  
  5. public class player
  6. {
  7.     public int id { get; set; }
  8.     public string name { get; set; }
  9.     public int face { get; set; }
  10.     // you can add more objects..
  11. }
  12.  
  13. // I don't know all the methods of using classes, but lists work
  14. public static List<player> playerList = new List<player>();
  15.  
  16. // How to use
  17.  
  18. case "add":
  19. playerList.Add(new player { id = m.GetInt(0), name = m.GetString(1), face = m.GetInt(2), ... // If you have more objects });
  20. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement