2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
13 #include "variants/chess.h"
16 #include "variants/crazyhouse.h"
17 #include "variants/atomic.h"
18 #include "variants/king4pawns.h"
19 #include "variants/progressive.h"
20 #include "variants/reversi.h"
21 #include "variants/connect4.h"
22 #include "variants/chainreaction.h"
23 #include "variants/dummy.h"
24 #include "variants/shogi.h"
25 #include "variants/xiangqi.h"
28 bool Variant::s_initialized
= false;
30 Variant::Variants
Variant::s_registered
;
32 void Variant::register_variant(VariantInfo
* v
) {
33 s_registered
[v
->name()] = v
;
37 void Variant::register_variant() {
38 register_variant(T::info());
41 void Variant::initialize() {
42 // yes, this is a hack
43 #include "variants-autogen"
47 VariantInfo
* Variant::variant(const QString
& name
) {
51 Variants::iterator it
= s_registered
.find(name
);
52 return it
== s_registered
.end() ? NULL
: it
->second
;
55 const Variant::Variants
& Variant::allVariants(){