4 // Copyright (C) 2005 Philipp <balinor@pnxs.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 #include "math/vector.hpp"
28 #include "game_object.hpp"
29 #include "lisp/lisp.hpp"
33 typedef std::map<std::string,Path*> PathRegistry;
36 typedef std::list<Vector> PathPoints;
37 typedef std::list<Vector>::const_iterator PathPointIter;
40 class Path : public GameObject
43 Path(const lisp::Lisp& reader);
46 virtual void update(float elapsed_time);
47 virtual void draw(DrawingContext& context);
49 const Vector& GetPosition();
50 const Vector& GetStart();
51 const Vector& GetLastMovement();
53 // WARNING: returns NULL if not found !
54 static Path* GetByName(const std::string& name);
58 float pixels_per_second;
60 PathPointIter next_target;
65 void calc_next_velocity();
67 static PathRegistry registry;