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_ENTITY_H 00019 #define ANNCHIENTA_ENTITY_H 00020 00021 #include "Point.h" 00022 #include "Engine.h" 00023 00024 namespace Annchienta 00025 { 00026 class Layer; 00027 class Mask; 00028 00029 enum EntityType 00030 { 00031 TileEntity = 0, 00032 StaticObjectEntity, 00033 PersonEntity 00034 }; 00035 00040 class Entity 00041 { 00042 protected: 00043 bool drawn; 00044 char name[DEFAULT_STRING_SIZE]; 00045 Layer *layer; 00046 00047 public: 00048 00052 Entity( const char *name="none" ); 00053 virtual ~Entity(); 00054 00058 virtual EntityType getEntityType() const = 0; 00059 00062 virtual void draw() = 0; 00063 00066 virtual void update() = 0; 00067 00070 virtual int getDepth() = 0; 00071 00074 virtual Mask *getMask() const = 0; 00075 00081 virtual Point getMaskPosition() const = 0; 00082 00086 virtual bool collidesWith( Entity *other ) const; 00087 00092 void setDrawn( bool drawn ); 00093 00096 bool isDrawn() const; 00097 00100 void setName( const char *name ); 00101 00104 const char *getName() const; 00105 00111 void setLayer( Layer *layer ); 00112 00115 Layer *getLayer() const; 00116 }; 00117 00118 }; 00119 00120 #endif