StartFightRoomComponentSystem.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using ET.EventType;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace ET
  5. {
  6. [FriendOfAttribute(typeof(ET.StartFightRoomComponment))]
  7. [FriendOfAttribute(typeof(ET.StartFightRoomInfo))]
  8. public static class StartFightRoomComponentSystem
  9. {
  10. public static void ClearStartFightRoomInfo(this StartFightRoomComponment self)
  11. {
  12. self.startFightRoomInfo?.Dispose();
  13. }
  14. public static async ETTask SetStartFightRoomInfoFromPush(this StartFightRoomComponment self, RoomInfo roomInfo)
  15. {
  16. self.startFightRoomInfo.roomInfo = roomInfo;
  17. await ETTask.CompletedTask;
  18. }
  19. public static void SetOperatorOpType(this StartFightRoomComponment self,int opType)
  20. {
  21. self.startFightRoomInfo.opType = opType;
  22. }
  23. public static void SetStartFightRoomInfoFromCreate(this StartFightRoomComponment self, RoomInfo roomInfo)
  24. {
  25. self.startFightRoomInfo.roomInfo = roomInfo;
  26. }
  27. public static StartFightRoomInfo GetStartFightRoomInfo(this StartFightRoomComponment self)
  28. {
  29. return self.startFightRoomInfo;
  30. }
  31. public static async ETTask SetReadyTimeCount(this StartFightRoomComponment self,long startTimeCount)
  32. {
  33. self.startFightRoomInfo.readyStartTimeCount = startTimeCount;
  34. await ETTask.CompletedTask;
  35. }
  36. public static async ETTask SetSettlementFromPush(this StartFightRoomComponment self, int CurRound, List<PlayerInfo> PlayerInfo)
  37. {
  38. if (self.startFightRoomInfo.settlementInfo == null)
  39. {
  40. self.startFightRoomInfo.settlementInfo = new SettlementInfo();
  41. }
  42. self.startFightRoomInfo.settlementInfo.CurRound = CurRound;
  43. self.startFightRoomInfo.settlementInfo.PlayerInfo = PlayerInfo;
  44. await ETTask.CompletedTask;
  45. }
  46. public static SettlementInfo GetSettlementInfo(this StartFightRoomComponment self)
  47. {
  48. return self.startFightRoomInfo.settlementInfo;
  49. }
  50. }
  51. }