pandemonium_engine/modules/wfc/overlapping_wave_form_collapse.h

70 lines
1.5 KiB
C++

#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:
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);
bool get_ground() const;
void set_ground(const bool val);
int get_pattern_size() const;
void set_pattern_size(const int val);
int get_wave_height() const;
int get_wave_width() const;
Array2D<int> run();
void init_ground();
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);
void get_patterns();
bool agrees(const Array2D<int> &pattern1, const Array2D<int> &pattern2, int dy, int dx);
Vector<WaveFormCollapse::PropagatorStateEntry> generate_compatible();
Array2D<int> to_image(const Array2D<int> &output_patterns) const;
void initialize();
OverlappingWaveFormCollapse();
~OverlappingWaveFormCollapse();
protected:
static void _bind_methods();
private:
Vector<Array2D<int>> patterns;
bool periodic_input;
int out_height;
int out_width;
int symmetry;
bool ground;
int pattern_size;
};
#endif