RPGClientBattleManager.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using DeepCore.GameData;
  2. using DeepCore.GameData.Zone;
  3. using DeepCore.GameData.Zone.ZoneEditor;
  4. using DeepCore.Log;
  5. namespace DeepMMO.Client
  6. {
  7. public class RPGClientBattleManager
  8. {
  9. protected Logger log = LoggerFactory.GetLogger("TLBattleManager");
  10. protected EditorTemplates data_root;
  11. protected BattleCodec battle_codec;
  12. public static RPGClientBattleManager Instance { get; private set; }
  13. public static EditorTemplates DataRoot { get { return Instance.data_root; } }
  14. public static TemplateManager Templates { get { return Instance.data_root.Templates; } }
  15. public static BattleCodec BattleCodec { get { return Instance.battle_codec; } }
  16. public RPGClientBattleManager()
  17. {
  18. Instance = this;
  19. log = LoggerFactory.GetLogger(GetType().Name);
  20. }
  21. /// <summary>
  22. /// 初始化所有模板以及工厂类,游戏启动时调用
  23. /// </summary>
  24. public void Init(string data_path)
  25. {
  26. this.data_root = ZoneDataFactory.Factory.CreateEditorTemplates(data_path, true);
  27. this.data_root.LoadAllTemplates();
  28. this.battle_codec = new BattleCodec(data_root.Templates);
  29. }
  30. }
  31. }