Init version

This commit is contained in:
2024-10-03 18:43:04 +07:00
commit f80052961f
186 changed files with 71676 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include "Trait.h"
#include <iostream>
//Trait::Trait(const Trait& _t)
//{
// *this = _t;
//}
Trait::Trait(Trait::idType _ID, std::string _name, float value):
ID(_ID), name(_name), traitValueCont(value), traitType(Continious)
{}
Trait::Trait(Trait::idType _ID, std::string _name, int value):
ID(_ID), name(_name), traitValueDiscr(value), traitType(Discrete)
{}
void Trait::setTraitValue(float _value){
if(this->traitType == Continious){
this->traitValueCont = _value;
return;
}
/*throw*/std::cerr<<"Trait.cpp(17) Warning: can't assign float value to discrete trait\n";
}
void Trait::setTraitValue(int _value){
if(this->traitType == Discrete){
this->traitValueDiscr = _value;
return;
}
/*throw*/std::cerr<<"Trait.cpp(25) Warning: can't assign int value to continious trait\n";
}