| Class TSimulation (unit SandSim) |
TThread
The simulation logic (based on the TThread class
| Constructors |
constructor Create;-------------------- TSimulation ---------------------
| Functions |
destructor Destroy;
procedure Trace;
procedure DrawCell(X, Y: Integer);
procedure Execute;
procedure ShowStatistics;
procedure DoDrawCell;This method is a wrapper for the method DoDrawCell.
procedure DoShowStatistics;| Properties |
| Events |
| Variables |
Rounds : Longint;
Tracing : Boolean;
CurrentCell : TField;
Q : TQueue;| Constructors |
constructor Create;Are we in trace mode?
-------------------- TSimulation ---------------------
| Functions |
destructor Destroy;FreeOnTerminate := True;
procedure Trace;Log1.Log;
procedure DrawCell(X, Y: Integer);
procedure Execute;Shows statistics on the sandpile
procedure ShowStatistics;Updates a cell in the grid
procedure DoDrawCell;Queue of points that have toppled
This method is a wrapper for the method DoDrawCell. It ensures synchronization with the PileForm TDrawGrid VCL component.
procedure DoShowStatistics;This method is a wrapper for the method DoShowStatistics. It ensures synchronization with the MainForm TLabel VCL components.
| Properties |
| Events |
| Variables |
Rounds : Longint;
Tracing : Boolean;# rounds so far
CurrentCell : TField;
Q : TQueue;Used when updating a cell