亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bitvector.h

?? 游戲開發數據結構-Data.Structures.for.Game.Programmers
?? H
字號:
// ============================================================================
// Data Structures For Game Programmers
// Ron Penton
// Bitvector.h
// This is the Bitvector class
// ============================================================================



class Bitvector
{
public:

// ----------------------------------------------------------------
//  Name:           Bitvector
//  Description:    Default Constructor. 
//  Arguments:      - p_size: The size in BITS of the vector.
//  Return Value:   None.
// ----------------------------------------------------------------
    Bitvector( int p_size )
    {
        m_array = 0;
        m_size = 0;
        Resize( p_size );
    }

// ----------------------------------------------------------------
//  Name:           ~Bitvector
//  Description:    Destructor, destroys the vector 
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    ~Bitvector()
    {
        // if the array exists, delete it.
        if( m_array != 0 )
            delete[] m_array;
        m_array = 0;
    }


// ----------------------------------------------------------------
//  Name:           Resize
//  Description:    Resizes the bitvector
//  Arguments:      - p_size: The size in BITS of the vector.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Resize( int p_size )
    {
        // declare a new vector
        unsigned long int* newvector = 0;

        // convert the bit-size into an integer-size
        if( p_size % 32 == 0 )
            p_size = p_size / 32;
        else
            p_size = (p_size / 32) + 1;

        // create the new vector using the converted size.
        newvector = new unsigned long int[p_size];

        // if it wasn't allocated properly, exit out without
        // changing anything.
        if( newvector == 0 )
            return;

        // find the minimum size of the two different sizes.
        int min;
        if( p_size < m_size )
            min = p_size;
        else
            min = m_size;

        // copy everything that can be copied over.
        int index;
        for( index = 0; index < min; index++ )
            newvector[index] = m_array[index];

        // set the new size
        m_size = p_size;

        // delete the old array
        if( m_array != 0 )
            delete[] m_array;

        // make the array point to the new array.
        m_array = newvector;
    }


    // this is the access operator. It retrieves
    // the given bit from the vector.
    bool operator[] ( int p_index )
    {
        // figure out which cell the bit is supposed to be in.
        int cell = p_index / 32;

        // figure out which index the bit is, within the cell.
        int bit = p_index % 32;

        // create a bitpattern with a 1 in the position
        // of the bit we want, then 'and' that with the
        // current cell, then shift the result back down
        // and return it.
        return (m_array[cell] & (1 << bit)) >> bit;
    }


    // this is the set function, which will set a given
    // bit within the vector.
    void Set( int p_index, bool p_value )
    {
        // figure out which cell the bit is supposed to be in.
        int cell = p_index / 32;

        // figure out which index the bit is, within the cell.
        int bit = p_index % 32;

        
        if( p_value == true )
            // if the value we are setting is 1 (true), 
            // then create a bitpattern with a 1 in the
            // place where we want the bit, and 'or' that
            // with the correct cell.
            m_array[cell] = (m_array[cell] | (1 << bit));
        else
            // if the value we are setting is 0 (false),
            // then create a bitpattern with a 1 in the
            // place where we want the bit, negate that so
            // that it becomes a 0, and everything else is
            // a 1, and 'and' that with the correct cell.
            m_array[cell] = (m_array[cell] & (~(1 << bit)));
    }



// ----------------------------------------------------------------
//  Name:           ClearAll
//  Description:    Clears every bit to 0 in the entire vector
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void ClearAll()
    {
        int index;

        // loop through each cell and set it to 0.
        for( index = 0; index < m_size; index++ )
            m_array[index] = 0;
    }


// ----------------------------------------------------------------
//  Name:           SetAll
//  Description:    Sets every bit to 1.
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void SetAll()
    {
        int index;

        // loop through each cell and set it to 0xFFFFFFFF
        for( index = 0; index < m_size; index++ )
            m_array[index] = 0xFFFFFFFF;
    }


// ----------------------------------------------------------------
//  Name:           Size
//  Description:    Returns the size of the vector in bits.
//  Arguments:      None.
//  Return Value:   Size of the vector in bits.
// ----------------------------------------------------------------
    int Size()
    {
        return m_size * 32;
    }



// ----------------------------------------------------------------
//  Name:           GetCell
//  Description:    Gets a cell of 32 bits in the vector
//  Arguments:      - p_index: The cell number
//  Return Value:   The cell.
// ----------------------------------------------------------------
    unsigned long int GetCell( int p_index )
    {
        return m_array[p_index];
    }



// ----------------------------------------------------------------
//  Name:           m_array
//  Description:    a pointer to the array of bits
// ----------------------------------------------------------------
    unsigned long int* m_array;

    
// ----------------------------------------------------------------
//  Name:           m_size
//  Description:    the size, in cells (bits / 32) of the vector.
// ----------------------------------------------------------------
    int m_size;
};

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆日韩欧美久久| 亚洲欧美激情在线| 国产麻豆午夜三级精品| 亚洲美女少妇撒尿| 久久精品亚洲乱码伦伦中文| jlzzjlzz欧美大全| 开心九九激情九九欧美日韩精美视频电影 | 国产美女娇喘av呻吟久久| 国产精品水嫩水嫩| 欧美成人女星排名| 欧美精品久久久久久久久老牛影院| av不卡一区二区三区| 国产美女一区二区| 国产精品综合网| 蓝色福利精品导航| 免费成人在线影院| 日日嗨av一区二区三区四区| 亚洲欧美另类综合偷拍| 亚洲欧美一区二区不卡| 国产精品久久久久久户外露出| 久久综合色婷婷| 精品91自产拍在线观看一区| 日韩视频一区在线观看| 91麻豆精品91久久久久久清纯| 91黄色激情网站| 欧美吞精做爰啪啪高潮| 欧美在线free| 欧美日韩国产另类一区| 欧美一区二区三区四区久久| 欧美日韩精品二区第二页| 欧美视频一二三区| 91精品国产高清一区二区三区 | 黄色日韩网站视频| 国产原创一区二区| 不卡一区中文字幕| 色www精品视频在线观看| 日本乱人伦aⅴ精品| 在线免费观看成人短视频| 欧美日韩亚洲另类| 日韩免费一区二区| 国产欧美日本一区视频| 亚洲欧洲无码一区二区三区| 中文字幕在线一区免费| 亚洲三级在线看| 亚洲国产欧美在线| 精品一区精品二区高清| www.日韩精品| 国产精品乡下勾搭老头1| 成人免费看黄yyy456| 色诱亚洲精品久久久久久| 欧美在线不卡一区| 欧美日韩高清在线| 欧美日韩精品免费| 欧美激情一区二区三区| 亚洲妇女屁股眼交7| 精品一区二区三区的国产在线播放| 国产精品系列在线播放| 欧美中文字幕一区| 久久精品视频在线看| 一区二区三区在线视频观看58| 免费高清成人在线| 99视频一区二区| 日韩女优av电影| 一区二区三区不卡视频| 精品一区二区三区免费| 欧美午夜理伦三级在线观看| 国产香蕉久久精品综合网| 亚洲地区一二三色| aaa国产一区| 久久久噜噜噜久噜久久综合| 亚洲高清一区二区三区| 成人免费毛片片v| 精品福利一区二区三区| 一区二区不卡在线播放| 丁香激情综合国产| 欧美一级日韩不卡播放免费| 亚洲欧美另类小说| 不卡av在线免费观看| 久久综合给合久久狠狠狠97色69| 一区二区国产视频| 成人av电影在线网| 久久精品视频在线免费观看| 日韩精品国产精品| 欧美综合在线视频| 一区二区三区中文在线观看| 成人免费观看av| 国产三级精品在线| 国产一区999| 日韩欧美二区三区| 免费在线观看日韩欧美| 7777女厕盗摄久久久| 亚洲国产日韩精品| 91成人在线精品| 亚洲一区二三区| 一本色道久久综合精品竹菊| 中文字幕视频一区二区三区久| 国产裸体歌舞团一区二区| 日韩一区和二区| 美女看a上一区| 日韩欧美一二三区| 另类调教123区| 日韩欧美色综合| 国产美女一区二区三区| 日韩欧美久久久| 国产综合色视频| 国产女人18毛片水真多成人如厕| 国产精品911| 精品蜜桃在线看| 国产麻豆一精品一av一免费| 欧美一区二区三区免费视频| 肉丝袜脚交视频一区二区| 91国偷自产一区二区三区观看 | 亚洲人精品一区| 色综合久久综合| 亚洲mv在线观看| 3atv在线一区二区三区| 麻豆精品新av中文字幕| 久久婷婷久久一区二区三区| 风间由美一区二区av101| 最好看的中文字幕久久| 欧美日韩一区三区| 国模少妇一区二区三区| 国产精品美女久久久久av爽李琼| 91玉足脚交白嫩脚丫在线播放| 亚洲一区中文在线| 欧美成人一区二区三区 | 91精品在线观看入口| 亚洲观看高清完整版在线观看| 91精品国产91热久久久做人人| 丝袜诱惑制服诱惑色一区在线观看| 欧美久久久久久蜜桃| 国产91精品久久久久久久网曝门| 亚洲精品国产一区二区三区四区在线 | 成人av免费在线| 日韩精品高清不卡| 国产精品超碰97尤物18| 91精品国产91久久久久久最新毛片| 国产成人亚洲综合a∨婷婷| 亚洲一级不卡视频| 精品久久久久久久久久久院品网 | 亚洲三级视频在线观看| 6080午夜不卡| 91香蕉视频污| 国产乱码精品一区二区三区五月婷| 最好看的中文字幕久久| 日韩美女在线视频| 在线观看网站黄不卡| 国产精品123| 日韩精品福利网| 亚洲精品国产成人久久av盗摄| 日韩一区二区不卡| 国产凹凸在线观看一区二区| 日韩高清在线一区| 亚洲乱码国产乱码精品精98午夜| 日韩久久久精品| 911国产精品| 欧美亚洲日本国产| 97se狠狠狠综合亚洲狠狠| 国产一区二区三区观看| 日韩制服丝袜先锋影音| 亚洲精品国产a久久久久久| 欧美激情一区在线观看| 久久综合丝袜日本网| 8x8x8国产精品| 99精品欧美一区二区三区小说 | 高清国产一区二区三区| 老司机精品视频在线| 日韩电影在线观看网站| 亚洲成国产人片在线观看| 亚洲欧美日韩国产成人精品影院 | 久久精品99国产精品日本| 亚洲国产裸拍裸体视频在线观看乱了| 久久久精品tv| 久久久午夜精品| 久久久.com| 欧美国产在线观看| 国产精品久久久一本精品 | 成人免费的视频| 久久99久久99小草精品免视看| 日本中文一区二区三区| 日日欢夜夜爽一区| 日韩1区2区3区| 日韩高清不卡在线| 免费成人美女在线观看.| 日韩在线一区二区| 视频一区在线视频| 久久精品国产在热久久| 精品一二线国产| 精久久久久久久久久久| 国产一二三精品| 色94色欧美sute亚洲线路一ni| 欧美日本免费一区二区三区| 亚洲精品一区二区三区精华液| 亚洲国产精品99久久久久久久久| 中文字幕一区二区在线观看| 午夜免费久久看| 国产aⅴ精品一区二区三区色成熟| 色一区在线观看| 91.xcao| 亚洲精品日产精品乱码不卡|