# PredictionOutput

# Description

A structure used to store the result data of skill prediction calculations, including various output information such as hit chance, cast position, etc.

# How to Use

// Create prediction input parameters
PredictionInput input;
input.Unit = target;
input.Delay = 0.25f;
input.Speed = 1600.f;
input.Radius = 60.f;
input.Range = 1000.f;
input.Type = eSkillshotType::SkillshotLine;
input.Aoe = true; // Set as AOE skill to detect multiple possible targets

// Perform prediction
PredictionOutput output = Prediction::GetPrediction(input);

// Check prediction results
if (output.Hitchance >= eHitChance::High)
{
    // Get the recommended cast position
    Vector castPos = output.CastPosition();
    
    // Get the target's predicted position
    Vector targetPos = output.UnitPosition();
    
    // Check number of possible AOE targets hit
    int targetsHit = output.AoeTargetsHitCount();
    
    // Cast the ability if multiple targets can be hit
    if (targetsHit >= 2)
    {
        ObjectManager::Player()->CastSpell(eSpellSlot::R, castPos);
    }
    
    // Check for collisions
    if (output.CollisionObjects.empty())
    {
        // No collision, can cast the skill
        ObjectManager::Player()->CastSpell(eSpellSlot::Q, castPos);
    }
    else
    {
        // Collision detected, output collision object information
        for (auto obj : output.CollisionObjects)
        {
            Console::Add("Collision with: %s", obj->GetBuildInfo().Name.c_str());
        }
    }
}

# Properties

Property Type Description
AoeTargetsHit std::vector<AIBaseClient*> List of targets that the AOE skill might hit
CollisionObjects std::vector<AIBaseClient*> List of objects collided with
Hitchance eHitChance Predicted hit chance level
_aoeTargetsHitCount int Number of targets hit by AOE skill (internal variable)
Input PredictionInput Input parameters used for this prediction

# Methods

Method Return Type Description
AoeTargetsHitCount() int Get the number of targets hit by the AOE skill
CastPosition() Vector Get the recommended skill cast position
CastPosition_Set(Vector const& value) void Set the recommended skill cast position
UnitPosition() Vector Get the target's predicted position
UnitPosition_Set(Vector const& value) void Set the target's predicted position