2 Copyright (c) 2008 Yann Dirson <ydirson@altern.org>
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.
10 #ifndef MINISHOGI__BEHAVIOUR_H
11 #define MINISHOGI__BEHAVIOUR_H
13 #include <core/delegators/behaviour.h>
14 #include <core/promotionmanager.h>
20 class TAGUA_EXPORT Behaviour
: public Delegators::Behaviour
{
22 Behaviour
* m_delegator
;
24 Behaviour(IBehaviour
* behaviour
);
26 public Q_SLOTS
: // delegated
27 void setPromotionManager(PromotionManager
* pm
) {
28 Q_ASSERT(QMetaObject::invokeMethod(m_dgate_behaviour
, "setPromotionManager",
29 Q_ARG(PromotionManager
*, pm
)));
32 const PromotionManager
* promotionManager() const {
33 const PromotionManager
* result
;
34 Q_ASSERT(QMetaObject::invokeMethod(m_dgate_behaviour
, "promotionManager",
35 Q_RETURN_ARG(const PromotionManager
*, result
)));
39 bool mayPromote(const IState
* state
, const Move
& move
) const {
41 Q_ASSERT(QMetaObject::invokeMethod(m_dgate_behaviour
, "mayPromote",
42 Q_RETURN_ARG(bool, result
),
43 Q_ARG(const IState
*, state
),
44 Q_ARG(const Move
, move
)));
48 public Q_SLOTS
: // overridden
49 unsigned promotionZoneWidth() const { return 1; }
52 } // namespace MiniShogi
54 #endif // MINISHOGI__BEHAVIOUR_H