MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
|
#include <Grid.h>
Data Structures | |
class | MyIterator |
Public Types | |
typedef MyIterator< Tile< CC > * > | iterator_type |
typedef MyIterator< const Tile < CC > * > | const_iterator_type |
Public Member Functions | |
void | ReportGridStatus (Logger::Level level) |
Random & | GetRandom () |
bool * | GetBackgroundRadiationEnabledPointer () |
void | SetSeed (u32 seed) |
Grid (ElementRegistry< CC > &elts) | |
void | SetIgnoreThreadingProblems (bool value) |
s32 * | GetXraySiteOddsPtr () |
void | Reinit () |
const Element< CC > * | LookupElement (u32 elementType) const |
ElementRegistry< CC > & | GetElementRegistry () |
void | Needed (Element< CC > &anElement) |
iterator_type | begin () |
const_iterator_type | begin () const |
iterator_type | end () |
const_iterator_type | end () const |
void | SetTileToExecuteOnly (const SPoint &tileLoc, bool value) |
bool | GetTileExecutionStatus (const SPoint &tileLoc) |
void | EmptyTile (const SPoint &tileLoc) |
void | Clear () |
void | CheckCaches () |
bool | IsLegalTileIndex (const SPoint &tileInGrid) const |
bool | MapGridToTile (const SPoint &siteInGrid, SPoint &tileInGrid, SPoint &siteInTile) const |
bool | MapGridToUncachedTile (const SPoint &siteInGrid, SPoint &tileInGrid, SPoint &siteInTile) const |
void | Pause () |
void | Unpause () |
void | RecountAtoms () |
void | PlaceAtom (const T &atom, const SPoint &location) |
void | XRayAtom (const SPoint &location) |
void | MaybeXRayAtom (const SPoint &location) |
const T * | GetAtom (SPoint &loc) |
T * | GetWritableAtom (SPoint &loc) |
void | FillLastEventTile (SPoint &out) |
Tile< CC > & | GetTile (const SPoint &pt) |
const Tile< CC > & | GetTile (const SPoint &pt) const |
Tile< CC > & | GetTile (u32 x, u32 y) |
const Tile< CC > & | GetTile (u32 x, u32 y) const |
u64 | GetTotalEventsExecuted () const |
void | WriteEPSImage (ByteSink &outstrm) const |
void | WriteEPSAverageImage (ByteSink &outstrm) const |
void | ResetEPSCounts () |
u32 | GetAtomCount (ElementType atomType) const |
double | GetEmptySitePercentage () const |
void | SurroundRectangleWithWall (s32 x, s32 y, s32 w, s32 h, s32 thickness) |
void | RandomNuke () |
void | SetBackgroundRadiation (bool value) |
void | ToggleBackgroundRadiation () |
bool | IsBackgroundRadiataionEnabled () |
void | XRay () |
u32 | CountActiveSites () const |
Static Public Member Functions | |
static u32 | GetHeight () |
static u32 | GetWidth () |
static u32 | GetHeightSites () |
static u32 | GetWidthSites () |
static const u32 | GetTotalSites () |
Friends | |
class | GridRenderer |
A two-dimensional grid of simulated Tiles.
void MFM::Grid< GC >::CheckCaches | ( | ) |
Based on the current connectivity pattern, check the visible regions of each tile against the caches of its connected tiles. Report debug messages for any discrepancies.
void MFM::Grid< GC >::Clear | ( | ) |
Empties this Grid of all held Atoms. Also increments the grid generation.
|
inline |
|
inlinestatic |
Return the Grid height in Tiles
|
inlinestatic |
Return the Grid height in (non-cache) sites
|
inlinestatic |
Return the Grid width in Tiles
|
inlinestatic |
Return the Grid width in (non-cache) sites
|
inline |
Checks to see if this Grid is currently administering background radiataion.
Return true iff tileInGrid is a legal tile coordinate in this grid. If this returns false, GetTile(tileInGrid) is unsafe.
bool MFM::Grid< GC >::MapGridToTile | ( | const SPoint & | siteInGrid, |
SPoint & | tileInGrid, | ||
SPoint & | siteInTile | ||
) | const |
Find the grid coordinate of the 'owning tile' (i.e., ignoring caches) for the give siteInGrid. Return false if there isn't one, otherwise set tileInGrid and siteInTile appropriately and return true.
Note that although siteInGrid is specified in 'uncached' coordinates (in which (0,0) is the upperleftmost uncached location of the tile at (0,0)), siteInTile is returned in 'including cache' coordinates (in which (R,R) is the upperleftmost uncached location of the tile at (0,0). See MapGridToUncachedTile for an alternative.
bool MFM::Grid< GC >::MapGridToUncachedTile | ( | const SPoint & | siteInGrid, |
SPoint & | tileInGrid, | ||
SPoint & | siteInTile | ||
) | const |
Find the grid coordinate of the 'owning tile' (i.e., ignoring caches) for the given siteInGrid. Return false if there isn't one, otherwise set tileInGrid and siteInTile appropriately and return true.
|
inline |
Synchronize and pause the entire grid
void MFM::Grid< GC >::RandomNuke | ( | ) |
Picks a random site in the grid, then sets all sites in a randomly sized radius to Element_Empty .
void MFM::Grid< GC >::RecountAtoms | ( | ) |
Resets all atom counts and refreshes the atoms counts in every tile in the grid.
void MFM::Grid< GC >::SetBackgroundRadiation | ( | bool | value | ) |
Sets whether or not background radiation will begin mutating the Atoms of this Grid upon writing.
void MFM::Grid< GC >::SetTileToExecuteOnly | ( | const SPoint & | tileLoc, |
bool | value | ||
) |
Used to tell this Tile whether or not to actually execute any events, or to just wait on any packet communication from other Tiles instead.
|
inline |
Toggles the background radiation in this Grid .
|
inline |
Synchronize and unpause the entire grid
void MFM::Grid< GC >::XRay | ( | ) |
Randomly flips bits in randomly selected sites in this grid.