亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
精品视频999| 丝袜脚交一区二区| 性做久久久久久免费观看| 国产做a爰片久久毛片| 欧美最猛黑人xxxxx猛交| 日本一区二区三区久久久久久久久不 | 免费在线成人网| 99精品热视频| 久久久久国产精品人| 奇米综合一区二区三区精品视频| 99久久国产综合色|国产精品| 久久婷婷国产综合国色天香 | 欧美三级日韩三级| 国产精品美女视频| 国产精品亚洲人在线观看| 欧美精品在线观看播放| 亚洲黄色片在线观看| 国产成人免费高清| 久久综合丝袜日本网| 久久99精品国产.久久久久久 | 欧美激情在线免费观看| 秋霞午夜鲁丝一区二区老狼| 在线视频你懂得一区| 亚洲精品免费电影| 91丝袜高跟美女视频| 中文字幕精品一区| 国产成人精品综合在线观看| 久久精品人人爽人人爽| 韩国三级电影一区二区| 精品国产乱码久久久久久图片 | 亚洲在线视频网站| 日本伦理一区二区| 亚洲影院免费观看| 欧美精品v日韩精品v韩国精品v| 亚洲一区二区三区影院| 日韩一级视频免费观看在线| 日韩av在线发布| 精品国产三级电影在线观看| 久久国产尿小便嘘嘘| 欧美成人a视频| 国产成人免费视频网站| 国产女人18水真多18精品一级做| av中文字幕不卡| 亚洲免费看黄网站| 在线播放视频一区| 美女被吸乳得到大胸91| 久久一区二区三区四区| 波多野结衣中文字幕一区二区三区| 国产精品久久久久久久久久免费看 | 精一区二区三区| 26uuu久久综合| www.综合网.com| 亚洲国产精品久久不卡毛片| 欧美一区午夜精品| 国产在线精品不卡| 欧美激情综合网| 在线精品视频小说1| 日韩在线a电影| 久久一区二区视频| 欧美在线免费视屏| 全国精品久久少妇| 国产精品每日更新| 欧美三级中文字幕| 国产一区二区三区久久悠悠色av| 中文字幕在线观看一区| 91麻豆精品国产综合久久久久久| 国产一区二区免费在线| 亚洲最新视频在线播放| 精品国产99国产精品| 色综合天天综合| 加勒比av一区二区| 亚洲精品亚洲人成人网在线播放| 日韩欧美一二区| 色综合天天狠狠| 精品亚洲成av人在线观看| 亚洲精品日韩一| 久久亚洲一级片| 欧美日韩一区二区欧美激情| 高清成人在线观看| 强制捆绑调教一区二区| 亚洲欧洲av另类| 亚洲精品一区在线观看| 欧美综合一区二区三区| 国产精品99久久久久久久vr| 亚洲电影一级黄| 国产精品久久久久久久第一福利 | 国产精品一二一区| 天堂一区二区在线| 亚洲丝袜制服诱惑| 国产视频在线观看一区二区三区| 欧美高清www午色夜在线视频| 成人教育av在线| 国产一区二区在线影院| 婷婷六月综合网| 亚洲精品乱码久久久久久黑人| 久久精品视频一区二区三区| 欧美精品乱人伦久久久久久| 色婷婷综合激情| 91亚洲国产成人精品一区二三| 国产不卡高清在线观看视频| 久久精品噜噜噜成人av农村| 午夜久久福利影院| 男女男精品视频| 一区二区三区丝袜| 最近中文字幕一区二区三区| 国产清纯美女被跳蛋高潮一区二区久久w | 在线观看免费视频综合| 丁香天五香天堂综合| 经典三级在线一区| 激情综合色播激情啊| 韩日精品视频一区| 国产乱理伦片在线观看夜一区| 久久成人免费电影| 韩国理伦片一区二区三区在线播放| 日韩有码一区二区三区| 亚洲成av人片在线| 亚洲国产日日夜夜| 偷窥国产亚洲免费视频| 日本亚洲视频在线| 激情综合亚洲精品| 国产老肥熟一区二区三区| 国产剧情一区二区| 波多野结衣91| 91极品美女在线| 欧美日韩dvd在线观看| 日韩视频免费直播| 精品久久久久久久久久久久久久久 | 欧美日韩久久不卡| 3d成人动漫网站| 精品剧情v国产在线观看在线| 久久先锋影音av鲁色资源网| 国产网站一区二区三区| 中文字幕视频一区| 亚洲一区二区精品3399| 青青草国产精品97视觉盛宴| 狠狠色综合色综合网络| 成人激情综合网站| 欧美日韩和欧美的一区二区| 91精品国产91久久久久久一区二区| 欧美v亚洲v综合ⅴ国产v| 欧美国产日韩一二三区| 亚洲一区在线观看网站| 狠狠色丁香久久婷婷综合_中 | 午夜av一区二区三区| 久久精品久久综合| 成人综合婷婷国产精品久久| 欧美一区二区免费观在线| 精品国产a毛片| 亚洲蜜臀av乱码久久精品| 日韩成人伦理电影在线观看| 国产成人亚洲综合a∨猫咪| 色综合久久综合网欧美综合网| 91精品婷婷国产综合久久| 久久久www成人免费无遮挡大片| 亚洲乱码国产乱码精品精可以看 | 成人在线综合网站| 在线一区二区三区| 欧美精品一区二区久久婷婷| 亚洲乱码国产乱码精品精小说 | 久久欧美中文字幕| 亚洲精品国产品国语在线app| 免费成人av资源网| 99久久免费精品| 久久综合给合久久狠狠狠97色69| 一色桃子久久精品亚洲| 丰满少妇在线播放bd日韩电影| 欧美日韩亚洲综合| 中文字幕乱码亚洲精品一区 | 一级做a爱片久久| 高清不卡在线观看| 欧美成人乱码一区二区三区| 亚洲欧美日韩中文字幕一区二区三区| 美女脱光内衣内裤视频久久网站| 99天天综合性| 久久精品亚洲一区二区三区浴池| 亚洲aⅴ怡春院| 91丝袜呻吟高潮美腿白嫩在线观看| 日韩精品一区在线| 天天爽夜夜爽夜夜爽精品视频| 成人污污视频在线观看| 精品欧美一区二区久久| 亚洲成av人片在线观看| 99久久99久久久精品齐齐| 国产午夜亚洲精品羞羞网站| 久久99精品久久久久久| 6080日韩午夜伦伦午夜伦| 亚洲精品少妇30p| 91亚洲精品久久久蜜桃网站| 国产精品美女视频| 成人精品视频一区二区三区| 久久精子c满五个校花| 久久精品国产一区二区三区免费看| 欧美日韩国产另类一区| 亚洲成人资源网| 欧美日韩dvd在线观看| 日本不卡一二三区黄网| 日韩午夜小视频| 狠狠色丁香久久婷婷综| 久久精品无码一区二区三区| 国产精品66部|