コード例 #1
0
bool CRecastContainer::Has(RECASTTYPE type, uint16 id)
{
    RecastList_t* PRecastList = GetRecastList(type);

    return std::find_if(PRecastList->begin(), PRecastList->end(), [&id](auto& recast)
    {
        return recast.ID == id;
    }) != PRecastList->end();
}
コード例 #2
0
void CRecastContainer::Del(RECASTTYPE type, uint16 id)
{
    RecastList_t* PRecastList = GetRecastList(type);

    if (type == RECAST_ABILITY)
    {
        if (auto recast = GetRecast(RECAST_ABILITY, id))
        {
            recast->RecastTime = 0;
        }
    }
    else
    {
        PRecastList->erase(std::remove_if(PRecastList->begin(), PRecastList->end(), [&id](auto& recast)
        {
            return recast.ID == id;
        }), PRecastList->end());
    }
}
コード例 #3
0
Recast_t* CRecastContainer::GetRecast(RECASTTYPE type, uint16 id)
{
    RecastList_t* list = GetRecastList(type);
    for (std::vector<Recast_t*>::iterator it = list->begin() ; it != list->end(); ++it)
    {
        Recast_t* recast = *it;
        if( recast->ID == id)
        {
            return recast;
        }
    }
    return NULL;
}