MirGameInstanceModel.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Mir2Assistant.Common.Utils;
  2. using System.Collections.Concurrent;
  3. namespace Mir2Assistant.Common.Models;
  4. public class MirGameInstanceModel
  5. {
  6. public int MirPid { get; set; } //游戏pid
  7. public uint MirThreadId { get; set; }//游戏主线程ID
  8. public IntPtr MirHwnd { get; set; }//游戏主窗体句柄
  9. public nint MirBaseAddress { get; set; }
  10. public string? mirVer { get; set; }
  11. public nint? HookHandle { get; set; }
  12. public IntPtr? LibIpdl { get; set; }
  13. public Form? AssistantForm { get; set; }
  14. public Dictionary<string, nint> MirConfig = new Dictionary<string, nint>();
  15. public CharacterStatusModel? CharacterStatus { get; set; } = new CharacterStatusModel();
  16. public MemoryUtils? MemoryUtils { get; set; }
  17. public byte MonstersUpdateId = 0;
  18. /// <summary>
  19. /// 怪物
  20. /// </summary>
  21. public ConcurrentDictionary<int, MonsterModel> Monsters { get; set; } = new ConcurrentDictionary<int, MonsterModel>();
  22. public bool IsReadingMonsters = false;
  23. /// <summary>
  24. /// 技能
  25. /// </summary>
  26. public ConcurrentBag<SkillModel> Skills { get; set; } = new ConcurrentBag<SkillModel>();
  27. /// <summary>
  28. /// 二级对话列表
  29. /// </summary>
  30. public List<string> TalkCmds { get; set; } = new List<string>();
  31. public event Action<nint, string?>? NewSysMsg;
  32. public void InvokeSysMsg(nint flag, string? msg)
  33. {
  34. Task.Run(() =>
  35. {
  36. NewSysMsg?.Invoke(flag, msg);
  37. });
  38. }
  39. }