summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-01-18 06:00:44 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-01-18 06:00:44 +0000
commitd017d90324a439dfb4bd3f25d30deb672bc40fd4 (patch)
tree7ba12ff6ec958caa0f02f5e049cb4b0d38b1e74e
parent1d639b92a4487b21a29127f4fbe91d5b1d5d1952 (diff)
downloadsigen-d017d90324a439dfb4bd3f25d30deb672bc40fd4.tar.gz
sigen-d017d90324a439dfb4bd3f25d30deb672bc40fd4.tar.xz
sigen-d017d90324a439dfb4bd3f25d30deb672bc40fd4.zip
[FIX] Added 2008 to other copyright lines
[ADD] More .pro files for qmake [ADD] overworld folder for the world map stuff [ADD] Refined pokegen and pokemodr file structures git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@32 6ecfd1a5-f3ed-3746-8530-beee90d26b22
-rw-r--r--Changelog24
-rw-r--r--STANDARDS4
-rw-r--r--audio/audio.pro5
-rw-r--r--battle/Arena.cpp2
-rw-r--r--battle/Arena.h2
-rw-r--r--battle/Bot.h2
-rw-r--r--battle/Ghost.cpp2
-rw-r--r--battle/Ghost.h2
-rw-r--r--battle/GhostBot.h2
-rw-r--r--battle/Pokemon.h8
-rw-r--r--battle/Team.cpp2
-rw-r--r--battle/Team.h2
-rw-r--r--battle/battle.pro10
-rw-r--r--general/Exception.h128
-rw-r--r--general/Flag.cpp2
-rw-r--r--general/Flag.h2
-rw-r--r--general/Frac.cpp16
-rw-r--r--general/Frac.h13
-rw-r--r--general/FracMatrix.h2
-rw-r--r--general/Hat.h8
-rw-r--r--general/ImageCache.cpp33
-rw-r--r--general/ImageCache.h40
-rw-r--r--general/Ini.cpp18
-rw-r--r--general/Ini.h9
-rw-r--r--general/Matrix.h10
-rw-r--r--general/Point.h2
-rw-r--r--general/Ref.cpp2
-rw-r--r--general/Ref.h2
-rw-r--r--overworld/overworld.pro10
-rwxr-xr-xpokegen.pro1
-rw-r--r--pokegen/PokeGen.h42
-rw-r--r--pokegen/pokegen.pro10
-rw-r--r--pokemodr/PokeModr.cpp103
-rw-r--r--pokemodr/PokeModr.h26
-rw-r--r--pokemodr/PokeModrDebug.h67
-rw-r--r--pokemodr/pokemodr.pro10
36 files changed, 397 insertions, 226 deletions
diff --git a/Changelog b/Changelog
index f3d6a3be..c546615d 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,28 @@
-----------------
+Rev: 32
+Date: 18 January 2008
+User: MathStuf
+-----------------
+[FIX] Added 2008 to other copyright lines
+[ADD] .pro files
+[ADD] overworld folder for the world map stuff
+[ADD] Refined pokegen and pokemodr file structures
+
+-----------------
+Rev: 31
+Date: 16 January 2008
+User: MathStuf
+-----------------
+[FIX] Added 2008 to copyrights
+[FIX] Made exceptions better
+[FIX] Added RBY Move Effects (as well as val1 and val2 code)
+[FIX] Added breaks where missed
+[FIX] Grammar mistakes (factored out to Exceptions)
+[FIX] Cleaned up Species types and egg groups handling
+[FIX] Cleaned up Store items handling
+[FIX] Cleaned up Tile details
+
+-----------------
Rev: 30
Date: 27 November 2007
User: MathStuf
diff --git a/STANDARDS b/STANDARDS
index 82ac43a2..e16e1de2 100644
--- a/STANDARDS
+++ b/STANDARDS
@@ -8,7 +8,7 @@ Code should look like the following:
// Author: You
// Modified by: You
// Created: Wed Feb 28 21:41:10 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
@@ -66,7 +66,7 @@ namespace Name
// Author: You
// Modified by: You
// Created: Wed Feb 28 21:41:10 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
diff --git a/audio/audio.pro b/audio/audio.pro
index 0e365d92..99f68ee1 100644
--- a/audio/audio.pro
+++ b/audio/audio.pro
@@ -1,8 +1,9 @@
-OBJECTS_DIR = ../../obj
+OBJECTS_DIR = ../../obj/audio
DESTDIR = ../../lib
VERSION = 0.0.1
TEMPLATE = lib
-CONFIG += qt warn_on
+
+CONFIG += qt warn_on dll
HEADERS += *.h
SOURCES += *.cpp
diff --git a/battle/Arena.cpp b/battle/Arena.cpp
index cebadd26..da966377 100644
--- a/battle/Arena.cpp
+++ b/battle/Arena.cpp
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Oct 16 2007 09:09:44
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// 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
diff --git a/battle/Arena.h b/battle/Arena.h
index b14496bd..f38804f9 100644
--- a/battle/Arena.h
+++ b/battle/Arena.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Oct 16 2007 09:21:30
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// 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
diff --git a/battle/Bot.h b/battle/Bot.h
index 04eb1f2d..31ff1061 100644
--- a/battle/Bot.h
+++ b/battle/Bot.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Oct 16 2007 11:44:16
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// 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
diff --git a/battle/Ghost.cpp b/battle/Ghost.cpp
index cf3e6dd5..81b45c4c 100644
--- a/battle/Ghost.cpp
+++ b/battle/Ghost.cpp
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Oct 16 2007 19:29:30
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// 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
diff --git a/battle/Ghost.h b/battle/Ghost.h
index 32a7d951..d88cb3eb 100644
--- a/battle/Ghost.h
+++ b/battle/Ghost.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Oct 16 2007 11:52:23
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// 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
diff --git a/battle/GhostBot.h b/battle/GhostBot.h
index e2628755..75f882c7 100644
--- a/battle/GhostBot.h
+++ b/battle/GhostBot.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Oct 16 2007 11:52:23
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// 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
diff --git a/battle/Pokemon.h b/battle/Pokemon.h
index a5b03de1..b4e7fa27 100644
--- a/battle/Pokemon.h
+++ b/battle/Pokemon.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Oct 16 2007 09:21:30
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// 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
@@ -42,8 +42,8 @@ namespace PokeGen
class Pokemon
{
public:
- Pokemon(const PokeMod::Pokemod* par, Ini ini);
- Pokemon(const PokeMod::Pokemod* par, const unsigned s, const unsigned l);
+ Pokemon(const PokeMod::Pokemod& par, Ini ini);
+ Pokemon(const PokeMod::Pokemod& par, const unsigned s, const unsigned l);
unsigned GetStat(const unsigned s) const;
unsigned GetLevel() const;
@@ -94,7 +94,7 @@ namespace PokeGen
BattleSettings battleSettings;
- PokeMod::Pokemod* pokemod;
+ const PokeMod::Pokemod pokemod;
};
}
}
diff --git a/battle/Team.cpp b/battle/Team.cpp
index b840db40..2045d683 100644
--- a/battle/Team.cpp
+++ b/battle/Team.cpp
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Oct 16 2007 19:22:20
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// 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
diff --git a/battle/Team.h b/battle/Team.h
index 2c1d1fb2..a2f8a938 100644
--- a/battle/Team.h
+++ b/battle/Team.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Oct 16 2007 09:21:30
-// Copyright: ©2007 Ben Boeckel and Nerdy Productions
+// 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
diff --git a/battle/battle.pro b/battle/battle.pro
new file mode 100644
index 00000000..7b5a3e51
--- /dev/null
+++ b/battle/battle.pro
@@ -0,0 +1,10 @@
+OBJECTS_DIR = ../../obj/battle
+DESTDIR = ../../lib
+VERSION = 0.1.0
+TEMPLATE = lib
+LIBS += -L../../lib -lgeneral -lpokemod
+
+CONFIG += qt warn_on dll
+
+SOURCES += *.cpp
+HEADERS += *.h
diff --git a/general/Exception.h b/general/Exception.h
new file mode 100644
index 00000000..53a7ab4b
--- /dev/null
+++ b/general/Exception.h
@@ -0,0 +1,128 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/Exception.h
+// Purpose: Define exceptions used throughout PokéGen
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Wed Jan 16 13:13:13 2008
+// 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 <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __EXCEPTIONS__
+#define __EXCEPTIONS__
+
+namespace PokeGen
+{
+ class Exception
+ {
+ public:
+ Exception(const QString& c, const QString e) :
+ cls(c),
+ error(e)
+ {
+ }
+
+ QString getMsg() const
+ {
+ return QString("%1: %2").arg(cls).arg(error);
+ }
+ private:
+ QString cls;
+ QString error;
+ };
+
+ class UnusedException : public Exception
+ {
+ public:
+ UnusedException(const QString& c, const QString& var) :
+ Exception(c, QString("setting unused %1").arg(var))
+ {
+ }
+ };
+
+ class BoundsException : public Exception
+ {
+ public:
+ BoundsException(const QString& c, const QString& var) :
+ Exception(c, QString("%1 out-of-bounds").arg(var))
+ {
+ }
+ };
+
+ class IndexException : public BoundsException
+ {
+ public:
+ IndexException(const QString& c) :
+ BoundsException(c, "index")
+ {
+ }
+ };
+
+ class ReplaceException : public Exception
+ {
+ public:
+ ReplaceException(const QString& c, const QString& f) :
+ Exception(c, QString("unable to replace %1").arg(f))
+ {
+ }
+ };
+
+ class SaveException : public Exception
+ {
+ public:
+ SaveException(const QString& c, const QString& f) :
+ Exception(c, QString("unable to save %1").arg(f))
+ {
+ }
+ };
+
+ class OpenException : public Exception
+ {
+ public:
+ OpenException(const QString& c, const QString& f) :
+ Exception(c, QString("unable to open %1").arg(f))
+ {
+ }
+ };
+
+ class DirException : public Exception
+ {
+ public:
+ DirException(const QString& c, const QString& p) :
+ Exception(c, QString("unable to create path %1").arg(p))
+ {
+ }
+ };
+
+ class InvalidException : public Exception
+ {
+ public:
+ InvalidException(const QString& c, const QString& f) :
+ Exception(c, QString("%1 is invalid").arg(f))
+ {
+ }
+ };
+
+ class RemoveException : public Exception
+ {
+ public:
+ RemoveException(const QString& c, const QString& f) :
+ Exception(c, QString("unable to remove %1").arg(f))
+ {
+ }
+ };
+}
+
+#endif
diff --git a/general/Flag.cpp b/general/Flag.cpp
index f54ca329..8dc6026e 100644
--- a/general/Flag.cpp
+++ b/general/Flag.cpp
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sun Mar 18 15:25:16 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
diff --git a/general/Flag.h b/general/Flag.h
index e236c6df..3862ad3b 100644
--- a/general/Flag.h
+++ b/general/Flag.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue Mar 20 19:22 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
diff --git a/general/Frac.cpp b/general/Frac.cpp
index 74d76881..539205ef 100644
--- a/general/Frac.cpp
+++ b/general/Frac.cpp
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sun Mar 18 15:25:16 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
@@ -22,7 +22,7 @@
#include "Frac.h"
-void PokeGen::Frac::set(const unsigned n, const unsigned d)
+void PokeGen::Frac::set(const unsigned n, const unsigned d) throw(Exception)
{
if ((type == Improper) || ((n < d) && (type == Proper)) || ((d < n) && (type == Over1)))
{
@@ -30,26 +30,26 @@ void PokeGen::Frac::set(const unsigned n, const unsigned d)
denom = d;
}
else
- throw("Frac: values conflict with type");
+ throw(Exception("Frac", "values conflict with type"));
}
-void PokeGen::Frac::set(const unsigned n, const unsigned d, const unsigned t)
+void PokeGen::Frac::set(const unsigned n, const unsigned d, const unsigned t) throw(Exception)
{
setType(t);
set(n, d);
}
-void PokeGen::Frac::setNum(const unsigned n)
+void PokeGen::Frac::setNum(const unsigned n) throw(Exception)
{
set(n, denom);
}
-void PokeGen::Frac::setDenom(const unsigned d)
+void PokeGen::Frac::setDenom(const unsigned d) throw(Exception)
{
set(num, d);
}
-void PokeGen::Frac::setType(const unsigned t)
+void PokeGen::Frac::setType(const unsigned t) throw(BoundsException)
{
if (t < End)
{
@@ -57,7 +57,7 @@ void PokeGen::Frac::setType(const unsigned t)
set(1, 1);
}
else
- throw("Frac: type out of range");
+ throw(BoundsException("Frac", "type"));
}
void PokeGen::Frac::reduce()
diff --git a/general/Frac.h b/general/Frac.h
index 15d2e8e1..7be576c6 100644
--- a/general/Frac.h
+++ b/general/Frac.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sun Mar 18 15:25:16 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
@@ -25,6 +25,7 @@
#include <QFile>
#include <QString>
+#include "Exception.h"
namespace PokeGen
{
@@ -48,11 +49,11 @@ namespace PokeGen
set(n, d, t);
}
- void set(const unsigned n, const unsigned d);
- void set(const unsigned n, const unsigned d, const unsigned t);
- void setNum(const unsigned n);
- void setDenom(const unsigned d);
- void setType(const unsigned t);
+ void set(const unsigned n, const unsigned d) throw(Exception);
+ void set(const unsigned n, const unsigned d, const unsigned t) throw(Exception);
+ void setNum(const unsigned n) throw(Exception);
+ void setDenom(const unsigned d) throw(Exception);
+ void setType(const unsigned t) throw(BoundsException);
unsigned getNum() const
{
diff --git a/general/FracMatrix.h b/general/FracMatrix.h
index f914b189..3becd3dc 100644
--- a/general/FracMatrix.h
+++ b/general/FracMatrix.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Fri Oct 19 12:52:16 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
diff --git a/general/Hat.h b/general/Hat.h
index 62ceac48..a6e892e0 100644
--- a/general/Hat.h
+++ b/general/Hat.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Tue May 29 2007 08:23:57
-// Copyright: ©2007 Nerdy Productions
+// 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
@@ -20,8 +20,8 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
/////////////////////////////////////////////////////////////////////////////
-#ifndef __POKEMOD_HAT__
-#define __POKEMOD_HAT__
+#ifndef __HAT__
+#define __HAT__
#include <QMap>
#include <cstdlib>
@@ -50,7 +50,7 @@ namespace PokeGen
}
T remove()
{
- T chosen = PickItem();
+ T chosen = pick();
if (!(--objects[chosen]))
objects.erase(chosen);
--totalWeight;
diff --git a/general/ImageCache.cpp b/general/ImageCache.cpp
new file mode 100644
index 00000000..c02342ae
--- /dev/null
+++ b/general/ImageCache.cpp
@@ -0,0 +1,33 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/ImageCache.h
+// Purpose: Cache for quick image loading
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Thu Jan 17 2008 13:42:44
+// 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 <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#include "ImageCache.h"
+
+QPixmap PokeGen::ImageCache::open(const QString& fname, const bool force) throw(OpenException)
+{
+ QPixmap pm;
+ if (force)
+ QPixmapCache::remove(fname);
+ if (!QPixmapCache::find(fname, pm))
+ throw(OpenException("ImageCache", fname));
+ return pm;
+}
diff --git a/general/ImageCache.h b/general/ImageCache.h
new file mode 100644
index 00000000..097d099c
--- /dev/null
+++ b/general/ImageCache.h
@@ -0,0 +1,40 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: general/ImageCache.h
+// Purpose: Cache for quick image loading
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Thu Jan 17 2008 12:35:22
+// 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 <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __IMAGECACHE__
+#define __IMAGECACHE__
+
+#include <QPixmap>
+#include <QPixmapCache>
+#include <QString>
+#include "Exception.h"
+
+namespace PokeGen
+{
+ class ImageCache
+ {
+ public:
+ static QPixmap open(const QString& fname, const bool force = false) throw(OpenException);
+ };
+}
+
+#endif
diff --git a/general/Ini.cpp b/general/Ini.cpp
index 5748a206..df2b74a0 100644
--- a/general/Ini.cpp
+++ b/general/Ini.cpp
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Fri May 4 23:27:37 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
@@ -27,16 +27,16 @@ PokeGen::Ini::Ini(const QString& fname)
load(fname);
}
-void PokeGen::Ini::load(const QString& fname)
+void PokeGen::Ini::load(const QString& fname) throw(Exception)
{
QFile fin(fname);
if (!fin.exists())
- throw("Ini: file does not exist");
+ throw(OpenException("Ini", fname));
load(fin);
fin.close();
}
-void PokeGen::Ini::load(QFile& fin)
+void PokeGen::Ini::load(QFile& fin) throw(InvalidException)
{
QTextStream file(&fin);
QString line = file.readLine();
@@ -48,25 +48,25 @@ void PokeGen::Ini::load(QFile& fin)
{
pos = line.indexOf('=');
if (pos == -1)
- throw("Ini: invalid file");
+ throw(InvalidException("Ini", fin.fileName()));
field = line.mid(0, pos - 1);
value = line.mid(pos + 1, line.length() - pos);
if (field.isEmpty())
- throw("Ini: invalid line");
+ throw(InvalidException("Ini", fin.fileName()));
fields[field] = value;
line = file.readLine();
}
}
-void PokeGen::Ini::save(const QString& fname) const
+void PokeGen::Ini::save(const QString& fname) const throw(Exception)
{
QStringList path = fname.split(QDir::separator(), QString::SkipEmptyParts);
path.removeLast();
if (!QDir().mkpath(path.join("/")))
- throw("Ini: unable to create path");
+ throw(DirException("Ini", path.join("/")));
QFile fout(fname);
if (!fout.open(QIODevice::WriteOnly))
- throw("Ini: unable to open file");
+ throw(OpenException("Ini", fname));
save(fout);
fout.close();
}
diff --git a/general/Ini.h b/general/Ini.h
index 963e6d1b..6cb441c7 100644
--- a/general/Ini.h
+++ b/general/Ini.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Fri May 4 23:27:37 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
@@ -29,6 +29,7 @@
#include <QString>
#include <QStringList>
#include <QTextStream>
+#include "Exception.h"
namespace PokeGen
{
@@ -38,8 +39,8 @@ namespace PokeGen
Ini();
Ini(const QString& fname);
- void load(const QString& fname);
- void save(const QString& fname) const;
+ void load(const QString& fname) throw(Exception);
+ void save(const QString& fname) const throw(Exception);
void addField(const QString& n, const bool v);
void addField(const QString& n, const unsigned char v);
@@ -64,7 +65,7 @@ namespace PokeGen
Value = 1
};
- void load(QFile& fin);
+ void load(QFile& fin) throw(InvalidException);
void save(QFile& fout) const;
QMap<QString, QString> fields;
diff --git a/general/Matrix.h b/general/Matrix.h
index bdeaa709..f4fd638e 100644
--- a/general/Matrix.h
+++ b/general/Matrix.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sun Apr 8 12:51:20 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
@@ -153,13 +153,13 @@ namespace PokeGen
{
if ((height <= row) || (width <= col))
throw("Matrix: dimension out-of-bounds");
- return matrix[row][col];
+ return matrix.at(row).at(col);
}
const QVector<T> getRow(const unsigned row) const
{
if (height <= row)
throw("Matrix: dimension out-of-bounds");
- return matrix[row];
+ return matrix.at(row);
}
const QVector<T> getCol(const unsigned col) const
{
@@ -219,6 +219,10 @@ namespace PokeGen
}
return true;
}
+ bool operator!=(const Matrix<T>& rhs)
+ {
+ return !(*this == rhs);
+ }
protected:
unsigned width;
unsigned height;
diff --git a/general/Point.h b/general/Point.h
index 17c907e8..9143b491 100644
--- a/general/Point.h
+++ b/general/Point.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Sun Apr 8 12:53:15 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
diff --git a/general/Ref.cpp b/general/Ref.cpp
index 83432adb..e8ca482b 100644
--- a/general/Ref.cpp
+++ b/general/Ref.cpp
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Thu Feb 15 10:21:05 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
diff --git a/general/Ref.h b/general/Ref.h
index 46db4b4a..12508aed 100644
--- a/general/Ref.h
+++ b/general/Ref.h
@@ -4,7 +4,7 @@
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Thu Feb 15 8:42:45 2007
-// Copyright: ©2007 Nerdy Productions
+// 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
diff --git a/overworld/overworld.pro b/overworld/overworld.pro
new file mode 100644
index 00000000..9c0fd58f
--- /dev/null
+++ b/overworld/overworld.pro
@@ -0,0 +1,10 @@
+OBJECTS_DIR = ../../obj/overworld
+DESTDIR = ../../lib
+VERSION = 0.1.0
+TEMPLATE = lib
+LIBS += -L../../lib -lgeneral -lpokemod
+
+CONFIG += qt warn_on dll
+
+SOURCES += *.cpp
+HEADERS += *.h
diff --git a/pokegen.pro b/pokegen.pro
index 319270fe..a9b669cb 100755
--- a/pokegen.pro
+++ b/pokegen.pro
@@ -6,6 +6,7 @@ CONFIG += ordered qt warn_on
SUBDIRS = audio \
battle \
+ general \
pokemod \
pokemodr
diff --git a/pokegen/PokeGen.h b/pokegen/PokeGen.h
new file mode 100644
index 00000000..537f2656
--- /dev/null
+++ b/pokegen/PokeGen.h
@@ -0,0 +1,42 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokegen/PokeGen.h
+// Purpose: Main window for PokéGen
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Thu Jan 16 16:14:22 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 <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __POKEGEN_MAIN__
+#define __POKEGEN_MAIN__
+
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+
+int main(int argc, char* argv[])
+{
+ KApplication app;
+ // TODO
+ KAboutData about("pokegen", "", ki18n("PokéGen"), VERSION_STRING, ki18n(""), License_Unknown, ki18n("©2007-2008 Ben Boeckel and Nerdy Productions"), ki18n(""), "http://sourceforge.net/projects/pokegen");
+ about.setLicenseTextFile(ki18n("LICENSE"));
+ // TODO
+ about.setProgramName(ki18n(""));
+ about.addAuthor("Ben Boeckel", ki18n("Lead Programmer"), "MathStuf@gmail.com", "http://nerdyproductions.sobertillnoon.com");
+ about.addCredit("Peter Fernandes", ki18n("Ideas"), "supersonicandtails@gmail.com", "http://www.hypersonicsoft.org");
+ about.addCredit("Kevin Kofler", ki18n("Qt and KDE help"), "kevin.kofler@chello.at", "http://www.tigen.org/kevin.kofler");
+}
+
+#endif
diff --git a/pokegen/pokegen.pro b/pokegen/pokegen.pro
new file mode 100644
index 00000000..6640bbe3
--- /dev/null
+++ b/pokegen/pokegen.pro
@@ -0,0 +1,10 @@
+OBJECTS_DIR = ../../obj/pokegen
+DESTDIR = ../../bin
+VERSION = 0.1.0
+TEMPLATE = app
+LIBS += -L../../lib -lgeneral -lpokemod -loverworld -lbattle -laudio
+
+CONFIG += qt gui warn_on dll
+
+SOURCES += *.cpp
+HEADERS += *.h
diff --git a/pokemodr/PokeModr.cpp b/pokemodr/PokeModr.cpp
deleted file mode 100644
index ba4f7283..00000000
--- a/pokemodr/PokeModr.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemodr/PokeModr.cpp
-// Purpose: Define an ability effect
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Wed Feb 14 23:44:42 2007
-// Copyright: ©2007 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 <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#include "PokeModrDebug.h"
-#include <iostream>
-
-#include <wx/wxprec.h>
-#ifndef WX_PRECOMP
-# include <wx/wx.h>
-#endif
-#include "../pokemod/pokemod_inc.h"
-
-using namespace std;
-using namespace PokeGen;
-
-#define PKMR_VERSION "0.0.0.1a"
-#define PKMR_DATE "Thursday, February 8, 2007"
-#define PKMR_WEBSITE "http:/""/nerdyproductions.sobertillnoon.com"
-
-PokeMod::Pokemod curPokeMod;
-
-int PokeModrDebugLevel;
-
-int main(int argc, char* argv[])
-{
- // Command Line argument parsing
- for (int i = 0; i < argc; i++)
- {
- if (strcmp(argv[i], "--help") && strcmp(argv[i], "-h"))
- {
- cout << "PokéModr v" PKMR_VERSION "\n";
- cout << "Released on " PKMR_DATE "\n";
- cout << "Website: " PKMR_WEBSITE "\n";
- cout << "";
- cout << "";
- cout << "";
- }
-# ifdef POKEMODR_DEBUG
- else if (strcmp(argv[i], "--debug") && strcmp(argv[i], "-d"))
- {
- cout << "Debugging support turned on\n";
- debugLevel = atoi(argv[++i]);
- }
-# endif
-# ifdef PM_DEBUG
- else if (strcmp(argv[i], "--PMdebug"))
- {
- cout << "PokéMod debugging support turned on\n";
- PMdebugLevel = atoi(argv[++i]);
- }
-# endif
- else if (strcmp(argv[i], "--licence") && strcmp(argv[i], "-l"))
- {
- cout << "This program is free software; you can redistribute it and/or modify\n";
- cout << "it under the terms of the GNU General Public License as published by\n";
- cout << "the Free Software Foundation; either version 2 of the License, or\n";
- cout << "(at your option) any later version.\n\n";
- cout << "This program is distributed in the hope that it will be useful,\n";
- cout << "but WITHOUT ANY WARRANTY; without even the implied warranty of\n";
- cout << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n";
- cout << "GNU General Public License for more details.\n\n";
- cout << "You should have received a copy of the GNU General Public License along\n";
- cout << "with this program; if not, write to the Free Software Foundation, Inc.,\n";
- cout << "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n";
- }
- else if (strcmp(argv[i], "") && strcmp(argv[i], ""))
- {
-
- }
- else if (strcmp(argv[i], "") && strcmp(argv[i], ""))
- {
-
- }
- else if (strcmp(argv[i], "") && strcmp(argv[i], ""))
- {
-
- }
- else
- cout << "Command \"" << argv[i] << "\" not recognized\n";
- }
- // GUI initialization
- // Program Start
- // Clean Up
-}
diff --git a/pokemodr/PokeModr.h b/pokemodr/PokeModr.h
new file mode 100644
index 00000000..cf66baa7
--- /dev/null
+++ b/pokemodr/PokeModr.h
@@ -0,0 +1,26 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: pokegen/PokeModr.h
+// Purpose: Main window for PokéModr
+// Author: Ben Boeckel
+// Modified by: Ben Boeckel
+// Created: Thu Jan 16 17:48:13 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 <http://www.gnu.org/licenses/>.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __POKEMODR_MAIN__
+#define __POKEMODR_MAIN__
+
+#endif
diff --git a/pokemodr/PokeModrDebug.h b/pokemodr/PokeModrDebug.h
deleted file mode 100644
index 64001f81..00000000
--- a/pokemodr/PokeModrDebug.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name: pokemodr/PokeModrDebug.h
-// Purpose: Define debugging stuff for PokéModr
-// Author: Ben Boeckel
-// Modified by: Ben Boeckel
-// Created: Thu Feb 15 12:30:45 2007
-// Copyright: ©2007 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 <http://www.gnu.org/licenses/>.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef __PKMR_DEBUG__
-#define __PKMR_DEBUG__
-
-#define PKMR_DEBUG
-
-#ifdef PKMR_DEBUG
-
-# define PKMR_DEBUG_OUTPUT_FILE
-# define PKMR_DEBUG_OUTPUT_CONSOLE
-
-# include <ctime>
-
-# ifdef PKMR_DEBUG_OUTPUT_FILE
-# include <fstream>
-# endif
-
-# ifdef PKMR_DEBUG_OUTPUT_CONSOLE
-# include <cstdio>
-# endif
-
-# if !defined(PKMR_DEBUG_OUTPUT_FILE) && !defined(PKMR_DEBUG_OUTPUT_CONSOLE) && !defined(PG_DEBUG_WINDOW)
-# error "Debugging turned on, but no output specified!"
-# endif
-
-namespace PokeGen
-{
- namespace PokeModr
- {
- enum PokeModrDebug
- {
- PKMR_DEBUG_EMERGENCY = 0,
- PKMR_DEBUG_ALERT = 1,
- PKMR_DEBUG_CRITICAL_ERROR = 2,
- PKMR_DEBUG_ERROR = 3,
- PKMR_DEBUG_WARNING = 4,
- PKMR_DEBUG_NOTICE = 5,
- PKMR_DEBUG_INFO = 6,
- PKMR_DEBUG_DEBUG = 7
- };
- }
-}
-
-#endif
-
-#endif
diff --git a/pokemodr/pokemodr.pro b/pokemodr/pokemodr.pro
new file mode 100644
index 00000000..60e9aec6
--- /dev/null
+++ b/pokemodr/pokemodr.pro
@@ -0,0 +1,10 @@
+OBJECTS_DIR = ../../obj/pokemodr
+DESTDIR = ../../bin
+VERSION = 0.1.0
+TEMPLATE = app
+LIBS += -L../../lib -lgeneral -lpokemod -laudio
+
+CONFIG += qt gui warn_on dll
+
+SOURCES += *.cpp
+HEADERS += *.h