X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=src%2Fgene.h;fp=src%2Fgene.h;h=618f88723f1d4cf8a152d964441d8ea8d46e2e98;hb=971fed67ac2e5a01b5232853c08e03ed05bebbe0;hp=499ca80643a9f5a428ae167321fa5d2089af67ac;hpb=a590537eb07fb1e7b6c4ad6fe2434f3b21d11e9d;p=genetic.git diff --git a/src/gene.h b/src/gene.h index 499ca80..618f887 100644 --- a/src/gene.h +++ b/src/gene.h @@ -6,14 +6,23 @@ namespace genetic { template < typename Type > class Gene { protected: - Type fenotype; + Type value; public: - Gene(Type fenotype) { - this->fenotype = fenotype; + Gene() {} + + Gene(Type value) { + this->value = value; + } + + /** Copy constructor */ + Gene(const Gene& gene) : value(gene.get()) {} + + Gene& operator=(const Gene&){ + return *this; } - Type get() { - return this->fenotype; + Type get() const { + return value; } }; }