⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 objectsarray.h

📁 坦克游戏编程
💻 H
字号:
/*****************************************************************************
*                                                                             
*   ObjectsArray.h
*                                                                             
*   Electrical Engineering Faculty - Software Lab                             
*   Spring semester 1998                                                      
*                                                                             
*   Tanks game                                                                
*                                                                             
*   Module description: Implements an array of game objects sharing the same
*                       z-order. Used by the GameObjectsList class.
*                       
*                                                                             
*   Authors: Eran Yariv - 28484475                                           
*            Moshe Zur  - 24070856                                           
*                                                                            
*                                                                            
*   Date: 23/09/98                                                           
*                                                                            
******************************************************************************/
#ifndef _OBJECTS_ARRAY_H_
#define _OBJECTS_ARRAY_H_

#include "GameObject.h"

typedef CGameObject**     ARR_POS;

class CObjectsArray
{
public:
    CObjectsArray ();
    virtual ~CObjectsArray();

    void Init (UINT uSize);

    BOOL Add(CGameObject *);
    BOOL Remove(CGameObject *);

    ARR_POS GetHeadPosition();
    CGameObject* GetNext(ARR_POS&);

    BOOL IsEmpty();
    int GetObjectsCount() const;

    void Empty();                   // Deletes all pointer in array

private:
    UINT m_uSize;                   // Total number of entries
    CGameObject** m_Array;          // Allocated array
                                    
    ARR_POS m_lplpTop;              // Pointer to next empty entry
    ARR_POS m_lplpLast;             // Pointer to last available entry (&m_Array[m_uSize-1])
};

#include "ObjectsArray.inl"

#endif

⌨️ 快捷键说明

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