示例#1
0
void node::push()
{
    if (needToRev)
    {
        node* temp = left;
        left = right;
        right = temp;

        if (left != NULL)
            left->reverse();
        if (right != NULL)
        right->reverse();
        needToRev = false;
    }
    recount();
}
示例#2
0
void node::setNeedToRev (bool inNeedToRev)
{
    needToRev = inNeedToRev;
    recount();
}
示例#3
0
void node::setSum (int inSum)
{
    sum = inSum;
    recount();
}
示例#4
0
void node::setValue(int inVal) // Устанавливаем элементу значение
{
    value = inVal;
    recount();
}
示例#5
0
void node::setRight (node* inRight)
{
    right = inRight;
    recount();
}
示例#6
0
void node::setLeft (node* inLeft)
{
    left = inLeft;
    recount();
}
示例#7
0
void node::setSize (int inSize)
{
    size = inSize;
    recount();
}
void HeroChart::rebuild()
{
    if (dota)
        dota->release();
    delete[] taverns;
    delete[] textTags;

    DotaLibrary* lib = getApp()->getDotaLibrary();
    dota = lib->getDota();
    numTaverns = 12;
    numTags = 8;
    taverns = new TavernInfo[numTaverns];
    textTags = new TextTag[numTags];

    HFONT hFontLarge = FontSys::getFont(18, "Georgia", FONT_BOLD);
    HFONT hFontMed = FontSys::getFont(16, "Georgia", FONT_BOLD);
    counterFont = FontSys::getFont(10, "Arial");

    textTags[0].set("Sentinel", getSlotColor(0), hFontLarge, 0, 0, CHART_WIDTH, TEAM_HEIGHT);
    textTags[1].set("Agility", getSlotColor(0), hFontMed, 0, textTags[0].rc.bottom, CHART_WIDTH, NAME_HEIGHT);
    textTags[2].set("Strength", getSlotColor(0), hFontMed,
                    0, textTags[1].rc.bottom + TAVERN_HEIGHT, CHART_WIDTH, NAME_HEIGHT);
    textTags[3].set("Intelligence", getSlotColor(0), hFontMed,
                    0, textTags[2].rc.bottom + TAVERN_HEIGHT, CHART_WIDTH, NAME_HEIGHT);
    textTags[4].set("Scourge", getSlotColor(6), hFontLarge,
                    0, textTags[3].rc.bottom + TAVERN_HEIGHT, CHART_WIDTH, TEAM_HEIGHT);
    textTags[5].set("Agility", getSlotColor(6), hFontMed,
                    0, textTags[4].rc.bottom, CHART_WIDTH, NAME_HEIGHT);
    textTags[6].set("Strength", getSlotColor(6), hFontMed,
                    0, textTags[5].rc.bottom + TAVERN_HEIGHT, CHART_WIDTH, NAME_HEIGHT);
    textTags[7].set("Intelligence", getSlotColor(6), hFontMed,
                    0, textTags[6].rc.bottom + TAVERN_HEIGHT, CHART_WIDTH, NAME_HEIGHT);

    for (int i = 0; i < 12; i++)
    {
        taverns[i].rc.left = 10;
        if (i % 2)
            taverns[i].rc.left += (32 * 4 + 2 * 3 + 20);
        taverns[i].rc.top = textTags[1 + (i / 6) + (i / 2)].rc.bottom;
        taverns[i].rc.right = taverns[i].rc.left + 32 * 4 + 2 * 3;
        taverns[i].color = getSlotColor((i / 6) * 6);
        for (int h = 0; h < 12; h++)
            taverns[i].heroes[h] = NULL;
        int maxY = 0;
        for (int h = 0; h < MAX_HERO_POINT; h++)
        {
            Dota::Hero* hero = dota->getHero(h);
            if (hero && hero->tavern == i)
            {
                taverns[i].heroes[hero->tavernSlot] = hero;
                int y = hero->tavernSlot / 4;
                if (y > maxY)
                    maxY = y;
            }
        }
        taverns[i].rc.bottom = taverns[i].rc.top + 32 + maxY * (32 + 2);
    }
    recount();

    contentHeight = textTags[numTags - 1].rc.bottom + TAVERN_HEIGHT + 15;
    onMessage(WM_SIZE, 0, 0);
}