2022-04-22 15:18:19 +02:00
|
|
|
#ifndef OVERLAPPING_WAVE_FORM_COLLAPSE_H
|
|
|
|
#define OVERLAPPING_WAVE_FORM_COLLAPSE_H
|
|
|
|
|
|
|
|
#include "core/vector.h"
|
|
|
|
|
|
|
|
#include "array_2d.h"
|
|
|
|
#include "wave_form_collapse.h"
|
|
|
|
|
|
|
|
class OverlappingWaveFormCollapse : public WaveFormCollapse {
|
|
|
|
GDCLASS(OverlappingWaveFormCollapse, WaveFormCollapse);
|
|
|
|
|
|
|
|
public:
|
2022-04-23 00:48:19 +02:00
|
|
|
bool get_periodic_input() const;
|
|
|
|
void set_periodic_input(const bool val);
|
|
|
|
|
|
|
|
int get_out_height() const;
|
|
|
|
void set_out_height(const int val);
|
|
|
|
|
|
|
|
int get_out_width() const;
|
|
|
|
void set_out_width(const int val);
|
|
|
|
|
|
|
|
int get_symmetry() const;
|
|
|
|
void set_symmetry(const int val);
|
2022-04-22 15:18:19 +02:00
|
|
|
|
2022-04-23 00:48:19 +02:00
|
|
|
bool get_ground() const;
|
|
|
|
void set_ground(const bool val);
|
|
|
|
|
|
|
|
int get_pattern_size() const;
|
|
|
|
void set_pattern_size(const int val);
|
2022-04-22 18:50:27 +02:00
|
|
|
|
2022-04-22 19:07:29 +02:00
|
|
|
int get_wave_height() const;
|
|
|
|
int get_wave_width() const;
|
2022-04-22 15:18:19 +02:00
|
|
|
|
2022-04-23 00:48:19 +02:00
|
|
|
Array2D<int> run();
|
2022-04-22 15:18:19 +02:00
|
|
|
|
2022-04-22 18:50:27 +02:00
|
|
|
void init_ground();
|
2022-04-22 15:18:19 +02:00
|
|
|
|
2022-04-22 19:07:29 +02:00
|
|
|
bool set_pattern(const Array2D<int> &pattern, int i, int j);
|
|
|
|
int get_ground_pattern_id();
|
|
|
|
int get_pattern_id(const Array2D<int> &pattern);
|
|
|
|
void set_pattern(int pattern_id, int i, int j);
|
2022-04-23 15:23:00 +02:00
|
|
|
|
|
|
|
void init_patterns();
|
2022-04-22 15:18:19 +02:00
|
|
|
|
2022-04-22 19:07:29 +02:00
|
|
|
bool agrees(const Array2D<int> &pattern1, const Array2D<int> &pattern2, int dy, int dx);
|
2022-04-22 15:18:19 +02:00
|
|
|
|
2022-04-23 15:23:00 +02:00
|
|
|
void generate_compatible();
|
2022-04-22 15:18:19 +02:00
|
|
|
|
2022-04-22 19:07:29 +02:00
|
|
|
Array2D<int> to_image(const Array2D<int> &output_patterns) const;
|
2022-04-22 15:18:19 +02:00
|
|
|
|
2022-04-22 18:50:27 +02:00
|
|
|
void initialize();
|
|
|
|
|
2022-04-22 15:18:19 +02:00
|
|
|
OverlappingWaveFormCollapse();
|
|
|
|
~OverlappingWaveFormCollapse();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
private:
|
2022-04-22 19:07:29 +02:00
|
|
|
Vector<Array2D<int>> patterns;
|
2022-04-23 00:48:19 +02:00
|
|
|
|
|
|
|
bool periodic_input;
|
|
|
|
int out_height;
|
|
|
|
int out_width;
|
|
|
|
int symmetry;
|
|
|
|
bool ground;
|
|
|
|
int pattern_size;
|
2022-04-22 15:18:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|