PlanetStep.cpp 339 B

123456789101112131415161718
  1. //
  2. // Created by jovian on 18/08/17.
  3. //
  4. #include "PlanetStep.h"
  5. PlanetStep::PlanetStep(int delay) : m_delay(delay), m_elapsed(0) {}
  6. void PlanetStep::callApply(PlanetDef &def) {
  7. // Time is running out
  8. m_elapsed++;
  9. // Check if it is necessary
  10. if (m_elapsed > m_delay) {
  11. apply(def);
  12. m_elapsed = 0;
  13. }
  14. }