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 | Static Public Attributes
MFM::Element_Fish< CC > Class Template Reference
Inheritance diagram for MFM::Element_Fish< CC >:
MFM::AbstractElement_WaPat< CC > MFM::Element< CC >

Public Types

enum  { ELEMENT_VERSION = 1 }
 
- Public Types inherited from MFM::AbstractElement_WaPat< CC >
enum  {
  R = P::EVENT_WINDOW_RADIUS, BITS = P::BITS_PER_ATOM, BIRTH_AGE_POS = P3Atom<P>::P3_STATE_BITS_POS, BIRTH_AGE_LEN = 8,
  CURRENT_AGE_POS = BIRTH_AGE_POS + BIRTH_AGE_LEN, CURRENT_AGE_LEN = 8, WAPAT_FIRST_FREE_POS = CURRENT_AGE_POS + CURRENT_AGE_LEN
}
 
typedef CC::ATOM_TYPE T
 
typedef CC::PARAM_CONFIG P
 
typedef BitField< BitVector
< BITS >, VD::U32,
CURRENT_AGE_LEN,
CURRENT_AGE_POS > 
AFCurrentAge
 
typedef BitField< BitVector
< BITS >, VD::U32,
BIRTH_AGE_LEN, BIRTH_AGE_POS > 
AFBirthAge
 

Public Member Functions

virtual const T & GetDefaultAtom () const
 
virtual u32 DefaultPhysicsColor () const
 
virtual u32 Diffusability (EventWindow< CC > &ew, SPoint nowAt, SPoint maybeAt) const
 
virtual u32 PercentMovable (const T &you, const T &me, const SPoint &offset) const
 
virtual void Behavior (EventWindow< CC > &window) const
 
- Public Member Functions inherited from MFM::AbstractElement_WaPat< CC >
u32 GetCurrentAge (const T &us) const
 
void SetCurrentAge (T &us, const u32 age) const
 
u32 GetBirthAge (const T &us) const
 
void SetBirthAge (T &us, const u32 age) const
 
 AbstractElement_WaPat (const UUID &uuid)
 
- 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
 
virtual u32 DefaultLowlightColor () const
 
void ToggleLowlightPhysicsColor ()
 
virtual u32 LocalPhysicsColor (const T &atom, u32 selector) const
 
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 Public Attributes

static Element_Fish THE_INSTANCE
 
- 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 >
virtual T BuildDefaultAtom () const
 
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
 

Member Function Documentation

template<class CC >
virtual void MFM::Element_Fish< 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 u32 MFM::Element_Fish< 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_Fish< CC >::Diffusability ( EventWindow< CC > &  ew,
SPoint  nowAt,
SPoint  maybeAt 
) const
inlinevirtual

On entry, the Atom at nowAt will be an instance of the type of this Element. How much does that atom like the idea that it should be moved to (or remain at; the two SPoints might be equal) location maybeAt? Return 0 to flat-out veto the idea, or from 0 up to COMPLETE_DIFFUSABILITY to request that fraction of diffusability. (Values larger than COMPLETE_DIFFUSABILITY are treated as equal to it.) Note that nowAt and maybeAt are both relative to the EventWindow ew, but neither is necessarily the center atom!

By default all atoms are considered diffusable, and they return COMPLETE_DIFFUSABILITY chances for every suggested move

Reimplemented from MFM::Element< CC >.

template<class CC >
virtual const T& MFM::Element_Fish< 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_Fish< 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.

Reimplemented from MFM::AbstractElement_WaPat< CC >.


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