#include "../vcmi/global.h" #include "../vcmi/CCallback.h" #include "HeroBonus.h" #include /* * ExpertSystem.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ template class ExpertSystemShell { private: ICallback* m_cb; protected: template std::set knowledge; public: template std::set facts; template void getKnowledge(const t1 &a1){}; template void getNextRule(){}; template void returnGoals(const t2 &a2){}; }; template class condition { enum conditionType {LESS_THAN, EQUAL, GREATER_THAN, UNEQUAL, PRESENT}; public: input object; ui16 value; conditionType conType; }; template class Rule { friend class ExpertSystemShell; public: fired; //if conditions of rule were met and it produces some output protected: std::set conditions; virtual void canBeFired(); //if this data makes any sense for rule virtual void fireRule(); public: template bool matchesInput() //if condition and data match type {return dynamic_cast(givenInput);}; }; template class Goal : public Rule { public: void fireTule(){}; }; template class Weight : public Rule { public: float value; //multiply input by value and return to output void fireTule(){}; }; template class BonusSystemExpert : public ExpertSystemShell { enum effectType {POSITIVE=1, NEGATIVE=2, EXCLUDING=4, ENEMY=8, ALLY=16}; //what is the influencce of bonus and for who };