Open richelbilderbeek opened 5 years ago
Depends on:
Is your feature request related to a problem? Please describe.
Currently, I see some magical constants:
if ((m_type == agent_type::grass && m_health > 100.0) || (m_type == agent_type::tree && m_health > 500.0) || (m_type == agent_type::cow && m_health > 100.0) || (m_type == agent_type::cactus && m_health > 100.0))
Describe the solution you'd like
Replace these by:
if ((m_type == agent_type::grass && m_health > biology().get_grass_reproduction_health()) || (m_type == agent_type::tree && m_health > biology().get_tree_reproduction_health()) || (m_type == agent_type::cow && m_health > biology().get_cow_reproduction_health()) || (m_type == agent_type::cactus && m_health > biology().get_cactus_reproduction_health()))
test_biology
Something along the lines of:
assert(biology().get_grass_reproduction_health()) == 100.0)
Describe alternatives you've considered
None.
Additional context
There will be a follow-up to simplify the ifstatement :+1:
if
Depends on:
Is your feature request related to a problem? Please describe.
Currently, I see some magical constants:
Describe the solution you'd like
Replace these by:
test_biology
to check if the values remain the sameSomething along the lines of:
Describe alternatives you've considered
None.
Additional context
There will be a follow-up to simplify the
if
statement :+1: