00001 #ifndef _GOAL_H 00002 #define _GOAL_H 00003 00004 #include "object.h" 00005 00006 #include <gfx/vec3.h> 00007 00008 enum GoalType { 00009 INSIDE, 00010 OUTSIDE, 00011 ACTIVATE, 00012 DEACTIVATE 00013 }; 00014 00015 class Goal { 00016 public: 00017 00018 Goal( int ID, GoalType goal_type, int object_id, 00019 Vec3 position = Vec3( 0.0, 0.0, 0.0 ), 00020 double radius = 0.0, double delay = 0.0 ); 00021 00022 ~Goal( void ); 00023 00024 void tick( double t ); 00025 00026 bool check_goal( const Object* object ); 00027 00028 int get_object_id( void ) const { return _object_id; } 00029 00030 string get_info( ) const; 00031 00032 public: 00033 int _id; 00034 00035 GoalType _goaltype; 00036 00037 int _object_id; 00038 00039 Vec3 _position; 00040 00041 double _radius; 00042 00043 double _delay; 00044 00045 private: 00046 double _complete_timer; 00047 }; 00048 00049 #endif