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

#include <EventWindow.h>

Public Member Functions

bool InWindow (const SPoint &offset) const
 
SPoint MapToTileValid (const SPoint &offset) const
 
PointSymmetry GetSymmetry () const
 
void SetSymmetry (const PointSymmetry psym)
 
RandomGetRandom ()
 
Tile< CC > & GetTile ()
 
bool IsLiveSite (const SPoint &location) const
 
 EventWindow (Tile< CC > &tile)
 
void SetCenterInTile (const SPoint &center)
 
const SPointGetCenterInTile () const
 
 ~EventWindow ()
 
u32 GetAtomCount ()
 
const T & GetCenterAtom () const
 
void SetCenterAtom (const T &atom)
 
const T & GetRelativeAtom (const SPoint &offset) const
 
const T & GetRelativeAtom (const Dir mooreOffset) const
 
bool SetRelativeAtom (const SPoint &offset, const T &atom)
 
void SwapAtoms (const SPoint &locA, const SPoint &locB)
 
void SwapCenterAtom (const SPoint &relative)
 

Detailed Description

template<class CC>
class MFM::EventWindow< CC >

An EventWindow provides access for an Element to a selected portion of the sites of a Tile to enable the Element::behavior() method to compute a state transition.

Constructor & Destructor Documentation

template<class CC>
MFM::EventWindow< CC >::EventWindow ( Tile< CC > &  tile)
inline

Constructs a new EventWindow which takes place on a specified Tile with the default PointSymmetry of PSYM_NORMAL .

Parameters
tileThe Tile which this EventWindow will take place in.
template<class CC>
MFM::EventWindow< CC >::~EventWindow ( )
inline

Deconstructs this EventWindow.

Member Function Documentation

template<class CC>
u32 MFM::EventWindow< CC >::GetAtomCount ( )
inline

Gets the number of sites that are visible, and therefore mutable, to this EventWindow .

Returns
The number of active sites in this EventWindow .
template<class CC>
const T& MFM::EventWindow< CC >::GetCenterAtom ( ) const
inline

Gets the immutable Atom which resides in the center of this EventWindow.

Returns
The immutable Atom which resides in the center of this EventWindow.
template<class CC>
const SPoint& MFM::EventWindow< CC >::GetCenterInTile ( ) const
inline

Get the position this EventWindow within the Tile it resides in, in untransformed Tile coordinates.

Returns
The center of this EventWindow, relative to the Tile it is located in.
template<class CC>
Random& MFM::EventWindow< CC >::GetRandom ( )
inline

Gets the Random object used by the Tile that this EventWindow is taking place inside.

Returns
The PRNG used by the Tile that this EventWindow is taking place in.
template<class CC >
const CC::ATOM_TYPE & MFM::EventWindow< CC >::GetRelativeAtom ( const SPoint offset) const

Gets an Atom residing at a specified location inside this EventWindow .

Parameters
offsetThe location, relative to the center of this EventWindow , of the Atom to be retreived. If this is not inside the EventWindow, will FAIL with ILLEGAL_ARGUMENT .
Returns
The Atom at offset .
template<class CC >
const CC::ATOM_TYPE & MFM::EventWindow< CC >::GetRelativeAtom ( const Dir  mooreOffset) const

Gets an Atom residing at a specified direction from the center atom inside this EventWindow .

Parameters
offsetThe direction, relative to the center of this EventWindow , of the Atom to be retreived. If this is not inside the EventWindow, will FAIL with ILLEGAL_ARGUMENT .
Returns
The Atom at offset .
template<class CC>
PointSymmetry MFM::EventWindow< CC >::GetSymmetry ( ) const
inline

Gets the PointSymmetry currently used by this EventWindow .

Returns
The PointSymmetry currently used by this EventWindow .
template<class CC>
Tile<CC>& MFM::EventWindow< CC >::GetTile ( )
inline

Gets the Tile that this EventWindow is taking place inside.

Returns
The Tile that this EventWindow is taking place inside.
template<class CC>
bool MFM::EventWindow< CC >::InWindow ( const SPoint offset) const
inline

Checks to see if an SPoint describing a vector relative to the center of this EventWindow, is actually within reach of the center of this EventWindow.

Parameters
offsetThe relative SPoint to check for membership of in this EventWindow.
Returns
true if offset is considered to be inside this EventWindow.
template<class CC>
bool MFM::EventWindow< CC >::IsLiveSite ( const SPoint location) const
inline

Checks to see if a particular SPoint, relative to the center of this EventWindow, points to a Site that may be used during event execution.

Parameters
locationThe relative point to check for liveliness in this EventWindow .
Returns
true if this site may be reached during event execution, else false .
template<class CC >
SPoint MFM::EventWindow< CC >::MapToTileValid ( const SPoint offset) const

FAIL(ILLEGAL_ARGUMENT) if offset is not in the event window

template<class CC>
void MFM::EventWindow< CC >::SetCenterAtom ( const T &  atom)
inline

Sets the Atom in the center of this EventWindow to a specified Atom .

Parameters
atomThe Atom that will now reside in the center of this EventWindow .
template<class CC>
void MFM::EventWindow< CC >::SetCenterInTile ( const SPoint center)
inline

Place this EventWindow within GetTile, in untransformed Tile coordinates.

Parameters
centerThe new center of this EventWindow .
template<class CC >
bool MFM::EventWindow< CC >::SetRelativeAtom ( const SPoint offset,
const T &  atom 
)

Sets an Atom residing at a specified location in this EventWindow to a specified Atom .

Parameters
offsetThe location, relative to the center of this EventWindow , of the Atom to be set. If this is not inside the EventWindow, will FAIL with ILLEGAL_ARGUMENT .
atomThe Atom to place in this EventWindow .
Returns
true .
template<class CC>
void MFM::EventWindow< CC >::SetSymmetry ( const PointSymmetry  psym)
inline

Sets the PointSymmetry to be used by this EventWindow.

Parameters
psymThe new PointSymmetry that wil be used by this EventWindow .
template<class CC >
void MFM::EventWindow< CC >::SwapAtoms ( const SPoint locA,
const SPoint locB 
)

Takes the Atom in a specified location and swaps it with an Atom in another location.

Parameters
locAThe location of the first Atom to swap
locBThe location of the second Atom to swap
template<class CC >
void MFM::EventWindow< CC >::SwapCenterAtom ( const SPoint relative)

Takes the Atom in a specified location and swaps it with an Atom in the center of this EventWindow.

Parameters
relativeThe location of the first Atom to swap with this EventWindow's center atom.

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