1 /* ScummVM - Graphic Adventure Engine 2 * 3 * ScummVM is the legal property of its developers, whose names 4 * are too numerous to list here. Please refer to the COPYRIGHT 5 * file distributed with this source distribution. 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef ULTIMA4_GAME_AURA_H 24 #define ULTIMA4_GAME_AURA_H 25 26 #include "ultima/ultima4/core/observable.h" 27 28 namespace Ultima { 29 namespace Ultima4 { 30 31 /** 32 * Aura class 33 */ 34 class Aura : public Observable<Aura *> { 35 public: 36 enum Type { 37 NONE, 38 HORN, 39 JINX, 40 NEGATE, 41 PROTECTION, 42 QUICKNESS 43 }; 44 45 Aura(); 46 getDuration()47 int getDuration() const { 48 return _duration; 49 } getType()50 Aura::Type getType() const { 51 return _type; 52 } isActive()53 bool isActive() const { 54 return _duration > 0; 55 } 56 57 void setDuration(int d); 58 void set(Type = NONE, int d = 0); 59 void setType(Type t); 60 61 bool operator==(const Type &t) const { 62 return _type == t; 63 } 64 bool operator!=(const Type &t) const { 65 return !operator==(t); 66 } 67 68 void passTurn(); 69 70 private: 71 Type _type; 72 int _duration; 73 }; 74 75 } // End of namespace Ultima4 76 } // End of namespace Ultima 77 78 #endif 79