From 807071d35159de0660f9df31c48d5bf895ca3622 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 27 Apr 2008 15:15:17 +0000 Subject: [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 --- pokemod/Time.cpp | 57 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'pokemod/Time.cpp') 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 . */ -// 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(pokemod())->validationMsg(QString("---Time \"%1\" with id %2---").arg(m_name).arg(id()), Pokemod::V_Msg); +// if (m_name == "") +// { +// static_cast(pokemod())->validationMsg("Name not defined"); +// valid = false; +// } +// if (23 < m_hour) +// { +// static_cast(pokemod())->validationMsg("Invalid starting hour"); +// valid = false; +// } +// if (59 < m_minute) +// { +// static_cast(pokemod())->validationMsg("Invalid start minute"); +// valid = false; +// } +// return valid; } void Time::load(const QDomElement& xml, int id) -- cgit