2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2007 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 <core/point.h>
14 #include <core/repository.h>
15 #include <core/variantloader.h>
16 #include <core/state.h>
20 extern "C" KDE_EXPORT Repository
*
21 taguachess5x5_initrepo(IVariantLoader
* loader
) {
22 Repository
* repo
= new Repository
;
23 Repository
* chess
= loader
->getRepository("chess");
25 // bail out if there is no chess variant
28 repo
->setProxy(chess
);
31 Component
* chess_state_comp
= chess
->getComponent("state");
32 IState
* chess_state
= requestInterface
<IState
>(chess_state_comp
);
33 Q_ASSERT(chess_state
);
35 const IBehaviour
* behaviour
= chess_state
->behaviour();
38 bool ok
= QMetaObject::invokeMethod(chess_state_comp
, "clone",
39 Q_RETURN_ARG(Component
*, state
),
40 Q_ARG(const IBehaviour
*, behaviour
),
42 Q_ARG(Point
, Point(5, 5)));
46 repo
->addComponent("state", state
);