Added my own flapping. :)
[supertux.git] / src / badguy_specs.h
1 /***************************************************************************
2                badguy_specs.h  -  badguys properties table
3                      -------------------
4     begin                : Oct, 11 2004
5     copyright            : (C) 2004 by Ricardo Cruz
6     email                : rick2@aeiou.pt
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #ifndef SUPERTUX_BADGUY_SPECS_H
19 #define SUPERTUX_BADGUY_SPECS_H
20
21 #include <string>
22 #include <map>
23
24 #include "utils/lispreader.h"
25
26 using namespace SuperTux;
27
28 namespace SuperTux {
29 class Sprite;
30 }
31
32 class BadGuySpecs;
33 class BadGuySpecsManager;
34 extern BadGuySpecsManager* badguyspecs_manager;
35
36 class BadGuySpecsManager
37 {
38 public:
39   BadGuySpecsManager(const std::string& filename);
40   ~BadGuySpecsManager();
41
42   void  load_resfile(const std::string& filename);
43   /** loads a sprite.
44    * WARNING: You must not delete the returned object.
45    */
46   BadGuySpecs* load(const std::string& name);
47
48 private:
49   typedef std::map<std::string, BadGuySpecs*> BadGuysSpecs;
50   BadGuysSpecs badguys_specs;
51 };
52
53 class BadGuySpecs
54 {
55 public:
56   BadGuySpecs(LispReader& reader);
57   BadGuySpecs(std::string& kind);
58   ~BadGuySpecs();
59
60   std::string get_name();
61
62   // proprities
63   std::string kind;
64   Sprite* sprite;
65
66 private:
67   void reset();
68 };
69
70
71 #endif /*SUPERTUX_BADGUY_SPECS_H*/