00001 /* This file is part of Annchienta. 00002 * Copyright 2008 (C) Jasper Van der Jeugt 00003 * 00004 * Annchienta is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * Annchienta is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with Annchienta. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef ANNCHIENTA_AREA_H 00019 #define ANNCHIENTA_AREA_H 00020 00021 #include "Point.h" 00022 00023 namespace Annchienta 00024 { 00025 class Tile; 00026 00032 class Area 00033 { 00034 private: 00035 Point p1, p2; 00036 /* Also keep map points to speed stuff up. */ 00037 /* 1-----------4 00038 * | | 00039 * 2-----------3 00040 */ 00041 Point mp1, mp2, mp3, mp4; 00042 char *onCollisionScript, *onCollisionCode; 00043 bool visible; 00044 00045 public: 00046 00052 Area( Point p1, Point p2, bool visible=false ); 00053 ~Area(); 00054 00059 void setVisible( bool visible ); 00060 00063 bool isVisible() const; 00064 00069 void setOnCollisionScript( const char *filename ); 00070 00075 void setOnCollisionCode( const char *code ); 00076 00079 bool hasPoint( Point point ); 00080 00083 bool hasTile( Tile *tile ); 00084 00088 void onCollision(); 00089 }; 00090 00091 }; 00092 00093 #endif