Corner.short_neighbours are now searched for based on the coordinates of the nodes.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
|
||||
// Delta-X data. Per direction of a triangle is a triple with Delta-X values for each direction.
|
||||
static const int8_t dx[][3] = {{0, 1, -1}, {1, 0, -1}, {1, -1, 0}, {0, -1, 1}, {-1, 0, 1}, {-1, 1, 0}};
|
||||
static const int8_t dy[][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, -1}, {1, 0, 0}, {0, -1, 0}, {0, 0, 1}};
|
||||
static const int8_t dy[][3] = {{-1, 0, 0}, {0, 1, 0}, {0, 0, -1}, {1, 0, 0}, {0, -1, 0}, {0, 0, 1}};
|
||||
|
||||
typedef struct {
|
||||
int8_t x;
|
||||
@ -15,10 +15,8 @@ typedef struct {
|
||||
} Coords;
|
||||
|
||||
class Node {
|
||||
private:
|
||||
uint16_t _number;
|
||||
Coords coords_at_direction(uint8_t edge);
|
||||
public:
|
||||
uint16_t _number;
|
||||
Coords coords;
|
||||
uint8_t direction;
|
||||
Node* neighbours[CORNERS_PER_PART];
|
||||
@ -26,6 +24,7 @@ class Node {
|
||||
Corner* _corners[CORNERS_PER_PART];
|
||||
Node(uint16_t number, Coords c, uint8_t direction);
|
||||
Node* create_neighbour(uint8_t edge);
|
||||
Coords coords_at_direction(uint8_t edge);
|
||||
|
||||
void blend_to(CRGB color, uint16_t effect_id=0, uint8_t effect_speed=0);
|
||||
void set_color(CRGB color);
|
||||
|
Reference in New Issue
Block a user