1 /** 2 ** expinf.h - Explosion information from 'shape_info.txt'. 3 ** 4 ** Written: 06/01/2008 - Marzo 5 **/ 6 7 #ifndef INCL_EXPINF_H 8 #define INCL_EXPINF_H 1 9 10 /* 11 Copyright (C) 2008 The Exult Team 12 13 This program is free software; you can redistribute it and/or 14 modify it under the terms of the GNU General Public License 15 as published by the Free Software Foundation; either version 2 16 of the License, or (at your option) any later version. 17 18 This program is distributed in the hope that it will be useful, 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 GNU General Public License for more details. 22 23 You should have received a copy of the GNU General Public License 24 along with this program; if not, write to the Free Software 25 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 26 */ 27 28 #include "baseinf.h" 29 #include "exult_constants.h" 30 31 #include <iosfwd> 32 33 class Shape_info; 34 35 /* 36 * Information about explosions. 37 */ 38 class Explosion_info : public Base_info { 39 int sprite; // Explosion sprite. 40 int sfxnum; // SFX to play or 255 for none. 41 public: 42 friend class Shape_info; 43 // Read in from file. 44 bool read(std::istream &in, int version, Exult_Game game); 45 // Write out. 46 void write(std::ostream &out, int shapenum, Exult_Game game); set(int shape,int sfx)47 void set(int shape, int sfx) { 48 if (sfxnum != sfx || sprite != shape) { 49 set_modified(true); 50 sfxnum = sfx; 51 sprite = shape; 52 } 53 } get_sprite()54 int get_sprite() const { 55 return sprite; 56 } get_sfx()57 int get_sfx() const { 58 return sfxnum; 59 } get_info_flag()60 static int get_info_flag() { 61 return 0x10; 62 } 63 enum { is_binary = 0, entry_size = 0 }; 64 }; 65 66 #endif 67