My Project
effectContent.h
Go to the documentation of this file.
1/* effectContent.h
2 */
3#ifndef OSL_EFFECTCONTENT_H
4#define OSL_EFFECTCONTENT_H
5
6#include "osl/basic_type.h"
7
8namespace osl
9{
11 {
12 int effect;
13 EffectContent(int value) : effect(value)
14 {
15 }
16 public:
18 {
19 }
21 : effect(offset.intValue() << 1)
22 {
23 }
24 static const EffectContent DIRECT() { return EffectContent(1); }
29 return EffectContent((offset.intValue() << 1)+1);
30 }
34 bool hasEffect() const { return effect; }
38 bool hasUnblockableEffect() const { return (effect & 1); }
44 const Offset offset() const { return Offset::makeDirect(effect >> 1); }
48 bool hasBlockableEffect() const {
49 return (effect & (-effect) & ~1) != 0;
50 }
51 int intValue() const { return effect; }
52 };
53
55 {
56 return l.intValue() == r.intValue();
57 }
59 {
60 return ! (l == r);
61 }
63 {
64 return l.intValue() < r.intValue();
65 }
66
67} // namespace osl
68
69#endif /* OSL_EFFECTCONTENT_H */
70// ;;; Local Variables:
71// ;;; mode:c++
72// ;;; c-basic-offset:2
73// ;;; End:
EffectContent(Offset offset)
const Offset offset() const
返り値が0なら長い利きがない, 0以外なら辿るのに必要なoffset (2005/3/25 に仕様変更 - 長い利きだが隣の場合もoffsetを返す)
EffectContent(int value)
static const EffectContent DIRECT(Offset offset)
隣だが,offsetも与える
bool hasBlockableEffect() const
2005/3/25に変更.
bool hasEffect() const
短い利きがあるか,間がemptyなら長い利きがある
bool hasUnblockableEffect() const
短い利きがある.長い利きの隣も含む
int intValue() const
static const EffectContent DIRECT()
座標の差分
Definition basic_type.h:430
int intValue() const
Definition basic_type.h:448
static const Offset makeDirect(int value)
Definition basic_type.h:447
bool operator<(Offset l, Offset r)
Definition basic_type.h:520
bool operator!=(Offset l, Offset r)
Definition basic_type.h:516
bool operator==(Square l, Square r)
Definition basic_type.h:758