iLand
Public Types | Public Member Functions | Public Attributes | List of all members
SaplingCell Struct Reference

#include <saplings.h>

Public Types

enum  ECellState {
  CellInvalid =0 , CellEmpty =1 , CellGrass =2 , CellFree =3 ,
  CellFull =4
}
 

Public Member Functions

 SaplingCell ()
 
bool hasFreeSlots () const
 returns true if establishment is allowed for the cell More...
 
void checkState ()
 
int free_index ()
 get an index to an open slot in the cell, or -1 if all slots are occupied More...
 
int n_occupied ()
 count the number of occupied slots on the pixel More...
 
SaplingTreeaddSapling (const float h_m, const int age_yrs, const int species_idx)
 add a sapling to this cell, return a pointer to the tree on success, or 0 otherwise More...
 
float max_height ()
 return the maximum height on the pixel More...
 
bool has_new_saplings ()
 
SaplingTreesaplingOfSpecies (int species_index)
 return the sapling tree of the requested species, or 0 More...
 

Public Attributes

ECellState state
 
SaplingTree saplings [NSAPCELLS]
 
ResourceUnitru
 

Member Enumeration Documentation

◆ ECellState

Enumerator
CellInvalid 

not stockable (outside project area)

CellEmpty 

the cell has no slots occupied (no saplings on the cell)

CellGrass 

the cell is empty and has grass cover (see grass module)

CellFree 

seedlings may establish on the cell (at least one slot occupied)

CellFull 

Constructor & Destructor Documentation

◆ SaplingCell()

SaplingCell::SaplingCell ( )
inline

Member Function Documentation

◆ addSapling()

SaplingTree * SaplingCell::addSapling ( const float  h_m,
const int  age_yrs,
const int  species_idx 
)
inline

add a sapling to this cell, return a pointer to the tree on success, or 0 otherwise

◆ checkState()

void SaplingCell::checkState ( )
inline

◆ free_index()

int SaplingCell::free_index ( )
inline

get an index to an open slot in the cell, or -1 if all slots are occupied

◆ has_new_saplings()

bool SaplingCell::has_new_saplings ( )
inline

◆ hasFreeSlots()

bool SaplingCell::hasFreeSlots ( ) const
inline

returns true if establishment is allowed for the cell

◆ max_height()

float SaplingCell::max_height ( )
inline

return the maximum height on the pixel

◆ n_occupied()

int SaplingCell::n_occupied ( )
inline

count the number of occupied slots on the pixel

◆ saplingOfSpecies()

SaplingTree * SaplingCell::saplingOfSpecies ( int  species_index)
inline

return the sapling tree of the requested species, or 0

Member Data Documentation

◆ ru

ResourceUnit* SaplingCell::ru

◆ saplings

SaplingTree SaplingCell::saplings[NSAPCELLS]

◆ state

ECellState SaplingCell::state

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