/* * Copyright 2007-2008 Ben Boeckel * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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 General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ #ifndef __POKEMOD_MAPTRAINER__ #define __POKEMOD_MAPTRAINER__ // Pokemod includes #include "Object.h" // General includes #include "../general/Flag.h" #include "../general/Point.h" // Qt includes #include // Forward declarations class Map; class MapTrainerTeamMember; class MapTrainer : public Object { Q_OBJECT public: MapTrainer(const MapTrainer& trainer); MapTrainer(const Map* parent, const int id); MapTrainer(const MapTrainer& trainer, const Map* parent, const int id); MapTrainer(const QDomElement& xml, const Map* parent, const int id = INT_MAX); ~MapTrainer(); void validate(); void load(const QDomElement& xml, int id = INT_MAX); QDomElement save() const; void setName(const QString& name); void setTrainerClass(const int trainerClass); void setCoordinate(const Point& coordinate); void setSight(const int sight); void setDirection(const int direction); void setNumberFight(const int numberFight); void setFlag(const Flag& flag); void setDialog(const int dialog); void setLeadTeamMember(const int leadMember); QString name() const; int trainerClass() const; Point coordinate() const; int sight() const; int direction() const; int numberFight() const; Flag flag() const; int dialog() const; int leadTeamMember() const; const MapTrainerTeamMember* teamMember(const int index) const; MapTrainerTeamMember* teamMember(const int index); const MapTrainerTeamMember* teamMemberById(const int id) const; MapTrainerTeamMember* teamMemberById(const int id); int teamMemberIndex(const int id) const; int teamMemberCount() const; MapTrainerTeamMember* newTeamMember(); MapTrainerTeamMember* newTeamMember(const QDomElement& xml); MapTrainerTeamMember* newTeamMember(const MapTrainerTeamMember& teamMember); void deleteTeamMember(const int index); void deleteTeamMemberById(const int id); MapTrainer& operator=(const MapTrainer& rhs); private: int newTeamMemberId() const; MapTrainerTeamMember* newTeamMember(MapTrainerTeamMember* teamMember); void clear(); QString m_name; int m_trainerClass; Point m_coordinate; int m_sight; int m_direction; int m_numberFight; Flag m_flag; int m_dialog; int m_leadTeamMember; QList m_teamMember; }; #endif