-
Notifications
You must be signed in to change notification settings - Fork 0
/
GeneLeafColour.h
33 lines (23 loc) · 966 Bytes
/
GeneLeafColour.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef GENELEAFCOLOUR_H
#define GENELEAFCOLOUR_H
#include "Gene.h"
#include <QColor>
#include <JsonSerialisationHelper.h>
class GeneLeafColour : public Gene {
public:
GeneLeafColour(QRgb colour);
GeneLeafColour(const QColor& colour);
virtual ~GeneLeafColour() {}
static void ConfigureJsonSerialisationHelper(util::JsonSerialisationHelper<GeneLeafColour>& helper);
virtual std::string TypeName() const override;
virtual QString ToString() const override;
virtual QString Description() const override;
virtual std::shared_ptr<Gene> Mutated() const override;
virtual std::shared_ptr<Gene> Crossed(const std::shared_ptr<Gene>& other) const override;
virtual double Similarity(const std::shared_ptr<Gene>& other) const override;
virtual void Express(Phenotype& phenotype) const override;
private:
QRgb colour;
static QColor InterpolateColours(const QColor& a, const QColor& b);
};
#endif // GENELEAFCOLOUR_H