diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-02-07 15:33:44 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-02-07 15:33:44 +0000 |
| commit | 3c03cc795ce5620eb88e04bef70acc162ba2f339 (patch) | |
| tree | ec99b36244e6c2a14a74554dd9d6f822b20b1dfd /pokemod/Tile.cpp | |
| parent | b191a68ca2b1ec370fc1faafb078e4e201b2b459 (diff) | |
| download | sigen-3c03cc795ce5620eb88e04bef70acc162ba2f339.tar.gz sigen-3c03cc795ce5620eb88e04bef70acc162ba2f339.tar.xz sigen-3c03cc795ce5620eb88e04bef70acc162ba2f339.zip | |
[FIX] Tile UI form fixes
[FIX] BadgeUI logic cleaned up
[FIX] Tilemap editing Model and Delegate fleshed out
[ADD] TileUI.{h, cpp} and TypeUI.{h, cpp}
[FIX] Default path for Pokemod added
[FIX] Tile HM and Force setting
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@58 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Tile.cpp')
| -rw-r--r-- | pokemod/Tile.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/pokemod/Tile.cpp b/pokemod/Tile.cpp index 8c0535d1..2c8e1c34 100644 --- a/pokemod/Tile.cpp +++ b/pokemod/Tile.cpp @@ -23,7 +23,7 @@ #include "Pokemod.h" #include "Tile.h" -const QStringList Tile::ForceStr = QStringList() << "None" << "Slip" << "Stop" << "Force" << "Push"; +const QStringList Tile::ForceStr = QStringList() << "Slip" << "Stop" << "Force" << "Push"; Tile::Tile(const Pokemod& par, const int _id) : Object("Tile", par, _id), @@ -169,12 +169,12 @@ void Tile::setWildChance(const int n, const int d) throw(Exception) wildChance.set(n, d); } -void Tile::setWildChanceNumerator(const int n) throw(Exception) +void Tile::setWildChanceNum(const int n) throw(Exception) { wildChance.setNum(n); } -void Tile::setWildChanceDenominator(const int d) throw(Exception) +void Tile::setWildChanceDenom(const int d) throw(Exception) { wildChance.setDenom(d); } @@ -189,10 +189,13 @@ void Tile::setHMType(const int h) throw(BoundsException) void Tile::setUnder(const int u) throw(Exception) { - if ((hmType != HM_Whirlpool) || (hmType != HM_Cut) || (hmType != HM_RockSmash)) - throw(UnusedException(className, "under")); - if ((u == id) || (pokemod.getTileIndex(u) == -1)) - throw(BoundsException(className, "under")); + if (hmType != -1) + { + if ((hmType != HM_Whirlpool) || (hmType != HM_Cut) || (hmType != HM_RockSmash)) + throw(UnusedException(className, "under")); + if ((u == id) || (pokemod.getTileIndex(u) == -1)) + throw(BoundsException(className, "under")); + } under = u; } @@ -205,10 +208,13 @@ void Tile::setForceType(const int f) throw(BoundsException) void Tile::setForceDirection(const int f) throw(Exception) { - if ((forceType == None) || (forceType == Stop)) - throw(UnusedException(className, "forceDirection")); - if (D_End <= f) - throw(BoundsException(className, "forceDirection")); + if (forceType != -1) + { + if (forceType == Stop) + throw(UnusedException(className, "forceDirection")); + if (D_End <= f) + throw(BoundsException(className, "forceDirection")); + } forceDirection = f; } |
