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

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

?? dlinkedlist.h

?? 模擬游戲中人的行走
?? H
?? 第 1 頁 / 共 2 頁
字號:
// ============================================================================
// Data Structures For Game Programmers
// Ron Penton
// DLinkedList.h
// This is the Doubly-Linked List class
// ============================================================================
#ifndef DLINKEDLIST_H
#define DLINKEDLIST_H




// forward declarations of all the classes in this file
template<class Datatype> class DListNode;
template<class Datatype> class DLinkedList;
template<class Datatype> class DListIterator;



// -------------------------------------------------------
// Name:        DListNode
// Description: This is the Doubly-linked list node class.
// -------------------------------------------------------
template<class Datatype>
class DListNode
{
public:


// ----------------------------------------------------------------
//  Name:           m_data
//  Description:    This is the data in the node.
// ----------------------------------------------------------------
    Datatype m_data;

// ----------------------------------------------------------------
//  Name:           m_next
//  Description:    This is a pointer to the next node in the list
// ----------------------------------------------------------------
    DListNode<Datatype>* m_next;

// ----------------------------------------------------------------
//  Name:           m_previous
//  Description:    This is a pointer to the last node in the list
// ----------------------------------------------------------------
    DListNode<Datatype>* m_previous;


// ----------------------------------------------------------------
//  Name:           DeLink
//  Description:    This delinks this node from the list it is in.
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Delink()
    {
        // if a previous node exists, then make the previous
        // node point to the next node.
        if( m_previous != 0 )
            m_previous->m_next = m_next;

        // if the next node exists, then make the next node
        // point to the previous node.
        if( m_next != 0 )
            m_next->m_previous = m_previous;
    }


// ----------------------------------------------------------------
//  Name:           InsertAfter
//  Description:    This adds a node after the current node.
//  Arguments:      p_data - The data to store in the new node.
//  Return Value:   None.
// ----------------------------------------------------------------
    void InsertAfter( Datatype p_data )
    {
        // create the new node.
        DListNode<Datatype>* newnode = new DListNode<Datatype>;
        newnode->m_data = p_data;

        // set up newnode's pointers.
        newnode->m_next     = m_next;
        newnode->m_previous = this;

        // if there is a node after this one, make it point to
        // newnode
        if( m_next != 0 )
            m_next->m_previous = newnode;

        // make the current node point to newnode.
        m_next = newnode;
    }


// ----------------------------------------------------------------
//  Name:           InsertBefore
//  Description:    This adds a node before the current node.
//  Arguments:      p_data - The data to store in the new node.
//  Return Value:   None.
// ----------------------------------------------------------------
    void InsertBefore( Datatype p_data )
    {
        // create the new node.
        DListNode<Datatype>* newnode = new DListNode<Datatype>;
        newnode->m_data = p_data;

        // set up newnode's pointers.
        newnode->m_next     = this;
        newnode->m_previous = m_previous;

        // if there is a node before this one, make it point to
        // newnode
        if( m_previous != 0 )
            m_previous->m_next = newnode;

        // make the current node point to newnode.
        m_previous = newnode;
    }


};



// -------------------------------------------------------
// Name:        DLinkedList
// Description: This is the Doubly-linked list container.
// -------------------------------------------------------
template<class Datatype>
class DLinkedList
{
public:

// ----------------------------------------------------------------
//  Name:           DLinkedList
//  Description:    Constructor; creates an empty list
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    DLinkedList()
    {
        m_head = 0;
        m_tail = 0;
        m_count = 0;
    }

    
// ----------------------------------------------------------------
//  Name:           DLinkedList
//  Description:    Destructor; destroys every node
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    ~DLinkedList()
    {
        // temporary node pointers.
        DListNode<Datatype>* node = m_head;
        DListNode<Datatype>* next;

        while( node != 0 )
        {
            // save the pointer to the next node.
            next = node->m_next;

            // delete the current node.
            delete node;

            // make the next node the current node.
            node = next;
        }
    }


// ----------------------------------------------------------------
//  Name:           Append
//  Description:    Adds a new node to the end of a list
//  Arguments:      p_data - the data to be added.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Append( Datatype p_data )
    {
        // if there is no head node (ie: list is empty)
        if( m_head == 0 )
        {
            // create a new head node.
            m_head = m_tail = new DListNode<Datatype>;
            m_head->m_data = p_data;
            m_head->m_next = 0;
            m_head->m_previous = 0;
        }
        else
        {
            // insert a new node after the tail, and reset the tail.
            m_tail->InsertAfter( p_data );
            m_tail = m_tail->m_next;
        }
        m_count++;
    }


// ----------------------------------------------------------------
//  Name:           Prepend
//  Description:    Addss a new node to the beginning of a list
//  Arguments:      p_data - the data to be added.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Prepend( Datatype p_data )
    {
        // if there is no head node (ie: list is empty)
        if( m_head == 0 )
        {
            // create a new head node.
            m_head = m_tail = new DListNode<Datatype>;
            m_head->m_data = p_data;
            m_head->m_next = 0;
            m_head->m_previous = 0;
        }
        else
        {
            // insert a new node before the head, and reset the head.
            m_head->InsertBefore( p_data );
            m_head = m_head->m_previous;
        }
        m_count++;
    }


// ----------------------------------------------------------------
//  Name:           RemoveHead
//  Description:    This removes the very first node in the list.
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void RemoveHead()
    {
        DListNode<Datatype>* node = 0;

        if( m_head != 0 )
        {
            // make node point to the next node.
            node = m_head->m_next;

            // then delete the head, and make the pointer
            // point to node.
            delete m_head;
            m_head = node;

            // if the head is null, then we've just deleted the only node
            // in the list. set the tail to 0.
            // if not, set the previous pointer to 0.
            if( m_head == 0 )
                m_tail = 0;
            else
                m_head->m_previous = 0;

            m_count--;
        }
    }


// ----------------------------------------------------------------
//  Name:           RemoveTail
//  Description:    This removes the very last node in the list.
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void RemoveTail()
    {
        DListNode<Datatype>* node = 0;

        if( m_tail != 0 )
        {
            // make node point to the next node.
            node = m_tail->m_previous;

            // then delete the head, and make the pointer
            // point to node.
            delete m_tail;
            m_tail = node;

            // if the tail is null, then we've just deleted the only node
            // in the list. set the head to 0.
            // if not, set the next pointer to 0.
            if( m_tail == 0 )
                m_head = 0;
            else
                m_tail->m_next = 0;

            m_count--;
        }
    }



// ----------------------------------------------------------------
//  Name:           InsertAfter
//  Description:    Inserts data after the iterator, or at the end
//                  of the list if iterator is invalid.
//  Arguments:      p_iterator: The iterator to insert after
//                  p_data: the data to insert
//  Return Value:   None.
// ----------------------------------------------------------------
    void InsertAfter( DListIterator<Datatype>& p_iterator, Datatype p_data )
    {
        if( p_iterator.m_node != 0 )
        {
            // insert the data after the iterator
            p_iterator.m_node->InsertAfter( p_data );

            // if the iterator was the tail of the list,
            // reset the tail pointer
            if( p_iterator.m_node == m_tail )
                m_tail = m_tail->m_next;

            // increment the count
            m_count++;
        }
        else
        {
            Append( p_data );
        }
    }


// ----------------------------------------------------------------
//  Name:           InsertBefore
//  Description:    inserts data before the iterator, or prepends
//                  it to the beginning of the list if invalid.
//  Arguments:      p_iterator: The iterator to insert after
//                  p_data: the data to insert
//  Return Value:   None.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线不卡a资源高清| aaa欧美大片| 欧美一级国产精品| 日韩高清不卡一区| 欧美一二区视频| 国产在线视频不卡二| 2020国产精品自拍| 成人精品小蝌蚪| 亚洲视频一区二区免费在线观看| 99久久夜色精品国产网站| 亚洲欧美日韩国产手机在线| 色婷婷国产精品综合在线观看| 一区二区三区四区视频精品免费| 欧美伊人精品成人久久综合97| 亚洲成年人网站在线观看| 91麻豆精品国产无毒不卡在线观看 | 欧美久久一二三四区| 香港成人在线视频| 久久―日本道色综合久久| av高清久久久| 午夜婷婷国产麻豆精品| 久久―日本道色综合久久| 99视频有精品| 奇米精品一区二区三区在线观看一| 精品国产一区二区三区四区四| www.欧美精品一二区| 亚洲国产乱码最新视频 | 国产成人在线免费观看| 最好看的中文字幕久久| 欧美视频自拍偷拍| 美腿丝袜在线亚洲一区| 久久综合九色综合欧美亚洲| 国产一区二区在线看| 91精品国产综合久久精品麻豆 | 国产一区啦啦啦在线观看| 久久女同精品一区二区| 国产91清纯白嫩初高中在线观看| 中文在线资源观看网站视频免费不卡 | 天天做天天摸天天爽国产一区| 91精品国产手机| 九色|91porny| 18成人在线观看| 色婷婷综合久久久久中文| 亚洲国产成人av网| 国产精品情趣视频| 欧日韩精品视频| 久久国产精品无码网站| 中文字幕一区二区三区四区| 欧美精品国产精品| 成人一区在线看| 日韩精品一区第一页| 日本一区二区免费在线观看视频| 国产91精品欧美| 日韩va欧美va亚洲va久久| 精品国产制服丝袜高跟| 在线视频你懂得一区| 激情av综合网| 亚洲成a人v欧美综合天堂| 久久精品无码一区二区三区| 欧美伦理电影网| 成人app下载| 国产一区二区91| 亚洲成人福利片| 国产精品美女一区二区在线观看| 欧美一区二区在线看| 色先锋资源久久综合| 国产在线播放一区二区三区| 亚洲成人免费视| 亚洲乱码国产乱码精品精小说| 国产亚洲精久久久久久| 欧美一区二区精品久久911| 91国偷自产一区二区三区成为亚洲经典 | 91久久香蕉国产日韩欧美9色| 国内成+人亚洲+欧美+综合在线| 亚洲激情av在线| 国产欧美一区二区精品忘忧草 | 99久久精品免费看国产免费软件| 免费成人小视频| 一卡二卡三卡日韩欧美| 国产精品婷婷午夜在线观看| 精品国产99国产精品| 777午夜精品免费视频| 欧美性受xxxx| 在线亚洲一区二区| 91美女福利视频| 成人激情综合网站| 国产.精品.日韩.另类.中文.在线.播放| 人人精品人人爱| 亚洲激情一二三区| 亚洲欧美区自拍先锋| 亚洲天堂免费在线观看视频| 国产天堂亚洲国产碰碰| 久久精品视频在线看| 国产亚洲美州欧州综合国| ww亚洲ww在线观看国产| 精品国产欧美一区二区| 欧美成人猛片aaaaaaa| 日韩视频免费直播| 欧美一三区三区四区免费在线看| 欧美日韩国产电影| 欧美一区二区在线不卡| 日韩欧美国产麻豆| 欧美一级专区免费大片| 欧美成人精品3d动漫h| 精品成人免费观看| 欧美sm美女调教| 久久综合九色综合97_久久久| 日韩欧美一二三四区| 中日韩av电影| 亚洲色图欧洲色图婷婷| 亚洲一区二三区| 日本vs亚洲vs韩国一区三区二区| 精品伊人久久久久7777人| 国产做a爰片久久毛片| www.日韩精品| 在线看不卡av| 日韩一区二区在线观看视频播放| www日韩大片| 国产精品电影一区二区三区| 一区二区三区四区视频精品免费 | 国产片一区二区三区| 26uuu亚洲综合色| 中文字幕 久热精品 视频在线| 亚洲摸摸操操av| 青青青爽久久午夜综合久久午夜 | 中文字幕在线一区| 一区二区三区在线观看动漫| 日本91福利区| 国产+成+人+亚洲欧洲自线| 91激情五月电影| 欧美怡红院视频| 国产三级一区二区| 亚洲成va人在线观看| 国产美女主播视频一区| 色综合中文字幕国产 | 日韩欧美卡一卡二| 国产精品久久久久久久久免费相片 | 日韩成人午夜电影| 国产麻豆日韩欧美久久| 色综合中文字幕国产| 在线播放一区二区三区| 国产欧美日韩在线| 午夜精品久久久久久久久久久| 韩国av一区二区三区| 欧美色涩在线第一页| 亚洲精品在线免费播放| 亚洲在线中文字幕| 国产激情视频一区二区三区欧美| 欧美午夜精品久久久久久孕妇| 精品国产伦一区二区三区免费| 亚洲精品中文字幕在线观看| 日韩二区三区四区| 波多野结衣亚洲| 久久综合九色综合欧美98| 午夜伦理一区二区| 不卡一区二区三区四区| 精品欧美乱码久久久久久1区2区| 一区二区三区四区五区视频在线观看| 国产在线视频不卡二| 欧美一区二区三区小说| 亚洲精品成a人| 丁香婷婷综合网| 久久一二三国产| 免费成人av资源网| 欧美性极品少妇| 综合色天天鬼久久鬼色| 国产麻豆精品theporn| 日韩视频一区二区三区| 性久久久久久久久| 91高清视频在线| 欧美激情中文字幕一区二区| 日欧美一区二区| 成人avav在线| 中文字幕在线观看一区二区| 波多野结衣在线一区| 久久奇米777| 国产剧情一区在线| 精品av综合导航| 久久精品国产亚洲5555| 日韩三级av在线播放| 免费不卡在线视频| 6080午夜不卡| 日韩高清在线电影| 欧美一级爆毛片| 久久草av在线| 久久久久久久综合日本| 日韩二区三区在线观看| 91麻豆精品国产91久久久使用方法 | 国产精品久久久久aaaa樱花| 丁香桃色午夜亚洲一区二区三区| 久久综合九色综合欧美98| 国产成人免费视频一区| 国产精品免费丝袜| 色悠久久久久综合欧美99| 亚洲精品视频免费看| 91福利在线观看| 天天av天天翘天天综合网| 欧美肥妇bbw| 日本aⅴ精品一区二区三区| 欧美日韩一区视频|