2021-01-03 16:12:47 +00:00
|
|
|
#pragma once
|
2021-01-04 10:39:46 +00:00
|
|
|
#include <FastLED.h>
|
2021-01-04 11:44:41 +00:00
|
|
|
#include <vector>
|
2021-01-04 10:39:46 +00:00
|
|
|
#include <list>
|
|
|
|
#include "edge.h"
|
2021-01-03 16:12:47 +00:00
|
|
|
|
2021-01-04 10:39:46 +00:00
|
|
|
class Corner {
|
|
|
|
public:
|
|
|
|
Edge* e1;
|
|
|
|
Edge* e2;
|
|
|
|
Corner(Edge* e1, Edge* e2);
|
|
|
|
std::list<uint16_t> _leds;
|
2021-01-04 11:44:41 +00:00
|
|
|
std::vector<Corner*> _long_neighbours {};
|
|
|
|
std::vector<Corner*> _short_neighbours {};
|
2021-01-04 10:39:46 +00:00
|
|
|
CRGB color = CRGB(0x000000);
|
|
|
|
CRGB source_color;
|
|
|
|
CRGB target_color;
|
|
|
|
bool effect_running = false;
|
|
|
|
uint8_t color_blend_state = 255;
|
|
|
|
uint16_t effect_id;
|
2021-01-04 11:44:41 +00:00
|
|
|
bool loop();
|
2021-01-04 10:39:46 +00:00
|
|
|
void draw();
|
|
|
|
void blend_to(CRGB color, uint16_t effect_id=0);
|
|
|
|
void add_led(uint16_t led_id);
|
|
|
|
void merge_leds(Corner* c);
|
2021-01-04 11:44:41 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void infect(std::vector<Corner*>* neighbours);
|
2021-01-04 10:39:46 +00:00
|
|
|
};
|