DIY fertilizer mixer and plant watering machine https://www.xythobuz.de/giessomat.html
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2021 Thomas Buck <thomas@xythobuz.de>
  3. *
  4. * This file is part of Giess-o-mat.
  5. *
  6. * Giess-o-mat is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Giess-o-mat is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Giess-o-mat. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. #include "BoolField.h"
  20. BoolField::BoolField(int size_) {
  21. size = size_;
  22. field = new bool[size];
  23. }
  24. BoolField::~BoolField(void) {
  25. delete field;
  26. }
  27. void BoolField::clear(void) {
  28. for (int i = 0; i < size; i++) {
  29. field[i] = false;
  30. }
  31. }
  32. void BoolField::set(int n) {
  33. field[n] = true;
  34. }
  35. bool BoolField::isSet(int n) {
  36. return field[n];
  37. }