diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-01-20 23:51:22 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-01-20 23:51:22 -0500 |
| commit | 7e91e7b2e7285adf3198a1be68d63bc6411e2544 (patch) | |
| tree | 28381d256a59c31f355bc6da29a395f647cb0a87 | |
| parent | b0a67f0bb797daa8303b505fb9150da222717d40 (diff) | |
Cleaned up Sigmod widget and now a startScript instead of warp
| -rw-r--r-- | sigmod/Sigmod.cpp | 49 | ||||
| -rw-r--r-- | sigmod/Sigmod.h | 15 | ||||
| -rw-r--r-- | sigmodr/SigmodUI.cpp | 48 | ||||
| -rw-r--r-- | sigmodr/SigmodUI.h | 6 | ||||
| -rw-r--r-- | sigmodr/gui/sigmod.ui | 260 | ||||
| -rw-r--r-- | sigscript/SigmodWrapper.cpp | 6 | ||||
| -rw-r--r-- | sigscript/SigmodWrapper.h | 4 |
7 files changed, 161 insertions, 227 deletions
diff --git a/sigmod/Sigmod.cpp b/sigmod/Sigmod.cpp index c6eabb49..7e255e08 100644 --- a/sigmod/Sigmod.cpp +++ b/sigmod/Sigmod.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2007-2008 Ben Boeckel <MathStuf@gmail.com> + * Copyright 2007-2009 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 @@ -53,8 +53,7 @@ Sigmod::Sigmod::Sigmod() : m_version(""), m_description(""), m_singlePlayer(true), - m_startMap(INT_MAX), - m_startWarp(INT_MAX), + m_startScript("", ""), m_typechart(0, 0), m_rules(new Rules(this)) { @@ -89,14 +88,6 @@ void Sigmod::Sigmod::validate() emit(error("Version is empty")); if (m_description.isEmpty()) emit(warning("Description is empty")); - if (m_singlePlayer) - { - const Map* map = mapById(m_startMap); - if (!map) - emit(error("Invalid starting map")); - else if (!map->warpById(m_startWarp)) - emit(error("Invalid starting warp")); - } if ((m_typechart.width() != typeCount()) || (m_typechart.height() != typeCount())) emit(error("Type chart is invalid")); TEST_CHILD(m_rules); @@ -283,8 +274,7 @@ void Sigmod::Sigmod::load(const QDomElement& xml) LOAD(version); LOAD(description); LOAD(singlePlayer); - LOAD(startMap); - LOAD(startWarp); + LOAD(startScript); m_rules->load(xml.firstChildElement("Rules")); LOAD_SUB(newAbility, Ability); LOAD_SUB(newAuthor, Author); @@ -319,8 +309,7 @@ QDomElement Sigmod::Sigmod::save() const SAVE(version); SAVE(description); SAVE(singlePlayer); - SAVE(startMap); - SAVE(startWarp); + SAVE(startScript); SAVE_Rules(rules); SAVE_MATRIX(typechart); SAVE_SUB(Ability, abilities); @@ -352,8 +341,7 @@ SETTER(Sigmod, QString&, Title, title) SETTER(Sigmod, QString&, Version, version) SETTER(Sigmod, QString&, Description, description) SETTER(Sigmod, bool, SinglePlayer, singlePlayer) -SETTER(Sigmod, int, StartMap, startMap) -SETTER(Sigmod, int, StartWarp, startWarp) +SETTER(Sigmod, Sigcore::Script&, StartScript, startScript) SETTER_MATRIX(Sigmod, Sigcore::Fraction&, Typechart, typechart, multiplier) void Sigmod::Sigmod::setRules(const Rules& rules) @@ -370,8 +358,7 @@ GETTER(Sigmod, QString, title) GETTER(Sigmod, QString, version) GETTER(Sigmod, QString, description) GETTER(Sigmod, bool, singlePlayer) -GETTER(Sigmod, int, startMap) -GETTER(Sigmod, int, startWarp) +GETTER(Sigmod, Sigcore::Script, startScript) const Sigcore::Matrix<Sigcore::Fraction>* Sigmod::Sigmod::typechart() const { @@ -402,26 +389,7 @@ CHECK(Sigmod, QString&, title) CHECK(Sigmod, QString&, version) CHECK(Sigmod, QString&, description) CHECK(Sigmod, bool, singlePlayer) -CHECK_BEGIN(Sigmod, int, startMap) - if (!m_singlePlayer) - { - emit(error(unused("startMap"))); - return false; - } - if (!mapById(startMap)) - EBOUNDS_IDX(startMap); -CHECK_END() -CHECK_BEGIN(Sigmod, int, startWarp) - if (!m_singlePlayer) - { - emit(error(unused("startWarp"))); - return false; - } - const Map* map = mapById(m_startMap); - if (!map) - EBOUNDS_IDX(m_startMap); - IBOUNDS(startWarp, map, warp); -CHECK_END() +CHECK(Sigmod, Sigcore::Script&, startScript) CHECK_BOUNDS(Sigmod, Sigcore::Fraction&, typechart, 0, INT_MAX) SSUBCLASS(Sigmod, Ability, ability, abilities) @@ -540,8 +508,7 @@ Sigmod::Sigmod& Sigmod::Sigmod::operator=(const Sigmod& rhs) COPY(version); COPY(description); COPY(singlePlayer); - COPY(startMap); - COPY(startWarp); + COPY(startScript); COPY(typechart); COPY_Rules(rules); COPY_SUB(Ability, abilities); diff --git a/sigmod/Sigmod.h b/sigmod/Sigmod.h index 0ccad22d..5595927f 100644 --- a/sigmod/Sigmod.h +++ b/sigmod/Sigmod.h @@ -1,5 +1,5 @@ /* - * Copyright 2007-2008 Ben Boeckel <MathStuf@gmail.com> + * Copyright 2007-2009 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 @@ -25,6 +25,7 @@ // Sigcore includes #include "../sigcore/Fraction.h" #include "../sigcore/Matrix.h" +#include "../sigcore/Script.h" // Sigmod includes #include "Object.h" @@ -116,8 +117,7 @@ class SIGMOD_EXPORT Sigmod : public Object void setVersion(const QString& version); void setDescription(const QString& description); void setSinglePlayer(const bool singlePlayer); - void setStartMap(const int startMap); - void setStartWarp(const int startWarp); + void setStartScript(const Sigcore::Script& startScript); void setTypechart(const int attack, const int defense, const Sigcore::Fraction& multiplier); void setRules(const Rules& rules); void setRules(const QDomElement& xml); @@ -126,8 +126,7 @@ class SIGMOD_EXPORT Sigmod : public Object QString version() const; QString description() const; bool singlePlayer() const; - int startMap() const; - int startWarp() const; + Sigcore::Script startScript() const; const Sigcore::Matrix<Sigcore::Fraction>* typechart() const; Sigcore::Matrix<Sigcore::Fraction>* typechart(); Sigcore::Fraction typechart(const int attack, const int defense) const; @@ -138,8 +137,7 @@ class SIGMOD_EXPORT Sigmod : public Object bool versionCheck(const QString& version) const; bool descriptionCheck(const QString& description) const; bool singlePlayerCheck(const bool singlePlayer) const; - bool startMapCheck(const int startMap) const; - bool startWarpCheck(const int startWarp) const; + bool startScriptCheck(const Sigcore::Script& startScript) const; bool typechartCheck(const Sigcore::Fraction& multiplier) const; const Ability* ability(const int index) const; @@ -480,8 +478,7 @@ class SIGMOD_EXPORT Sigmod : public Object QString m_version; QString m_description; bool m_singlePlayer; - int m_startMap; - int m_startWarp; + Sigcore::Script m_startScript; Sigcore::Matrix<Sigcore::Fraction> m_typechart; Rules* m_rules; QList<Ability*> m_abilities; diff --git a/sigmodr/SigmodUI.cpp b/sigmodr/SigmodUI.cpp index 0ff3388f..0321e5a0 100644 --- a/sigmodr/SigmodUI.cpp +++ b/sigmodr/SigmodUI.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * Copyright 2008-2009 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 @@ -29,8 +29,7 @@ Sigmodr::SigmodUI::SigmodUI(Sigmod::Sigmod* sigmod, QWidget* parent) : ObjectUI(parent), - m_changingMult(true), - m_lastMap(-1) + m_changingMult(true) { setupUi(this); setObjects(sigmod, new Sigmod::Sigmod(*sigmod)); @@ -50,44 +49,16 @@ void Sigmodr::SigmodUI::initGui() void Sigmodr::SigmodUI::refreshGui() { - const bool blocked = varMap->blockSignals(true); - varMap->clear(); - for (int i = 0; i < qobject_cast<Sigmod::Sigmod*>(original())->mapCount(); ++i) - { - const Sigmod::Map* map = qobject_cast<Sigmod::Sigmod*>(original())->map(i); - varMap->addItem(map->name(), map->id()); - } - varMap->blockSignals(blocked); varEffectiveness->setEnabled(false); } void Sigmodr::SigmodUI::setGui() { - const bool resetWarps = (qobject_cast<Sigmod::Sigmod*>(modified())->startMap() != m_lastMap); varTitle->setText(qobject_cast<Sigmod::Sigmod*>(modified())->title()); varVersion->setText(qobject_cast<Sigmod::Sigmod*>(modified())->version()); varDescription->setText(qobject_cast<Sigmod::Sigmod*>(modified())->description()); - varSinglePlayer->setChecked(qobject_cast<Sigmod::Sigmod*>(modified())->singlePlayer() ? Qt::Checked : Qt::Unchecked); - varMap->setCurrentIndex(varMap->findData(qobject_cast<Sigmod::Sigmod*>(modified())->startMap())); - varMap->setEnabled(qobject_cast<Sigmod::Sigmod*>(modified())->singlePlayer()); - m_lastMap = qobject_cast<Sigmod::Sigmod*>(modified())->startMap(); - if (resetWarps) - { - const bool blocked = varWarp->blockSignals(true); - varWarp->clear(); - const Sigmod::Map* map = qobject_cast<Sigmod::Sigmod*>(original())->mapById(qobject_cast<Sigmod::Sigmod*>(modified())->startMap()); - if (map) - { - for (int i = 0; i < map->warpCount(); ++i) - { - const Sigmod::MapWarp* warp = map->warp(i); - varWarp->addItem(warp->name(), warp->id()); - } - } - varWarp->blockSignals(blocked); - } - varWarp->setCurrentIndex(varWarp->findData(qobject_cast<Sigmod::Sigmod*>(modified())->startWarp())); - varWarp->setEnabled(qobject_cast<Sigmod::Sigmod*>(modified())->singlePlayer()); + varSinglePlayer->setCheckState(qobject_cast<Sigmod::Sigmod*>(modified())->singlePlayer() ? Qt::Checked : Qt::Unchecked); + varStartScript->setValue(qobject_cast<Sigmod::Sigmod*>(modified())->startScript()); } void Sigmodr::SigmodUI::apply() @@ -130,14 +101,9 @@ void Sigmodr::SigmodUI::on_varSinglePlayer_clicked(const bool singlePlayer) qobject_cast<Sigmod::Sigmod*>(modified())->setSinglePlayer(singlePlayer); } -void Sigmodr::SigmodUI::on_varMap_activated(const int map) +void Sigmodr::SigmodUI::on_varStartScript_valueChanged(const Sigcore::Script& startScript) { - qobject_cast<Sigmod::Sigmod*>(modified())->setStartMap(varMap->itemData(map).toInt()); -} - -void Sigmodr::SigmodUI::on_varWarp_activated(const int warp) -{ - qobject_cast<Sigmod::Sigmod*>(modified())->setStartWarp(varWarp->itemData(warp).toInt()); + qobject_cast<Sigmod::Sigmod*>(modified())->setStartScript(startScript); } void Sigmodr::SigmodUI::on_varTypechart_clicked(const QModelIndex& index) @@ -145,7 +111,7 @@ void Sigmodr::SigmodUI::on_varTypechart_clicked(const QModelIndex& index) m_index = index; m_changingMult = true; varEffectiveness->setEnabled(true); - boxEffectiveness->setTitle(QString("%1 vs. %2").arg(varTypechart->model()->headerData(index.row(), Qt::Vertical, Qt::DisplayRole).toString()).arg(varTypechart->model()->headerData(index.column(), Qt::Horizontal, Qt::DisplayRole).toString())); + labelTypes->setText(QString("%1 vs. %2").arg(varTypechart->model()->headerData(index.row(), Qt::Vertical, Qt::DisplayRole).toString()).arg(varTypechart->model()->headerData(index.column(), Qt::Horizontal, Qt::DisplayRole).toString())); varEffectiveness->setValue(varTypechart->model()->data(m_index, Qt::EditRole).value<Sigcore::Fraction>()); } diff --git a/sigmodr/SigmodUI.h b/sigmodr/SigmodUI.h index f76b00b3..d0669cd5 100644 --- a/sigmodr/SigmodUI.h +++ b/sigmodr/SigmodUI.h @@ -1,5 +1,5 @@ /* - * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * Copyright 2008-2009 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 @@ -47,13 +47,11 @@ class SigmodUI : public ObjectUI, private Ui::formSigmod void on_varVersion_textChanged(const QString& version); void on_varDescription_textChanged(const QString& description); void on_varSinglePlayer_clicked(const bool singlePlayer); - void on_varMap_activated(const int map); - void on_varWarp_activated(const int warp); + void on_varStartScript_valueChanged(const Sigcore::Script& startScript); void on_varTypechart_clicked(const QModelIndex& index); void on_varEffectiveness_valueChanged(const Sigcore::Fraction& multiplier); private: bool m_changingMult; - int m_lastMap; QModelIndex m_index; private slots: void initGui(); diff --git a/sigmodr/gui/sigmod.ui b/sigmodr/gui/sigmod.ui index 2e820353..0b1af59a 100644 --- a/sigmodr/gui/sigmod.ui +++ b/sigmodr/gui/sigmod.ui @@ -1,19 +1,29 @@ <ui version="4.0" > <class>formSigmod</class> <widget class="QWidget" name="formSigmod" > - <layout class="QVBoxLayout" > - <item> - <widget class="KTabWidget" name="notebookSigmod" > - <widget class="QWidget" name="tabGeneral" > + <layout class="QGridLayout" > + <item row="0" column="0" > + <widget class="KTabWidget" > + <widget class="QWidget" > <attribute name="title" > <string comment="Label for general information about the sigmod" >General</string> </attribute> - <layout class="QVBoxLayout" > - <item> - <widget class="QGroupBox" name="boxTitle" > - <property name="title" > - <string comment="Label for the title of the sigmod" >Title</string> + <layout class="QGridLayout" > + <item row="0" column="0" > + <widget class="QLabel" name="labelTitle" > + <property name="text" > + <string comment="Label for the title of the sigmod" >Title:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>varTitle</cstring> </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="KLineEdit" name="varTitle" > <property name="toolTip" > <string>The title of the Sigmod</string> </property> @@ -23,22 +33,26 @@ <property name="whatsThis" > <string>The title of the Sigmod</string> </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KLineEdit" name="varTitle" > - <property name="showClearButton" stdset="0" > - <bool>true</bool> - </property> - </widget> - </item> - </layout> + <property name="showClearButton" stdset="0" > + <bool>true</bool> + </property> </widget> </item> - <item> - <widget class="QGroupBox" name="boxVersion" > - <property name="title" > - <string>Version</string> + <item row="1" column="0" > + <widget class="QLabel" name="labelVersion" > + <property name="text" > + <string>Version:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignVCenter</set> </property> + <property name="buddy" > + <cstring>varVersion</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="KLineEdit" name="varVersion" > <property name="toolTip" > <string>Sigmod version</string> </property> @@ -48,22 +62,26 @@ <property name="whatsThis" > <string>Sigmod version</string> </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KLineEdit" name="varVersion" > - <property name="showClearButton" stdset="0" > - <bool>true</bool> - </property> - </widget> - </item> - </layout> + <property name="showClearButton" stdset="0" > + <bool>true</bool> + </property> </widget> </item> - <item> - <widget class="QGroupBox" name="boxDescription" > - <property name="title" > - <string>Description</string> + <item row="2" column="0" > + <widget class="QLabel" name="labelDescription" > + <property name="text" > + <string>Description:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>varDescription</cstring> </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="KLineEdit" name="varDescription" > <property name="toolTip" > <string>Description of the Sigmod</string> </property> @@ -73,25 +91,26 @@ <property name="whatsThis" > <string>Description of the Sigmod</string> </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KLineEdit" name="varDescription" > - <property name="showClearButton" stdset="0" > - <bool>true</bool> - </property> - </widget> - </item> - </layout> + <property name="showClearButton" stdset="0" > + <bool>true</bool> + </property> </widget> </item> - <item> - <widget class="QGroupBox" name="varSinglePlayer" > - <property name="title" > - <string>Single Player</string> + <item row="3" column="0" > + <widget class="QLabel" name="labelSinglePlayer" > + <property name="text" > + <string>Single player:</string> </property> - <property name="checkable" > - <bool>true</bool> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignVCenter</set> </property> + <property name="buddy" > + <cstring>varSinglePlayer</cstring> + </property> + </widget> + </item> + <item row="3" column="1" > + <widget class="QCheckBox" name="varSinglePlayer" > <property name="toolTip" > <string>Whether the Sigmod is meant to be played as a single player game or as a MMO</string> </property> @@ -101,85 +120,44 @@ <property name="whatsThis" > <string>Whether the Sigmod is meant to be played as a single player game or as a MMO</string> </property> + <property name="text" > + <string>Single player sigmod</string> + </property> </widget> </item> - <item> - <widget class="QGroupBox" name="boxStartPosition" > + <item row="4" column="0" colspan="2" > + <widget class="QGroupBox" name="boxStartScript" > <property name="title" > - <string>Start Position</string> + <string>Start Script</string> </property> - <property name="toolTip" > - <string>Where the player starts the game</string> - </property> - <property name="statusTip" > - <string>Where the player starts the game</string> - </property> - <property name="whatsThis" > - <string>Where the player starts the game</string> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="KComboBox" name="varMap" > + <layout class="QGridLayout" > + <item row="0" column="0" > + <widget class="Sigmodr::ScriptWidget" name="varStartScript" > <property name="toolTip" > - <string>Map the player starts on</string> + <string>The script that is executed when the sigmod begins</string> </property> <property name="statusTip" > - <string>Map the player starts on</string> + <string>The script that is executed when the sigmod begins</string> </property> <property name="whatsThis" > - <string>Map the player starts on</string> + <string>The script that is executed when the sigmod begins</string> </property> </widget> </item> - <item> - <widget class="QGroupBox" name="boxWarp" > - <property name="title" > - <string>Warp</string> - </property> - <layout class="QHBoxLayout" > - <item> - <widget class="KComboBox" name="varWarp" > - <property name="toolTip" > - <string>Warp the player starts on</string> - </property> - <property name="statusTip" > - <string>Warp the player starts on</string> - </property> - <property name="whatsThis" > - <string>Warp the player starts on</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> </layout> </widget> </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" > - <size> - <width>0</width> - <height>1</height> - </size> - </property> - </spacer> - </item> </layout> </widget> - <widget class="QWidget" name="tabTypechart" > + <widget class="QWidget" > <attribute name="title" > <string>Typechart</string> </attribute> - <layout class="QVBoxLayout" > - <item> + <layout class="QGridLayout" > + <item row="0" column="0" colspan="2" > <widget class="QTableView" name="varTypechart" > <property name="sizePolicy" > - <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > + <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -198,26 +176,40 @@ </property> </widget> </item> - <item> - <widget class="QGroupBox" name="boxEffectiveness" > - <layout class="QVBoxLayout" > - <item> - <widget class="Sigmodr::FractionWidget" name="varEffectiveness" > - <property name="toolTip" > - <string>Multiplier for attacks of the attacking type against the defending type</string> - </property> - <property name="statusTip" > - <string>Multiplier for attacks of the attacking type against the defending type</string> - </property> - <property name="whatsThis" > - <string>Multiplier for attacks of the attacking type against the defending type</string> - </property> - <property name="behavior" > - <enum>Sigmodr::FractionWidget::Any</enum> - </property> - </widget> - </item> - </layout> + <item row="2" column="0" colspan="2" > + <widget class="QLabel" name="labelTypes" > + <property name="alignment" > + <set>Qt::AlignHCenter|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="labelEffectiveness" > + <property name="text" > + <string>Effectiveness:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>varEffectiveness</cstring> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="Sigmodr::FractionWidget" name="varEffectiveness" > + <property name="toolTip" > + <string>Multiplier for attacks of the attacking type against the defending type</string> + </property> + <property name="statusTip" > + <string>Multiplier for attacks of the attacking type against the defending type</string> + </property> + <property name="whatsThis" > + <string>Multiplier for attacks of the attacking type against the defending type</string> + </property> + <property name="behavior" > + <enum>Sigmodr::FractionWidget::Any</enum> + </property> </widget> </item> </layout> @@ -253,7 +245,21 @@ <extends>QWidget</extends> <header>FractionWidget.h</header> </customwidget> + <customwidget> + <class>Sigmodr::ScriptWidget</class> + <extends>QWidget</extends> + <header>ScriptWidget.h</header> + </customwidget> </customwidgets> + <tabstops> + <tabstop>varTitle</tabstop> + <tabstop>varVersion</tabstop> + <tabstop>varDescription</tabstop> + <tabstop>varSinglePlayer</tabstop> + <tabstop>varStartScript</tabstop> + <tabstop>varTypechart</tabstop> + <tabstop>varEffectiveness</tabstop> + </tabstops> <resources/> <connections/> </ui> diff --git a/sigscript/SigmodWrapper.cpp b/sigscript/SigmodWrapper.cpp index 88969686..9290a728 100644 --- a/sigscript/SigmodWrapper.cpp +++ b/sigscript/SigmodWrapper.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * Copyright 2008-2009 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 @@ -229,9 +229,9 @@ bool Sigscript::SigmodWrapper::singlePlayer() const return m_sigmod->singlePlayer(); } -Sigscript::MapWarpWrapper* Sigscript::SigmodWrapper::startWarp() +Sigcore::Script Sigscript::SigmodWrapper::startScript() { - return map(m_sigmod->startMap())->warp(m_sigmod->startWarp()); + return m_sigmod->startScript(); } Sigcore::Fraction Sigscript::SigmodWrapper::effectiveness(const TypeWrapper* attacker, const TypeWrapper* defender) const diff --git a/sigscript/SigmodWrapper.h b/sigscript/SigmodWrapper.h index 04cb66be..92d098af 100644 --- a/sigscript/SigmodWrapper.h +++ b/sigscript/SigmodWrapper.h @@ -1,5 +1,5 @@ /* - * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * Copyright 2008-2009 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 @@ -94,7 +94,7 @@ class SIGSCRIPT_EXPORT SigmodWrapper : public ObjectWrapper Q_SCRIPTABLE QString version() const; Q_SCRIPTABLE QString description() const; Q_SCRIPTABLE bool singlePlayer() const; - Q_SCRIPTABLE MapWarpWrapper* startWarp(); + Q_SCRIPTABLE Sigcore::Script startScript(); Q_SCRIPTABLE Sigcore::Fraction effectiveness(const TypeWrapper* attacker, const TypeWrapper* defender) const; Q_SCRIPTABLE RulesWrapper* rules(); |
