simulator.h 567 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef SIMULATOR_H
  2. #define SIMULATOR_H
  3. #include <array>
  4. #include <vector>
  5. #include <memory>
  6. #include <climits>
  7. #include <stdint.h>
  8. using namespace std;
  9. #include "program.h"
  10. enum {
  11. CYCLE_TIMEOUT = 100000,
  12. FIELDS_XY = 20,
  13. };
  14. struct Simulator {
  15. size_t cycle = 0;
  16. vector<Program> programs;
  17. Simulator();
  18. Position calcPosition(Position position, Direction direction, int32_t distance);
  19. void loadProgram(QColor color, size_t x, size_t y);
  20. Program* findProgram(Position position);
  21. void simulate();
  22. };
  23. #endif // SIMULATOR_H