summaryrefslogtreecommitdiffstats
path: root/pokemod/Time.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-04-27 15:15:17 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-04-27 15:15:17 +0000
commit807071d35159de0660f9df31c48d5bf895ca3622 (patch)
treea1e9dbdc1e58b91cd2e4a5e472597b0204ccb41d /pokemod/Time.cpp
parentf444f5a45e9325644a360f656176d47d7f540f52 (diff)
[FIX] Pokemod objects now know about parents
[FIX] Project includes are now relative [FIX] Headers included for better detection of invalid headers [FIX] Validation code commented out so it can be done better git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@111 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Time.cpp')
-rw-r--r--pokemod/Time.cpp57
1 files changed, 29 insertions, 28 deletions
diff --git a/pokemod/Time.cpp b/pokemod/Time.cpp
index ba9d3f46..50754361 100644
--- a/pokemod/Time.cpp
+++ b/pokemod/Time.cpp
@@ -15,58 +15,59 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-// Pokemod includes
-#include "Pokemod.h"
-
// Header include
#include "Time.h"
+// Pokemod includes
+#include "Pokemod.h"
+
Time::Time(const Time& time) :
- Object("Time", time.pokemod(), time.id())
+ Object("Time", time.parent(), time.id())
{
*this = time;
}
-Time::Time(const Pokemod* pokemod, const int id) :
- Object("Time", pokemod, id),
+Time::Time(const Object* parent, const int id) :
+ Object("Time", parent, id),
m_name(""),
m_hour(0),
m_minute(0)
{
}
-Time::Time(const Time& time, const Pokemod* pokemod, const int id) :
- Object("Time", pokemod, id)
+Time::Time(const Time& time, const Object* parent, const int id) :
+ Object("Time", parent, id)
{
*this = time;
}
-Time::Time(const QDomElement& xml, const Pokemod* pokemod, const int id) :
- Object("Time", pokemod, id)
+Time::Time(const QDomElement& xml, const Object* parent, const int id) :
+ Object("Time", parent, id)
{
load(xml, id);
}
bool Time::validate() const
{
- bool valid = true;
- pokemod()->validationMsg(QString("---Time \"%1\" with id %2---").arg(m_name).arg(id()), Pokemod::V_Msg);
- if (m_name == "")
- {
- pokemod()->validationMsg("Name not defined");
- valid = false;
- }
- if (23 < m_hour)
- {
- pokemod()->validationMsg("Invalid starting hour");
- valid = false;
- }
- if (59 < m_minute)
- {
- pokemod()->validationMsg("Invalid start minute");
- valid = false;
- }
- return valid;
+ // TODO: validate
+// bool valid = true;
+// static_cast<const Pokemod*>(pokemod())->validationMsg(QString("---Time \"%1\" with id %2---").arg(m_name).arg(id()), Pokemod::V_Msg);
+// if (m_name == "")
+// {
+// static_cast<const Pokemod*>(pokemod())->validationMsg("Name not defined");
+// valid = false;
+// }
+// if (23 < m_hour)
+// {
+// static_cast<const Pokemod*>(pokemod())->validationMsg("Invalid starting hour");
+// valid = false;
+// }
+// if (59 < m_minute)
+// {
+// static_cast<const Pokemod*>(pokemod())->validationMsg("Invalid start minute");
+// valid = false;
+// }
+// return valid;
}
void Time::load(const QDomElement& xml, int id)