// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef RY_S_PHRASE_FACTORY_H
#define RY_S_PHRASE_FACTORY_H
#include"nel/misc/types_nl.h"
#include"s_phrase.h"
/// Macro used to declare a Sabrina phrase class factory with a default implementation
#define DEFAULT_SPHRASE_FACTORY(_class_,_type_) \
class_class_##Factory:publicISPhraseFactory \
{\
public:\
_class_##Factory()\
{\
init();\
for(uinti=0;i<(*Factories).size();i++){ \
if((*Factories)[i].first==_type_){nlerror("<ISPhraseFactory buildPhrase> brick type %s is affected to more than one class",BRICK_TYPE::toString(_type_).c_str());}} \
if((*Factories)[i].first==_type_){nlerror("<ISPhraseFactory buildPhrase> brick type %s is affected to more than one class",BRICK_TYPE::toString(_type_));}} \
nlwarning("<ISPhraseFactory buildPhrase> the brick type %s has no corresponding phrase class",BRICK_TYPE::toString(BRICK_FAMILIES::brickType(bricks[0]->Family)).c_str());