/* * 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 . */ // Header include #include "EggGroup.h" // Pokemod includes #include "Pokemod.h" EggGroup::EggGroup(const EggGroup& eggGroup) : Object("EggGroup", eggGroup.parent(), eggGroup.id()) { *this = eggGroup; } EggGroup::EggGroup(const Object* parent, const int id) : Object("EggGroup", parent, id), m_name("") { } EggGroup::EggGroup(const EggGroup& eggGroup, const Object* parent, const int id) : Object("EggGroup", parent, id) { *this = eggGroup; } EggGroup::EggGroup(const QDomElement& xml, const Object* parent, const int id) : Object("EggGroup", parent, id) { load(xml, id); } bool EggGroup::validate() const { // TODO: validate // bool valid = true; // static_cast(pokemod())->validationMsg(QString("---Egg Group \"%1\" with id %2---").arg(m_name).arg(id()), Pokemod::V_Msg); // if (m_name == "") // { // static_cast(pokemod())->validationMsg("Name is not defined"); // valid = false; // } // return valid; } void EggGroup::load(const QDomElement& xml, int id) { LOAD_ID(); LOAD(QString, name); } QDomElement EggGroup::save() const { SAVE_CREATE(); SAVE(QString, name); return xml; } void EggGroup::setName(const QString& name) { m_name = name; } QString EggGroup::name() const { return m_name; } EggGroup& EggGroup::operator=(const EggGroup& rhs) { if (this == &rhs) return *this; COPY(name); return *this; }