/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/Nature.h
// Purpose: Define a nature that species can possess
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sun Mar 18 22:58:48 2007
// Copyright: ©2007-2008 Ben Boeckel and Nerdy Productions
// Licence:
// 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_NATURE__
#define __POKEMOD_NATURE__
#include
#include
#include
#include
#include "Object.h"
class Pokemod;
class Nature : public Object
{
public:
Nature(const Pokemod* par, const int _id);
Nature(const Pokemod* par, const Nature& n, const int _id);
Nature(const Pokemod* par, const QString& fname, const int _id = -1);
void load(const QString& fname, const int _id = -1) throw(Exception);
void save() const throw(Exception);
void setName(const QString& n);
void setStat(const int s, const int n, const int d) throw(Exception);
void setStatNum(const int s, const int n) throw(Exception);
void setStatDenom(const int s, const int d) throw(Exception);
void setWeight(const int w) throw(BoundsException);
QString getName() const;
Frac getStat(const int s) const throw(BoundsException);
int getWeight() const;
Nature& operator=(const Nature& rhs);
private:
bool validate() const;
QString name;
Frac stats[ST_End_GSC];
int weight;
};
#endif