www.pudn.com > GameEngine_src.rar > CItemFactory.h
#ifndef CItemFactory_h #define CItemFactory_h #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "CItem.h" #include "CPool.h" #include "CDynamicArray.h" #include#include using std::string; /////////////////////////////////////////////////////////////////////// //物品工厂类,负责物品的创建与销亡 /////////////////////////////////////////////////////////////////////// class CItemFactory { public: CItemFactory(); ~CItemFactory(); bool Init(); void Free(); void OnFreeLvl(); void OnLoadMap( FILE *fp ); void OnLoadLvl(); void OnInitLvl(); void SaveHeroItem( FILE *fp ); void LoadHeroItem( FILE *fp ); void CreateItemOnGround( const POINT &base, int lvl, int randSeed ); void DeleteItem( CItem *pItem ); void DrawName( ITEM_INFO *pInfo, int colorIndex, int x, int y ); void DrawInfo( CItem *pItem, const ES_CMD *CmdBuf, int CmdNum, int x, int y ); void OpenItemShop( int i ); //打开商店,1表示普通,2高级,3稀有 private: CPool m_ItemPool; CDynamicArray m_ItemInfoArray; CDynamicArray m_ItemNameArray; CDynamicArray m_ItemNameArray2; int m_NumItem1; //普通物品的数量 int m_NumItem2; //高级物品的数量 int m_NumItem3; //稀有物品的数量 int m_SurfWidth; int m_SurfHeight; PSURFACE m_NameSurface; PSURFACE m_InfoSurface; PSURFACE m_InfoBackSurface; }; #endif