00001 /************************************************************************* 00002 bgentity.h 00003 Project Piedmont game 00004 ------------------------- 00005 00006 Date Created: 10/8/00 Last Modified: 05/05/08 00007 Programmer: David Foster 00008 Copyright: (C) 2000 David Foster (see file COPYING) 00009 E-mail: dfoster@computer.org 00010 00011 Description: main character class from which enemies and player 00012 character classes will be derived. 00013 00014 This program is free software; you can redistribute it and/or modify 00015 it under the terms of the GNU General Public License as published by 00016 the Free Software Foundation; either version 2 of the License, or 00017 (at your option) any later version. 00018 00019 This program is distributed in the hope that it will be useful, 00020 but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 GNU General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License 00025 along with this program; if not, write to the Free Software 00026 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00027 00028 ************************************************************************/ 00029 00030 #ifndef BGENTITY_H 00031 #define BGENTITY_H 00032 #define BGENTITY_DEBUG 0 //1 allows debug statements to be output 00033 00034 #include <stdio.h> 00035 #include <iostream> 00036 #include <stdlib.h> 00037 #include <string> 00038 #include <stddef.h> 00039 #include <unistd.h> 00040 00041 #include "SDL.h" 00042 #include "screen.h" 00043 #include "tiles.h" 00044 00045 using std::string; 00046 using namespace std; 00047 00048 00049 class BGEntity{ 00050 friend class Tiledata; 00051 private: 00052 tile_info *info; 00053 string name; 00054 int index; 00055 int walkable; 00056 int damage; 00057 SDL_Rect box; 00058 int onscreen; 00059 public: 00060 Tiledata *tiledata; 00061 BGEntity(); 00062 ~BGEntity(); 00063 void set_tiledata (Tiledata *t); 00064 void set_tileinfo (tile_info *newinfo); 00065 void set_tile_props (int first_prop, int second_prop); 00066 void set_index (int i); 00067 void set_onscreen (int i); 00068 void set_location (int x, int y); 00069 SDL_Rect get_box (); 00070 int is_onscreen (); 00071 int is_walkable (); 00072 int get_damage (); 00073 int get_tilesize (); 00074 string get_name (); 00075 void set_name (string str); 00076 }; 00077 00078 #endif 00079 00080 00081