RoomConfig.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using ShadowStudio.Model;
  2. using Studio.WebSocket.Message;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. public class RoomConfig:BaseConfig
  7. {
  8. private string id;
  9. private string type;
  10. private string room_name;
  11. private string room_explain;
  12. private string room_password;
  13. private string max_member;
  14. private string room_type;
  15. private string number;
  16. private List<GoodsInfo> goods_list;
  17. private string nick_name;
  18. private string is_created;
  19. public string Id { get => id; set => id = value; }
  20. public string Type { get => type; set => type = value; }
  21. public string Room_name { get => room_name; set => room_name = value; }
  22. public string Room_explain { get => room_explain; set => room_explain = value; }
  23. public string Room_password { get => room_password; set => room_password = value; }
  24. public string Max_member { get => max_member; set => max_member = value; }
  25. public string Room_type { get => room_type; set => room_type = value; }
  26. public string Number { get => number; set => number = value; }
  27. public List<GoodsInfo> Goods_list { get => goods_list; set => goods_list = value; }
  28. public string Nick_name { get => nick_name; set => nick_name = value; }//房间创始人的名字
  29. public string Is_created { get => is_created; set => is_created = value; }//是否是自己创建的 1是 0不是
  30. public RoomConfig(string id, string type, string room_name, string room_explain, string room_password, string max_member, string room_type, string number, string nick_name, string is_created, List<GoodsInfo> goods_list = null)
  31. {
  32. this.id = id;
  33. this.type = type;
  34. this.room_name = room_name;
  35. this.room_explain = room_explain;
  36. this.room_password = room_password;
  37. this.max_member = max_member;
  38. this.room_type = room_type;
  39. this.number = number;
  40. this.nick_name = nick_name;
  41. this.is_created = is_created;
  42. this.goods_list = goods_list;
  43. }
  44. public RoomConfig(RoomNetData roomNetData, string is_created)
  45. {
  46. this.goods_list = new List<GoodsInfo>();
  47. for (int j = 0, goodCount = roomNetData.goods.Count; j < goodCount; j++)
  48. {
  49. GoodsInfo goodsInfo = new GoodsInfo();
  50. goodsInfo.id = roomNetData.goods[j].id;
  51. goodsInfo.art_id = roomNetData.goods[j].art_id;
  52. goods_list.Add(goodsInfo);
  53. }
  54. this.id = roomNetData.roomID.ToString();
  55. this.type = roomNetData.type.ToString();
  56. this.room_name = roomNetData.roomName;
  57. this.room_explain = roomNetData.roomExplain;
  58. this.room_password = roomNetData.roomPassword;
  59. this.max_member = roomNetData.maxMember.ToString();
  60. this.room_type = roomNetData.roomType.ToString();
  61. this.number = roomNetData.number.ToString();
  62. this.nick_name = roomNetData.nickName.ToString();
  63. this.is_created = is_created;
  64. }
  65. }