Room.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System.Collections.Generic;
  2. namespace ET
  3. {
  4. [ChildOf]
  5. [ComponentOf]
  6. public class Room: Entity, IScene, IAwake, IUpdate
  7. {
  8. public Fiber Fiber { get; set; }
  9. public IScene Root { get; set; }
  10. public SceneType SceneType { get; set; } = SceneType.Room;
  11. public string Name { get; set; }
  12. public long StartTime { get; set; }
  13. // 帧缓存
  14. public FrameBuffer FrameBuffer { get; set; }
  15. // 计算fixedTime,fixedTime在客户端是动态调整的,会做时间膨胀缩放
  16. public FixedTimeCounter FixedTimeCounter { get; set; }
  17. // 玩家id列表
  18. public List<long> PlayerIds { get; } = new(LSConstValue.MatchCount);
  19. // 预测帧
  20. public int PredictionFrame { get; set; } = -1;
  21. // 权威帧
  22. public int AuthorityFrame { get; set; } = -1;
  23. // 存档
  24. public Replay Replay { get; set; } = new();
  25. private EntityRef<LSWorld> lsWorld;
  26. // LSWorld做成child,可以有多个lsWorld,比如守望先锋有两个
  27. public LSWorld LSWorld
  28. {
  29. get
  30. {
  31. return this.lsWorld;
  32. }
  33. set
  34. {
  35. this.AddChild(value);
  36. this.lsWorld = value;
  37. }
  38. }
  39. public bool IsReplay { get; set; }
  40. public int SpeedMultiply { get; set; }
  41. }
  42. }