MathOddValidator.cpp 621 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-13
  6. * Changed: 2023-02-13
  7. *
  8. * */
  9. #include "MathOddValidator.hpp"
  10. test::core::MathOddValidator::MathOddValidator() = default;
  11. test::core::MathOddValidator::~MathOddValidator() = default;
  12. bool test::core::MathOddValidator::isEven() const
  13. {
  14. return !this->isOddNumber;
  15. }
  16. bool test::core::MathOddValidator::isOdd() const
  17. {
  18. return this->isOddNumber;
  19. }
  20. void test::core::MathOddValidator::validate(int _number)
  21. {
  22. this->isOddNumber = _number % 2 != 0;
  23. }