Moved Variant out of core. Changed plugin initialization function signature.
[tagua/yd.git] / src / variants / chess / chess.cpp
blobbb712a9ad2ec5287e62a3cebf6d984f66977b627
1 /*
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.
9 */
11 #include <core/defaultpolicy.h>
12 #include <core/repository.h>
13 #include <core/variantloader.h>
15 #include "animator.h"
16 #include "colors.h"
17 #include "moveserializer.h"
18 #include "namer.h"
19 #include "types.h"
20 #include "statefactory.h"
21 #include "validator.h"
23 using namespace Chess;
25 extern "C" KDE_EXPORT Repository* taguachess_initrepo(const IVariantLoader*) {
26 Repository* repo = new Repository;
27 repo->addComponent("player/0", White::self());
28 repo->addComponent("player/1", Black::self());
30 repo->addComponent("type/king", King::self());
31 repo->addComponent("type/queen", Queen::self());
32 repo->addComponent("type/rook", Rook::self());
33 repo->addComponent("type/bishop", Bishop::self());
34 repo->addComponent("type/knight", Knight::self());
35 repo->addComponent("type/pawn", Pawn::self());
37 repo->addComponent("state_factory", new StateFactory(Point(8, 8)));
38 repo->addComponent("validator", new Validator);
39 repo->addComponent("animator_factory", new AnimatorFactory);
40 repo->addComponent("namer", new Namer);
41 repo->addComponent("policy", new DefaultPolicy);
43 repo->addComponent("move_serializer/simple", new MoveSerializer("simple"));
44 repo->addComponent("move_serializer/decorated", new MoveSerializer("decorated"));
45 MoveSerializer* san = new MoveSerializer("compact");
46 repo->addComponent("move_serializer/san", san);
47 repo->addComponent("move_serializer/compact", san);
49 return repo;