summaryrefslogtreecommitdiffstats
path: root/pokemod/GlobalScript.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-05-23 19:05:08 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-05-23 19:05:08 +0000
commitc07a81f2656d1168e7124f0b7281a4e38128926b (patch)
treecf0c4d044bc20683c54631862e07ee166b4c0b7f /pokemod/GlobalScript.cpp
parentd8973a8ed86925ea5611520c3b7b989ccc238bb4 (diff)
downloadsigen-c07a81f2656d1168e7124f0b7281a4e38128926b.tar.gz
sigen-c07a81f2656d1168e7124f0b7281a4e38128926b.tar.xz
sigen-c07a81f2656d1168e7124f0b7281a4e38128926b.zip
[FIX] Scrapped effects and such for scripts (going to use Kross) in pokemod
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@166 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/GlobalScript.cpp')
-rw-r--r--pokemod/GlobalScript.cpp102
1 files changed, 102 insertions, 0 deletions
diff --git a/pokemod/GlobalScript.cpp b/pokemod/GlobalScript.cpp
new file mode 100644
index 00000000..770ea269
--- /dev/null
+++ b/pokemod/GlobalScript.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2007-2008 Ben Boeckel <MathStuf@gmail.com>
+ *
+ * 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/>.
+ */
+
+// Header include
+#include "GlobalScript.h"
+
+// Pokemod includes
+#include "Pokemod.h"
+#include "Script.h"
+
+GlobalScript::GlobalScript(const GlobalScript& globalScript) :
+ Object("GlobalScript", globalScript.parent(), globalScript.id())
+{
+ *this = globalScript;
+}
+
+GlobalScript::GlobalScript(const Pokemod* parent, const int id) :
+ Object("GlobalScript", parent, id),
+ m_name(""),
+ m_script("", "")
+{
+}
+
+GlobalScript::GlobalScript(const GlobalScript& globalScript, const Pokemod* parent, const int id) :
+ Object("GlobalScript", parent, id)
+{
+ *this = globalScript;
+}
+
+GlobalScript::GlobalScript(const QDomElement& xml, const Pokemod* parent, const int id) :
+ Object("GlobalScript", parent, id)
+{
+ load(xml, id);
+}
+
+GlobalScript::~GlobalScript()
+{
+}
+
+void GlobalScript::validate()
+{
+ if (m_name.isEmpty())
+ emit(error("Name is empty"));
+}
+
+void GlobalScript::load(const QDomElement& xml, int id)
+{
+ LOAD_ID();
+ LOAD(QString, name);
+ LOAD(Script, script);
+}
+
+QDomElement GlobalScript::save() const
+{
+ SAVE_CREATE();
+ SAVE(QString, name);
+ SAVE(Script, script);
+ return xml;
+}
+
+void GlobalScript::setName(const QString& name)
+{
+ CHECK(name);
+}
+
+void GlobalScript::setScript(const Script& script)
+{
+ CHECK(script);
+}
+
+QString GlobalScript::name() const
+{
+ return m_name;
+}
+
+Script GlobalScript::script() const
+{
+ return m_script;
+}
+
+GlobalScript& GlobalScript::operator=(const GlobalScript& rhs)
+{
+ if (this == &rhs)
+ return *this;
+ COPY(name);
+ COPY(script);
+ return *this;
+}