mapics.h
来自「用DirectX编写RPG游戏-Programming.Role.Playing」· C头文件 代码 · 共 57 行
H
57 行
#ifndef _MAPICS_H_
#define _MAPICS_H_
typedef struct sMapItem
{
long ItemNum; // MIL item number
long Quantity; // Quantity of item (ie coins)
float XPos, YPos, ZPos; // Map coordinates
sMapItem *Prev, *Next; // linked list pointers
long Index; // This items index #
long Owner; // Owner index #
sMapItem *Parent; // Parent of a contained item
sMapItem()
{
Prev = Next = Parent = NULL;
Index = 0; Owner = -1;
}
~sMapItem() { delete Next; }
} sMapItem;
class cMapICS
{
private:
long m_NumItems; // # items in map
sMapItem *m_ItemParent; // Linked list parent map item
// Functions to read in next long or float # in file
long GetNextLong(FILE *fp);
float GetNextFloat(FILE *fp);
public:
cMapICS(); // Constructor
~cMapICS(); // Destructor
// Load, save, and free a list of map items
BOOL Load(char *Filename);
BOOL Save(char *Filename);
BOOL Free();
// Add and remove an item on map
BOOL Add(long ItemNum, long Quantity, \
float XPos, float YPos, float ZPos, \
sMapItem *OwnerItem = NULL);
BOOL Remove(sMapItem *Item);
// Retrieve # items or parent linked list object
long GetNumItems();
sMapItem *GetParentItem();
sMapItem *GetItem(long Num);
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?