C# Class LifeSimulation.Core.World

The World class represents the world state in the simulation. It contains all the lifelets, food and messages. It also keeps track of statistics and is responsible for spawning all the lifelets.
Mostra file Open project: dankrusi/life-simulation-challenge Class Usage Examples

Public Methods

Method Description
CreateLifelet ( int x, int y ) : void
DoEnergyTransaction ( ) : void
Draw ( Graphics g ) : void
GetAvailableRaces ( ) : ArrayList
RemoveLifelet ( Lifelet life ) : void
Reset ( ) : void
SetCursor ( int x, int y ) : void
Simulate ( ) : void
UnshellLifelet ( ShelledLifelet shelled ) : Lifelet
World ( ArrayList races, int initialLifelets, SpawnMethod spawnMethod ) : System
getAvailableRacesFromFolder ( string folder ) : ArrayList

Private Methods

Method Description
spawnInitialLifelets ( ) : void

Method Details

CreateLifelet() public method

public CreateLifelet ( int x, int y ) : void
x int
y int
return void

DoEnergyTransaction() public method

public DoEnergyTransaction ( ) : void
return void

Draw() public method

public Draw ( Graphics g ) : void
g System.Drawing.Graphics
return void

GetAvailableRaces() public static method

public static GetAvailableRaces ( ) : ArrayList
return System.Collections.ArrayList

RemoveLifelet() public method

public RemoveLifelet ( Lifelet life ) : void
life Lifelet
return void

Reset() public method

public Reset ( ) : void
return void

SetCursor() public method

public SetCursor ( int x, int y ) : void
x int
y int
return void

Simulate() public method

public Simulate ( ) : void
return void

UnshellLifelet() public method

public UnshellLifelet ( ShelledLifelet shelled ) : Lifelet
shelled ShelledLifelet
return Lifelet

World() public method

public World ( ArrayList races, int initialLifelets, SpawnMethod spawnMethod ) : System
races System.Collections.ArrayList
initialLifelets int
spawnMethod SpawnMethod
return System

getAvailableRacesFromFolder() public static method

public static getAvailableRacesFromFolder ( string folder ) : ArrayList
folder string
return System.Collections.ArrayList