Пример #1
0
        internal static Entity CreateEntityFromPointer(IntPtr entityPointer)
        {
            string getClassId = ReadObj.ReadClassFromPointer(entityPointer);

            if (getClassId.Contains("DOTA_Ability") || getClassId.Contains("BaseAbility"))
            {
                return(new Ability(entityPointer));
            }
            if (getClassId.Contains("DOTA_Unit_Hero"))
            {
                return(new Hero(entityPointer));
            }
            if (getClassId.Contains("DOTAPlayer"))
            {
                return(new Player(entityPointer));
            }
            if (getClassId.Contains("DOTA_Item"))
            {
                return(new Item(entityPointer));
            }
            if (getClassId.Contains("BaseNPC_Creep_Lane"))
            {
                return(new Creep(entityPointer));
            }
            if (getClassId.Contains("BaseNPC_Creep_Neutral"))
            {
                return(new Neutral(entityPointer));
            }
            if (getClassId.Contains("BaseNPC_Shop"))
            {
                return(new Shop(entityPointer));
            }
            if (getClassId.Contains("BaseNPC_Tower"))
            {
                return(new Tower(entityPointer));
            }
            if (getClassId.Contains("DOTA_Unit_Courier"))
            {
                return(new Courier(entityPointer));
            }
            if (getClassId.Contains("BaseNPC_Building"))
            {
                return(new Building(entityPointer));
            }
            return(new Entity(entityPointer));
        }
Пример #2
0
 public string ClassIdName() => ReadObj.ReadClassFromPointer(EntityPointer);
Пример #3
0
 public ClassId ClassId() =>
 (ClassId)Enum.Parse(typeof(ClassId), ReadObj.ReadClassFromPointer(EntityPointer), true);