Rev 1117 | Rev 1158 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1117 | Rev 1118 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | 7 | ||
8 | 8 | ||
9 | struct SaplingTree { |
9 | struct SaplingTree { |
10 | SaplingTree() { clear(); } |
10 | SaplingTree() { clear(); } |
11 | short unsigned int age; // number of consectuive years the sapling suffers from dire conditions |
11 | short unsigned int age; // number of consectuive years the sapling suffers from dire conditions |
12 | short unsigned int species_index; // index of the species within the resource-unit-species container |
- | |
- | 12 | short signed int species_index; // index of the species within the resource-unit-species container |
|
13 | unsigned char stress_years; // (upper 16bits) + age of sapling (lower 16 bits) |
13 | unsigned char stress_years; // (upper 16bits) + age of sapling (lower 16 bits) |
14 | unsigned char flags; |
14 | unsigned char flags; |
15 | float height; // height of the sapling in meter |
15 | float height; // height of the sapling in meter |
16 | bool is_occupied() const { return height>0.f; } |
16 | bool is_occupied() const { return height>0.f; } |
17 | void clear() { age=0; species_index=0; stress_years=0; flags=0; height=0.f; } |
- | |
- | 17 | void clear() { age=0; species_index=-1; stress_years=0; flags=0; height=0.f; } |
|
18 | void setSapling(const float h_m, const int age_yrs, const int species_idx) { height=h_m; age=static_cast<short unsigned int>(age_yrs); stress_years=0; species_index=static_cast<short unsigned int>(species_idx); } |
18 | void setSapling(const float h_m, const int age_yrs, const int species_idx) { height=h_m; age=static_cast<short unsigned int>(age_yrs); stress_years=0; species_index=static_cast<short unsigned int>(species_idx); } |
19 | }; |
19 | }; |
20 | #define NSAPCELLS 5
|
20 | #define NSAPCELLS 5
|
21 | struct SaplingCell { |
21 | struct SaplingCell { |
22 | enum ECellState { CellInvalid=0, CellFree=1, CellFull=2}; |
22 | enum ECellState { CellInvalid=0, CellFree=1, CellFull=2}; |