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 
8 namespace 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); }
28  static const EffectContent DIRECT(Offset offset) {
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:
osl::EffectContent::offset
const Offset offset() const
返り値が0なら長い利きがない, 0以外なら辿るのに必要なoffset (2005/3/25 に仕様変更 - 長い利きだが隣の場合もoffsetを返す)
Definition: effectContent.h:44
osl::Offset::makeDirect
static const Offset makeDirect(int value)
Definition: basic_type.h:447
basic_type.h
osl::EffectContent::EffectContent
EffectContent(Offset offset)
Definition: effectContent.h:20
osl::Offset
座標の差分
Definition: basic_type.h:430
osl::EffectContent::EffectContent
EffectContent()
Definition: effectContent.h:17
osl::EffectContent::intValue
int intValue() const
Definition: effectContent.h:51
osl::EffectContent::EffectContent
EffectContent(int value)
Definition: effectContent.h:13
osl::EffectContent::hasUnblockableEffect
bool hasUnblockableEffect() const
短い利きがある.長い利きの隣も含む
Definition: effectContent.h:38
osl::operator<
bool operator<(Offset l, Offset r)
Definition: basic_type.h:520
osl::operator==
bool operator==(Square l, Square r)
Definition: basic_type.h:758
osl::EffectContent::hasEffect
bool hasEffect() const
短い利きがあるか,間がemptyなら長い利きがある
Definition: effectContent.h:34
osl::EffectContent::hasBlockableEffect
bool hasBlockableEffect() const
2005/3/25に変更.
Definition: effectContent.h:48
osl::EffectContent
Definition: effectContent.h:11
osl::EffectContent::DIRECT
static const EffectContent DIRECT()
Definition: effectContent.h:24
osl::Offset::intValue
int intValue() const
Definition: basic_type.h:448
osl::EffectContent::effect
int effect
Definition: effectContent.h:12
osl::operator!=
bool operator!=(Offset l, Offset r)
Definition: basic_type.h:516
osl::EffectContent::DIRECT
static const EffectContent DIRECT(Offset offset)
隣だが,offsetも与える
Definition: effectContent.h:28
osl
Definition: additionalEffect.h:6