///////////////////////////////////////////////////////////////////////////// // Name: pokemod/Tile.h // Purpose: Define a tile for the map // Author: Ben Boeckel // Modified by: Ben Boeckel // Created: Thu May 31 2007 13:28:49 // 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_TILE__ #define __POKEMOD_TILE__ #include #include #include #include #include #include "Object.h" class Pokemod; class Tile : public Object { public: enum Force { Slip = 0, Stop = 1, Force = 2, Push = 3, End = 4 }; static const QStringList ForceStr; Tile(const Pokemod* par, const int _id); Tile(const Pokemod* par, const Tile& t, const int _id); Tile(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 setPic(const QString& p) throw(Exception); void setFrom(const int d, const bool f) throw(BoundsException); void setWildChance(const int n, const int d) throw(Exception); void setWildChanceNum(const int n) throw(Exception); void setWildChanceDenom(const int d) throw(Exception); void setHMType(const int h) throw(BoundsException); void setUnder(const int u) throw(Exception); void setForceType(const int f) throw(BoundsException); void setForceDirection(const int f) throw(Exception); QString getName() const; QString getPic() const; bool getFrom(const int d) const throw(BoundsException); Frac getWildChance() const; int getHMType() const; int getUnder() const; int getForceType() const; int getForceDirection() const; Tile& operator=(const Tile& rhs); private: bool validate() const; QString name; bool from[D_End]; Frac wildChance; int hmType; int under; int forceType; int forceDirection; }; #endif