PeopleExpGrowth.cpp 365 B

12345678910111213141516
  1. //
  2. // Created by jovian on 18/08/17.
  3. //
  4. #include "PeopleExpGrowth.h"
  5. PeopleExpGrowth::PeopleExpGrowth(int delay, int divisor) : PlanetStep(delay), m_divisor(divisor) {
  6. }
  7. void PeopleExpGrowth::apply(PlanetDef &def) {
  8. if (def.stock.get(PEOPLE) > 0) {
  9. def.stock.add(PEOPLE, def.stock.get(PEOPLE) / m_divisor);
  10. def.stock.add(PEOPLE, 1);
  11. }
  12. }