My Project
effect5x3d.h
Go to the documentation of this file.
1/* effect5x3.h
2 */
3#ifndef PROGRESS_EFFECT5X3D_H
4#define PROGRESS_EFFECT5X3D_H
5
6#include "osl/progress.h"
8#include <algorithm>
9namespace osl
10{
11 namespace progress
12 {
20 {
29 static int makeProgress(Player defense, const NumEffectState& state,
30 Square king);
31 static int makeProgress(Player defense, const NumEffectState& state){
32 return makeProgress(defense,state,state.kingSquare(defense));
33 }
34 static int makeProgress(const NumEffectState& state)
35 {
36 return makeProgress(BLACK, state) + makeProgress(WHITE, state);
37 }
41 static const Progress16 progress16(int progress)
42 {
43 assert(progress >= 0);
44 const int rank = progress / 8 - 16; // 適当
45 return Progress16(std::max(std::min(rank, 15), 0));
46 }
51 static const Progress16 progress16each(int progress)
52 {
53 assert(progress >= 0);
54 const int rank = progress / 8 - 8; // 調整中
55 return Progress16(std::max(std::min(rank, 15), 0));
56 }
57 private:
59 public:
60 explicit Effect5x3d(const NumEffectState& state)
61 {
64 }
65 void changeTurn() {}
66 int progress(Player p) const { return progresses[p]; }
67 const Progress16 progress16() const
68 {
69 return progress16(progresses[0] + progresses[1]);
70 }
72 {
73 return progress16each(progress(p));
74 }
75 // 必要なもの
76 void update(const NumEffectState& new_state, Move last_move);
77 };
78 } // namespace progress
79} // namespace osl
80
81#endif /* PROGRESS_EFFECT5X3D_H */
82// ;;; Local Variables:
83// ;;; mode:c++
84// ;;; c-basic-offset:2
85// ;;; End:
圧縮していない moveの表現 .
利きを持つ局面
Square kingSquare() const
Definition simpleState.h:94
ProgressN< 16 > Progress16
Definition progress.h:42
Player
Definition basic_type.h:8
@ WHITE
Definition basic_type.h:10
@ BLACK
Definition basic_type.h:9
玉の周囲5x3の領域の利きの数ら計算した自玉のまわりの利きの数。 5x3領域は盤面内になるように補正する. 黒と白の両方の進行度を持つ. Effect5x3 との違い持駒の重みなし
Definition effect5x3d.h:20
Effect5x3d(const NumEffectState &state)
Definition effect5x3d.h:60
const Progress16 progress16() const
Definition effect5x3d.h:67
static int makeProgress(Player defense, const NumEffectState &state)
Definition effect5x3d.h:31
static int makeProgress(Player defense, const NumEffectState &state, Square king)
王の位置を指定したprogressの計算.
Definition effect5x3d.cc:8
static const Progress16 progress16each(int progress)
0-15 の値を返す.
Definition effect5x3d.h:51
CArray< int, 2 > progresses
Definition effect5x3d.h:58
static const Progress16 progress16(int progress)
0-15 の値を返す
Definition effect5x3d.h:41
int progress(Player p) const
Definition effect5x3d.h:66
static int makeProgress(const NumEffectState &state)
Definition effect5x3d.h:34
const Progress16 progress16(Player p) const
Definition effect5x3d.h:71
void update(const NumEffectState &new_state, Move last_move)
Definition effect5x3d.cc:34