Add Crazyhouse stub using a state delegator.
[tagua/yd.git] / src / variants / crazyhouse / crazyhouse.cpp
blob9f62227e2703686ac6ff8435036ed237e251987e
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 */
10 #include <core/repository.h>
11 #include <core/variantloader.h>
13 #include "statefactory.h"
15 using namespace Crazyhouse;
17 extern "C" KDE_EXPORT Repository*
18 taguacrazyhouse_initrepo(IVariantLoader* loader) {
19 Repository* repo = new Repository;
20 Repository* chess = loader->getRepository("chess");
21 if (!chess) return 0;
22 repo->setProxy(chess);
24 IStateFactory* chess_state_factory =
25 requestInterface<IStateFactory>(chess->getComponent("state_factory"));
26 repo->addComponent("state_factory", new StateFactory(chess_state_factory));
28 return repo;