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_PERSON_H 00019 #define ANNCHIENTA_PERSON_H 00020 00021 #include "StaticObject.h" 00022 00023 namespace Annchienta 00024 { 00025 class PersonControl; 00026 00031 class Person: public StaticObject 00032 { 00033 protected: 00034 PersonControl *control; 00035 bool frozen; 00036 int heading; 00037 float speed; 00038 00039 #ifndef SWIG 00040 /* Gives an error when parsed through swig? */ 00041 const static int squaredInteractDistance = 600; 00042 #endif 00043 00044 public: 00045 00050 Person( const char *name, const char *configFile ); 00051 00054 virtual ~Person(); 00055 00058 virtual EntityType getEntityType() const; 00059 00063 virtual void setSpeed( float speed ); 00064 00067 virtual float getSpeed() const; 00068 00071 virtual void update(); 00072 00085 virtual bool move( int x, int y, bool force=false ); 00086 00094 virtual bool stepTo( Point point, bool force=true ); 00095 00101 virtual void freeze( bool value ); 00102 00105 virtual bool isFrozen() const; 00106 00110 virtual void setControl( PersonControl *personControl ); 00111 00115 virtual void setInputControl(); 00116 00120 virtual void setSampleControl(); 00121 00125 virtual void setNullControl(); 00126 00130 virtual void setStandAnimation( bool forceFromHeading=false ); 00131 00136 virtual void lookAt( StaticObject *object ); 00137 00142 virtual void collisionWithLayerAreas(); 00143 }; 00144 00145 }; 00146 00147 #endif