Logo Search packages:      
Sourcecode: fillets-ng version File versions

Cube::t_models Rules::whoIsHeavier ( Cube::eWeight  power  )  [private]

Who is heavier than our power.

Parameters:
power our max power
Returns:
array of killers, they can lie undirect on us

Definition at line 441 of file Rules.cpp.

References MarkMask::getResist(), MarkMask::mask(), and MarkMask::unmask().

Referenced by checkDeadStress().

{
    Cube::t_models result;
    m_mask->unmask();

    Cube::t_models resist = m_mask->getResist(Dir::DIR_UP);
    Cube::t_models::iterator end = resist.end();
    for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) {
        if (!(*i)->isWall()) {
            if ((*i)->rules()->isHeavier(power)) {
                result.push_back(*i);
            }
            else {
                Cube::t_models distance_killers =
                    (*i)->rules()->whoIsHeavier(power);
                result.insert(result.end(), distance_killers.begin(),
                        distance_killers.end());
            }
        }
    }

    m_mask->mask();
    return result;
}


Generated by  Doxygen 1.6.0   Back to index