# GameObject
# Description
GameObject is the base class for all objects in the game, providing methods to access basic properties and states of game objects.
# How to Use
auto gameObj = GameObject::GetByIndex(0);
if (gameObj && gameObj->IsValid() && gameObj->IsEnemy()) {
Console::Add("Found enemy object: %s", gameObj->Name());
}
# Flags
int Flags()
Gets the flags of the game object.
int flags = gameObject->Flags();
# IsValid
bool IsValid()
Checks if the game object is valid.
if (gameObject->IsValid()) {
// Object is valid, perform operations
}
# IsMe
bool IsMe()
Checks if the game object is the local player.
if (gameObject->IsMe()) {
// This is the local player
}
# IsDead
bool IsDead()
Checks if the game object is dead.
if (!gameObject->IsDead()) {
// Object is alive, perform operations
}
# IsAlly
bool IsAlly()
Checks if the game object is an allied unit.
if (gameObject->IsAlly()) {
// This is an allied unit
}
# IsEnemy
bool IsEnemy()
Checks if the game object is an enemy unit.
if (gameObject->IsEnemy()) {
// This is an enemy unit
}
# BoundingRadius
float BoundingRadius()
Gets the bounding radius of the game object.
float radius = gameObject->BoundingRadius();
# Type
eGameObjectType Type()
Gets the type of the game object.
if (gameObject->Type() == eGameObjectType::Hero) {
// This is a hero unit
}
# Name
const char* Name()
Gets the name of the game object.
const char* name = gameObject->Name();
Console::Add("Object name: %s", name);
# Position
Vector const& Position()
Gets the position of the game object.
Vector position = gameObject->Position();
Console::Add("Object position: %.1f, %.1f, %.1f", position.X, position.Y, position.Z);
# Index
short Index()
Gets the index of the game object.
short idx = gameObject->Index();
# IsVisible
bool IsVisible()
Checks if the game object is visible.
if (gameObject->IsVisible()) {
// Object is visible, perform operations
}
# Team
eGameObjectTeam Team()
Gets the team the game object belongs to.
if (gameObject->Team() == eGameObjectTeam::Order) {
// This is a unit from the Order side
}
# NetworkId
int NetworkId()
Gets the network ID of the game object.
int netId = gameObject->NetworkId();
# IsNeutral
bool IsNeutral()
Checks if the game object is a neutral unit.
if (gameObject->IsNeutral()) {
// This is a neutral unit
}
# IsAIBase
bool IsAIBase()
Checks if the object inherits from AIBase (such as AIMinion, AIHero, AITurret, etc.).
if (gameObject->IsAIBase()) {
// This is an AI-controlled unit
}
# IsAIMinion
bool IsAIMinion()
Checks if the object is an AI minion (including jungle monsters, lane minions, wards, etc.).
if (gameObject->IsAIMinion()) {
// This is a minion unit
}
# IsAIHero
bool IsAIHero()
Checks if the object is an AI hero.
if (gameObject->IsAIHero()) {
// This is a hero unit
}
# IsAITurret
bool IsAITurret()
Checks if the object is an AI turret.
if (gameObject->IsAITurret()) {
// This is a turret
}
# IsMissile
bool IsMissile()
Checks if the object is a projectile.
if (gameObject->IsMissile()) {
// This is a projectile
}