1 /* Dungeon Master --- RPG Adventure Generator
2 Copyright © 2019 Javier Sancho <jsf@jsancho.org>
4 Dungeon Master is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 Dungeon Master is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with Dungeon Master. If not, see <http://www.gnu.org/licenses/>.
21 #include "generators.h"
23 struct compare_strings
25 bool operator() (const char* a, const char* b) const
27 return strcmp (a, b) < 0;
32 std::list<SceneGenerator*>,
33 compare_strings> registered_generators;
36 register_generator (char* name,
40 SceneGenerator* generator = (SceneGenerator*) malloc (sizeof (SceneGenerator));
41 generator->name = name;
42 generator->type = type;
43 generator->proc = proc;
45 registered_generators[type].push_back (generator);