StorPlayer.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Island.StandardLib.Math;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace Island.StandardLib.Storage.Local
  6. {
  7. public class StorPlayer : IStorable
  8. {
  9. public int Star;
  10. public string NickName, Password;
  11. public void ReadFromData(DataStorage data)
  12. {
  13. data.Read(out Star);
  14. data.Read(out NickName);
  15. data.Read(out Password);
  16. }
  17. public void WriteToData(DataStorage data)
  18. {
  19. data.Write(Star);
  20. data.Write(NickName);
  21. data.Write(Password);
  22. }
  23. public StorPlayerPublic CreatePublic()
  24. {
  25. StorPlayerPublic sp = new StorPlayerPublic();
  26. sp.NickName = NickName;
  27. sp.Star = Star;
  28. return sp;
  29. }
  30. }
  31. public class StorPlayerPublic : IStorable
  32. {
  33. public int Star;
  34. public string NickName;
  35. public void ReadFromData(DataStorage data)
  36. {
  37. data.Read(out Star);
  38. data.Read(out NickName);
  39. }
  40. public void WriteToData(DataStorage data)
  41. {
  42. data.Write(Star);
  43. data.Write(NickName);
  44. }
  45. }
  46. }