27 #ifndef ELEMENT_CREG_H
28 #define ELEMENT_CREG_H
38 #define CREG_VERSION 1
44 typedef typename CC::ATOM_TYPE T;
45 typedef typename CC::PARAM_CONFIG P;
46 enum { R = P::EVENT_WINDOW_RADIUS };
56 m_targetDensity(
this,
"density",
"Target Density",
57 "The Creg will try to fill this many spots in its event "
58 "window with other Creg.", 0, 3, 41)
66 const T& me,
const SPoint& offset)
const
83 return "The Configurable Regulator regulates the density of the universe based "
84 "on a configurable parameter.";
99 const SPoint& rel = md.GetPoint(i);
110 if(rand.
OneIn(cregCount))
118 if(rand.
OneIn(nonCregCount))
125 if(cregCount > (u32) m_targetDensity.GetValue())
129 else if(cregCount < m_targetDensity.GetValue())
137 Element_Creg<CC> Element_Creg<CC>::THE_INSTANCE;
u32 GetFirstIndex(const u32 radius) const
Definition: MDist.h:112
u32 GetType() const
Definition: Element.h:290
Definition: Element_Empty.h:41
virtual const char * GetDescription() const
Definition: Element_Creg.h:81
u32 GetLastIndex(const u32 radius) const
Definition: MDist.h:129
void SetName(const char *name)
Definition: Element.h:209
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_Creg.h:41
Definition: Parameter.h:593
virtual u32 DefaultPhysicsColor() const
Definition: Element_Creg.h:71
virtual const T & GetDefaultAtom() const
Definition: Element.h:382
virtual void Behavior(EventWindow< CC > &window) const
Definition: Element_Creg.h:87
virtual u32 PercentMovable(const T &you, const T &me, const SPoint &offset) const
Definition: Element_Creg.h:65
static MDist< R > & get()
Definition: MDist.tcc:193
Definition: Element_Wall.h:42
Definition: ElementTable.h:43
bool SetRelativeAtom(const SPoint &offset, const T &atom)
Definition: EventWindow.tcc:15
virtual u32 DefaultLowlightColor() const
Definition: Element_Creg.h:76