4b3b55579463feafb18e60817d11e9af37eb3b6f
[supertux.git] / src / worldmap / teleporter.hpp
1 //  $Id$
2 //
3 //  SuperTux - Teleporter Worldmap Tile
4 //  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
5 //
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.
10 //
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.
15 //
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  02111-1307, USA.
19 #ifndef __WORLDMAP_TELEPORTER_HPP__
20 #define __WORLDMAP_TELEPORTER_HPP__
21
22 #include <memory>
23 #include <string>
24 #include "game_object.hpp"
25 #include "math/vector.hpp"
26 #include "lisp/lisp.hpp"
27
28 class Sprite;
29
30 namespace WorldMapNS
31 {
32
33 class Teleporter : public GameObject
34 {
35 public:
36   Teleporter(const lisp::Lisp* lisp);
37
38   virtual void draw(DrawingContext& context);
39   virtual void update(float elapsed_time);
40
41   /** Position (in tiles, not pixels) */
42   Vector pos;
43   
44   /** Sprite to render, or 0 for no sprite */
45   std::auto_ptr<Sprite> sprite;
46
47   /** Worldmap filename (relative to data root) to teleport to. Leave empty to use current word */
48   std::string worldmap;
49
50   /** Spawnpoint to teleport to. Leave empty to use "main" or last one */
51   std::string spawnpoint;
52
53   /** true if this teleporter does not need to be activated, but teleports Tux as soon as it's touched */
54   bool automatic;
55
56   /** optional map message to display */
57   std::string message;
58
59 };
60
61 }
62
63 #endif
64