mrlistgp.h

来自「Games programming all in one code chapte」· C头文件 代码 · 共 53 行

H
53
字号
#ifndef MRLISTGP_H
#define MRLISTGP_H

#include "mrListNodeGP.h"

class mrListGP
{
public:

    // constructor, initialises object.
    mrListGP();

    // makes the iterator point to the first node
    // in the list.
    void StartIterator();

    // moves the iterator forward to the next item
    // in the list.
    void MoveForward();

    // retrieves a reference to the item in the
    // current node.
    mrGamePlayer& GetCurrentItem();

    // determines if the iterator is valid.
    mrBool32 IsIteratorValid();

    // inserts an item after the current node.
    void InsertItem( mrGamePlayer player );

    // removes the current item.
    void RemoveCurrentItem();

    // appends a new gameplayer to the end of the list.
    void AppendItem( mrGamePlayer player );

    // returns the count of the list.
    mrInt GetCount();


private:
    // A pointer to the head of the list, the first node.
    mrListNodeGP* m_kHead;

    // a pointer to the current node in the list.
    mrListNodeGP* m_kCurrent;

    // the current item count of the list.
    mrInt m_iCount;
};


#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?