Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

level.h

Go to the documentation of this file.
00001 #ifndef __LEVEL_H
00002 #define __LEVEL_H
00003 
00004 /*
00005  * Notes:
00006  *
00007  *  Object pointers are maintained in a master list of objects,
00008  * "objects". However, they also appear in a hash, indexed by game
00009  * column, called "objcells_by_tilex". That allows quick access to
00010  * objects based on their position within the level. The hash is used
00011  * mostly to limit collision searches, and to only call objects that
00012  * are on the screen.
00013  */
00014 
00015 class Level
00016 {
00017 private:
00018   int mission; 
00019   Object *obj_player;
00020   int width; 
00021   int height; 
00022   int nobjects;
00023   int maxnobjects;
00024   Tile ***tiles;
00025   Object **objects;
00026   ObjectCell **objcells_by_tilex; // see "Notes" above.
00027   GameTimer *game_timer;
00028   Input *input;
00029   
00030 public:
00031   Level( string fname,  TileInfo **_tilesinfo, ObjectInfo **_objectsinfo, 
00032         GameTimer *_game_timer, ScoreManager *_score_manager, Input *_input );
00033   ~Level();
00034   void LoadMap( string fname );
00035   void AddObjectPos( Object*, int pos );
00036   void DeleteObjectPos( Object*, int pos );
00037   bool AddObject( Object* );
00038   void DeleteObject( Object* );
00039   bool CheckTileCollisions( Object*, Tile** );
00040   /* in  - object to check
00041    * out - tile hit, or NULL if edge
00042    */
00043   Object *CheckObjectCollisions( Object * );
00044   ObjectCell *RemoveObjectCell( ObjectCell *objcell );
00045   void TilesAction( int xl, int xr, int interval);
00046   void ObjectsAction( int xl, int xr );
00047   void PlayerAction();
00048   void DrawTiles( int xposition, Display *display );
00049   void DrawObjects( int xposition, Display *display );
00050   int GameStatus();
00051   void EndLevel() { mission = 1; }
00052   Object *GetPlayer();
00053   int GetWidth();
00054   int GetHeight();
00055 };
00056 
00057 #endif /* __LEVEL_H */

Generated on Sun Mar 2 18:50:27 2003 for eounicorn by doxygen1.3-rc3