fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public class Conf
  6. {
  7. public int level { get; set; }
  8. }
  9.  
  10. public static class Game
  11. {
  12. public static Conf _conf;
  13. public static Conf conf {
  14. get {
  15. if (_conf == null) _conf = new Conf(); //Read from file or create
  16. return _conf;
  17. }
  18. set {
  19. _conf = value;
  20. //save conf to file
  21. Console.WriteLine("Conf saved");
  22. }
  23. }
  24. }
  25.  
  26. public static void Main()
  27. {
  28.  
  29. Game.conf.level = 5;
  30. Game.conf.level++;
  31. // Game.conf = Game.conf;
  32. }
  33. }
Success #stdin #stdout 0.01s 14024KB
stdin
Standard input is empty
stdout
Standard output is empty