MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
MFM::Element_MQBar< CC > Class Template Reference

#include <Element_MQBar.h>

Inheritance diagram for MFM::Element_MQBar< CC >:
MFM::Element< CC > MFM::Element< CC >

Public Types

typedef BitVector
< P::BITS_PER_ATOM > 
BVA
 
typedef BitField< BVA,
BITS_BAR_COORD_LEN,
STATE_BITS_START > 
AFSize
 
typedef BitField< BVA,
BITS_BAR_COORD_LEN,
AFSize::END > 
AFPos
 
typedef BitField< BVA,
BITS_SYMI, AFPos::END > 
AFSymI
 
typedef BitField< BVA,
BITS_TIMER, AFSymI::END > 
AFTimer
 
typedef AtomicParameterType
< CC, VD::U32, BITS_WIDE,
STATE_BITS_START > 
APBarWidth
 
typedef AtomicParameterType
< CC, VD::U32, BITS_HIGH,
APBarWidth::END > 
APBarHeight
 
typedef AtomicParameterType
< CC, VD::U32, BITS_WIDE,
APBarHeight::END > 
APXPos
 
typedef AtomicParameterType
< CC, VD::U32, BITS_HIGH,
APXPos::END > 
APYPos
 
typedef AtomicParameterType
< CC, VD::U32, BITS_SYMI,
APYPos::END > 
APSymI
 
typedef AtomicParameterType
< CC, VD::U32, BITS_TIMER,
APSymI::END > 
APTimer
 

Public Member Functions

u32 GetSymI (const T &atom) const
 
SPoint GetMax (const T &atom) const
 
SPoint GetPos (const T &atom) const
 
u32 GetTimer (const T &atom) const
 
bool FitsInRep (const SPoint &v) const
 
void SetSize (T &atom, const SPoint &v) const
 
void SetPos (T &atom, const SPoint v) const
 
void SetSymI (T &atom, const u32 sym) const
 
void SetTimer (T &atom, const u32 tmr) const
 
virtual const T & GetDefaultAtom () const
 
virtual T BuildDefaultAtom () const
 
virtual u32 DefaultPhysicsColor () const
 
virtual u32 DefaultLowlightColor () const
 
virtual u32 PercentMovable (const T &you, const T &me, const SPoint &offset) const
 
virtual u32 LocalPhysicsColor (const T &atom, u32 selector) const
 
virtual u32 Diffusability (EventWindow< CC > &ew, SPoint nowAt, SPoint maybeAt) const
 
virtual void Behavior (EventWindow< CC > &window) const
 
u32 GetSymI (const T &atom) const
 
SPoint GetMax (const T &atom) const
 
SPoint GetPos (const T &atom) const
 
u32 GetTimer (const T &atom) const
 
bool FitsInRep (const SPoint &v) const
 
void SetSize (T &atom, const SPoint &v) const
 
void SetPos (T &atom, const SPoint v) const
 
void SetSymI (T &atom, const u32 sym) const
 
void SetTimer (T &atom, const u32 tmr) const
 
virtual const T & GetDefaultAtom () const
 
virtual T BuildDefaultAtom () const
 
virtual u32 DefaultPhysicsColor () const
 
virtual u32 DefaultLowlightColor () const
 
virtual u32 PercentMovable (const T &you, const T &me, const SPoint &offset) const
 
virtual u32 LocalPhysicsColor (const T &atom, u32 selector) const
 
virtual u32 Diffusability (EventWindow< CC > &ew, SPoint nowAt, SPoint maybeAt) const
 
virtual void Behavior (EventWindow< CC > &window) const
 
- Public Member Functions inherited from MFM::Element< CC >
 Element (const UUID &uuid)
 
void AllocateType ()
 
u32 GetType () const
 
const char * GetAtomicSymbol () const
 
const char * GetName () const
 
virtual void AppendDescription (const T *atom, OString64 &desc) const
 
bool IsType (u32 type) const
 
const UUIDGetUUID () const
 
virtual u32 PhysicsColor () const
 
virtual const char * GetDescription () const
 
void ToggleLowlightPhysicsColor ()
 
u32 NoDiffusability (EventWindow< CC > &ew, SPoint nowAt, SPoint maybeAt) const
 
const ElementParameters< CC > & GetElementParameters () const
 
ElementParameters< CC > & GetElementParameters ()
 
const AtomicParameters< CC > & GetAtomicParameters () const
 
AtomicParameters< CC > & GetAtomicParameters ()
 

Static Public Member Functions

static const u32 TYPE ()
 
static bool IsOurType (u32 type)
 
static const u32 TYPE ()
 
static bool IsOurType (u32 type)
 

Data Fields

APBarWidth m_barWidth
 
APBarHeight m_barHeight
 
APXPos m_xPos
 
APYPos m_yPos
 
APSymI m_symI
 
APTimer m_timer
 

Static Public Attributes

static Element_MQBar THE_INSTANCE
 
static const u32 BITS_WIDE = 5
 
static const u32 BITS_HIGH = 7
 
static const u32 BITS_SYMI = 2
 
static const u32 BITS_TIMER = 4
 
static const u32 MAX_TIMER_VALUE = 9
 
static const u32 BITS_BAR_COORD_LEN = BITS_WIDE + BITS_HIGH
 
static const u32 STATE_BITS_START = P3Atom<P>::P3_STATE_BITS_POS
 
static const u32 STATE_BITS_END = AFTimer::END
 
static const u32 STATE_BITS_COUNT = STATE_BITS_END - STATE_BITS_START + 1
 
- Static Public Attributes inherited from MFM::Element< CC >
static const u32 COMPLETE_DIFFUSABILITY = 1000
 

Additional Inherited Members

- Protected Member Functions inherited from MFM::Element< CC >
const BitVector
< P::BITS_PER_ATOM > & 
GetBits (const T &atom) const
 
BitVector< P::BITS_PER_ATOM > & GetBits (T &atom) const
 
bool IsValidAtomicSymbol (const char *symbol)
 
void SetAtomicSymbol (const char *symbol)
 
void SetName (const char *name)
 
void Diffuse (EventWindow< CC > &window) const
 

Detailed Description

template<class CC>
class MFM::Element_MQBar< CC >

A moving bar-forming class, with symmetry, that grows a quadrilateral of itself, and advances a stability-based state machine. This guy attempts 'vegetative motion' – using only asymmetric growth.

Bar grid positions in an event window

-4 -3 -2 -1 0 1 2 3 4 -4 . . . . x . . . . -3 . . . . . . . . . -2 . . x . x . x . . -1 . . . . . . . . . 0 x . x . C . x . x 1 . . . . . . . . . 2 . . x . x . x . . 3 . . . . . . . . . 4 . . . . x . . . .

Each bar atom knows how big the grid is supposed to be (GetMax()), where within that grid it is supposed to be (GetPos()), and what symmetry it is using (GetSym()).

Class: (C1) Name is Element_MQBar (C2) Type is 0x4ba2

A modified bar-forming class, with symmetry, that grows a quadrilateral of itself, and advances a stability-based state machine.

Bar grid positions in an event window

-4 -3 -2 -1 0 1 2 3 4 -4 . . . . x . . . . -3 . . . . . . . . . -2 . . x . x . x . . -1 . . . . . . . . . 0 x . x . C . x . x 1 . . . . . . . . . 2 . . x . x . x . . 3 . . . . . . . . . 4 . . . . x . . . .

Each bar atom knows how big the grid is supposed to be (GetMax()), where within that grid it is supposed to be (GetPos()), and what symmetry it is using (GetSym()).

Class: (C1) Name is Element_MQBar (C2) Type is 0x4ba2

Member Function Documentation

template<class CC >
virtual void MFM::Element_MQBar< CC >::Behavior ( EventWindow< CC > &  window) const
inlinevirtual

Describes the behavior of this Element. This is invoked when an Atom of this Element is chosen as the center of an EventWindow for an Event, which is given as a parameter.

Parameters
windowThe EventWindow describing the Event which is currently being executed.

Implements MFM::Element< CC >.

template<class CC >
virtual void MFM::Element_MQBar< CC >::Behavior ( EventWindow< CC > &  window) const
inlinevirtual

Describes the behavior of this Element. This is invoked when an Atom of this Element is chosen as the center of an EventWindow for an Event, which is given as a parameter.

Parameters
windowThe EventWindow describing the Event which is currently being executed.

Implements MFM::Element< CC >.

template<class CC >
virtual T MFM::Element_MQBar< CC >::BuildDefaultAtom ( ) const
inlinevirtual

Describes how the default Atom of this Element should be constructed. The default behavior of this method builds an atom with the type of this Element and otherwise empty fields.

Returns
The default Atom of this Element, to be stored in m_defaultAtom .

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual T MFM::Element_MQBar< CC >::BuildDefaultAtom ( ) const
inlinevirtual

Describes how the default Atom of this Element should be constructed. The default behavior of this method builds an atom with the type of this Element and otherwise empty fields.

Returns
The default Atom of this Element, to be stored in m_defaultAtom .

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::DefaultLowlightColor ( ) const
inlinevirtual

Gets the 32-bit ARGB formatted color that all Atoms of this Element will be drawn with when they have lowlight drawing enabled.

Returns
The lowlight color to draw all Atoms of this Element with.

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::DefaultLowlightColor ( ) const
inlinevirtual

Gets the 32-bit ARGB formatted color that all Atoms of this Element will be drawn with when they have lowlight drawing enabled.

Returns
The lowlight color to draw all Atoms of this Element with.

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::DefaultPhysicsColor ( ) const
inlinevirtual

Gets the 32-bit ARGB formatted color that all Atoms of this Element will be drawn with.

Returns
The 32-bit ARGB formatted color that all Atoms of this Element will be drawn with.

Implements MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::DefaultPhysicsColor ( ) const
inlinevirtual

Gets the 32-bit ARGB formatted color that all Atoms of this Element will be drawn with.

Returns
The 32-bit ARGB formatted color that all Atoms of this Element will be drawn with.

Implements MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::Diffusability ( EventWindow< CC > &  ew,
SPoint  nowAt,
SPoint  maybeAt 
) const
inlinevirtual

We do not diffuse

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::Diffusability ( EventWindow< CC > &  ew,
SPoint  nowAt,
SPoint  maybeAt 
) const
inlinevirtual

We do not diffuse

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual const T& MFM::Element_MQBar< CC >::GetDefaultAtom ( ) const
inlinevirtual

Gets the default Atom of this Element . If this Element has not been assigned a type through AllocateType() , this will FAIL with ILLEGAL_STATE. NOTE: The defaultAtom returned here will have been constructed by Element::BuildDefaultAtom, which leaves all state bits zero. If this is not desirable, element subclasses should override this to provide their own default atom initialization.

Returns
The default Atom of this Element.
See Also
BuildDefaultAtom

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual const T& MFM::Element_MQBar< CC >::GetDefaultAtom ( ) const
inlinevirtual

Gets the default Atom of this Element . If this Element has not been assigned a type through AllocateType() , this will FAIL with ILLEGAL_STATE. NOTE: The defaultAtom returned here will have been constructed by Element::BuildDefaultAtom, which leaves all state bits zero. If this is not desirable, element subclasses should override this to provide their own default atom initialization.

Returns
The default Atom of this Element.
See Also
BuildDefaultAtom

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::LocalPhysicsColor ( const T &  atom,
u32  selector 
) const
inlinevirtual

Used during rendering, will select a color for any Atom of this Element to be rendered with. This should be overridden if wanting to use a gradient or some other variable color based on the body of the specified Atom .

Parameters
atomThe Atom of this element of which to find a color for.
selectorAn additional argument which may be used to determine the color of which to render atom
Returns
The 32-bit ARGB color of which to render atom with.

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::LocalPhysicsColor ( const T &  atom,
u32  selector 
) const
inlinevirtual

Used during rendering, will select a color for any Atom of this Element to be rendered with. This should be overridden if wanting to use a gradient or some other variable color based on the body of the specified Atom .

Parameters
atomThe Atom of this element of which to find a color for.
selectorAn additional argument which may be used to determine the color of which to render atom
Returns
The 32-bit ARGB color of which to render atom with.

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::PercentMovable ( const T &  you,
const T &  me,
const SPoint offset 
) const
inlinevirtual

Determines how likely an Atom of this type is to be swapped with during diffusal.

Returns
an integral percentage, from 0 to 100, describing the desire of an atom of this type to be moved; 0 being impossible to move and 100 being completely fine with moving.

Implements MFM::Element< CC >.

template<class CC >
virtual u32 MFM::Element_MQBar< CC >::PercentMovable ( const T &  you,
const T &  me,
const SPoint offset 
) const
inlinevirtual

Determines how likely an Atom of this type is to be swapped with during diffusal.

Returns
an integral percentage, from 0 to 100, describing the desire of an atom of this type to be moved; 0 being impossible to move and 100 being completely fine with moving.

Implements MFM::Element< CC >.


The documentation for this class was generated from the following file: