1 #ifndef ELEMENT_MOVER_H
2 #define ELEMENT_MOVER_H
15 #define MOVER_VERSION 1
31 typedef typename CC::ATOM_TYPE T;
32 typedef typename CC::PARAM_CONFIG P;
33 enum { R = P::EVENT_WINDOW_RADIUS };
38 static const u32 TYPE() {
42 static const u32 TYPE_BITS = 12;
43 static const u32 TYPE_MASK = (1<<TYPE_BITS)-1;
45 static const u32 STATE_BITS = 0;
47 static bool IsMoverType(u32 type) {
58 static T defaultAtom(TYPE(),0,0,STATE_BITS);
82 const u32 selfType =
self.GetType();
84 if (!IsMoverType(selfType))
101 const SPoint sp = md.GetPoint(idx);
105 const u32 otherType = other.GetType();
109 if (random.
OneIn(++emptyCount)) {
120 if (random.
OneIn(++occupCount)) {
126 if (occupCount > 0) {
129 const u32 otherType = other.GetType();
134 if (isRes && moverCount==0 && resCount > 1) {
136 }
else if (emptyCount > 0) {
148 Element_Mover<CC> Element_Mover<CC>::THE_INSTANCE;
u32 GetFirstIndex(const u32 radius) const
Definition: MDist.h:112
void Diffuse(EventWindow< CC > &window) const
Definition: Element.tcc:73
u32 GetType() const
Definition: Element.h:290
virtual u32 DefaultPhysicsColor() const
Definition: Element_Mover.h:62
Definition: Element_Empty.h:41
u32 GetLastIndex(const u32 radius) const
Definition: MDist.h:129
void SetAtomicSymbol(const char *symbol)
Definition: Element.h:193
bool OneIn(u32 odds)
Definition: Random.h:96
Random & GetRandom()
Definition: EventWindow.h:122
const T & GetRelativeAtom(const SPoint &offset) const
Definition: EventWindow.tcc:26
Definition: Element_Dreg.h:47
virtual u32 PercentMovable(const T &you, const T &me, const SPoint &offset) const
Definition: Element_Mover.h:72
const T & GetCenterAtom() const
Definition: EventWindow.h:209
virtual void Behavior(EventWindow< CC > &window) const
Definition: Element_Mover.h:77
virtual u32 DefaultLowlightColor() const
Definition: Element_Mover.h:67
bool IsType(u32 type) const
Definition: Element.h:345
Definition: Element_Mover.h:28
static MDist< R > & get()
Definition: MDist.tcc:193
Definition: Element_Res.h:48
Definition: ElementTable.h:43
bool SetRelativeAtom(const SPoint &offset, const T &atom)
Definition: EventWindow.tcc:15
virtual const T & GetDefaultAtom() const
Definition: Element_Mover.h:56
void SwapAtoms(const SPoint &locA, const SPoint &locB)
Definition: EventWindow.tcc:40