Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

location.h

00001 
00002 /***************************************************************************
00003                           location.h  -  description
00004                              -------------------
00005     begin                : Mon May 12 2003
00006     copyright            : (C) 2003 by Gabor Torok
00007     email                : cctorok@yahoo.com
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef LOCATION_H
00020 #define LOCATION_H
00021 
00022 #include "shape.h"
00023 #include "item.h"
00024 #include "creature.h"
00025 #include "effect.h"
00026 
00027 // forward decl.
00028 class Creature;
00029 class Effect;
00030 
00035 class Location {
00036 public:
00037   // shapes
00038   Uint16 x, y, z;
00039   Shape *shape;
00040   Item *item;
00041   Creature *creature;
00042 };
00043 
00044 class EffectLocation {
00045 public:
00046   Uint16 x, y, z;
00047   GLuint effectDuration;
00048   GLuint damageEffectCounter;
00049   Effect *effect;
00050   int effectType;
00051   GLuint effectDelay;
00052 
00053   // effects
00054   inline void setEffectType(int n) { this->effectType = n; }
00055   inline int getEffectType() { return effectType; }  
00056   inline Effect *getEffect() { return effect; }
00057   inline int getDamageEffect() { return damageEffectCounter; }
00058   inline void resetDamageEffect() { damageEffectCounter = SDL_GetTicks(); }
00059   inline bool isEffectOn() { 
00060         return (SDL_GetTicks() - damageEffectCounter < effectDuration + effectDelay ? true : false); 
00061   }
00062   inline bool isInDelay() {
00063         return (SDL_GetTicks() - damageEffectCounter < effectDelay ? true : false); 
00064   }
00065   inline void setEffectDelay(GLuint n) { this->effectDelay = n; }
00066   inline GLuint getEffectDelay() { return effectDelay; }
00067 };
00068 
00069 #endif
00070 

Generated on Thu Jun 16 21:50:43 2005 for scourge by  doxygen 1.4.0