2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
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.
12 #include <core/variant.h>
14 Variant
* chess_variant_factory();
16 Variants::Variants() {
17 addFactory("Chess", &chess_variant_factory
);
20 Variants
& Variants::instance() {
25 Variant
* Variants::get(const QString
& name
) const {
26 VariantFactory
* factory
= m_factories
.find(name
)->second
;
30 void Variants::addFactory(const QString
& name
, VariantFactory
* factory
) {
31 m_factories
[name
] = factory
;
34 QStringList
Variants::all() const {
36 for (Factories::const_iterator end
= m_factories
.end(), it
= m_factories
.begin(); it
!= end
; ++it
) {