Closed richelbilderbeek closed 5 years ago
Is your feature request related to a problem? Please describe.
Plants grow. And we let that be. But they should grow slower when too many of them are close to one another, due to light competition.
Instead of letting plants grow unconditionally, we let trees damage each other.
Describe the solution you'd like
Plants should grow normally as usual. But adjacent plants of the same type should hurt one another.
There is a test for the cacti:
//#define FIX_ISSUE_447 #ifdef FIX_ISSUE_447 //Cacti damage nearby cacti { // Make two plants next to each other. game g({tile(0,0,0,3,3,10,tile_type::grassland)}, {agent(agent_type::cactus, 10, 10, 10), agent(agent_type::cactus, 10, 10, 10)}); // Check their initial health. const double prev_health1 = g.get_agents()[0].get_health(); const double prev_health2 = g.get_agents()[1].get_health(); // Damage time. for(int i = 0; i != 20; ++i){ g.process_events(); } // Check their health after doing damage const double after_health1 = g.get_agents()[0].get_health(); const double after_health2 = g.get_agents()[1].get_health(); // Plants should have damaged each other assert(after_health1 < prev_health1); assert(after_health2 < prev_health2); } #endif // FIX_ISSUE_447
foxgloves
plankton
sunflower
venus_fly_trap
Describe alternatives you've considered
None.
Additional context
Well done!
Is your feature request related to a problem? Please describe.
Plants grow. And we let that be. But they should grow slower when too many of them are close to one another, due to light competition.
Instead of letting plants grow unconditionally, we let trees damage each other.
Describe the solution you'd like
Plants should grow normally as usual. But adjacent plants of the same type should hurt one another.
There is a test for the cacti:
foxgloves
, fix the testplankton
, fix the testsunflower
, fix the testvenus_fly_trap
, fix the testDescribe alternatives you've considered
None.
Additional context
None.