/* * Copyright 2008-2009 Ben Boeckel * * 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 . */ /** * \file sigcore/Script.h */ #ifndef SIGCORE_SCRIPT #define SIGCORE_SCRIPT // Sigcore includes #include "Global.h" // Qt includes #include #include namespace Sigcore { /** * \class Sigcore::Script Script.h sigcore/Script.h * \brief Class that describes a script for the game engine. */ class SIGCORE_EXPORT Script { public: /** * Constructor. * * \param interpreter The language of the script. * \param script The code for the script. */ explicit Script(const QString& interpreter = "", const QString& script = ""); /** * Set the language of the script. The default game engine uses Kross to * run the scripts. The following values are valid for Kross: * * - \b mono -- C# * - \b falcon -- Falcon * - \b javascript -- KDE JavaScript * - \b qtscript -- QtScript * - \b java -- Java * - \b lua -- Lua * - \b php -- PHP * - \b python -- Python * - \b ruby -- Ruby * * Other languages may be added in the future. * * \param interpreter The language of the script. */ void setInterpreter(const QString& interpreter); /** * * \param script The code for the script. */ void setScript(const QString& script); /** * \sa setInterpreter * * \return The language of the script. */ QString interpreter() const; /** * \sa setScript * * \return The code for the script. */ QString script() const; Script& operator=(const Script& rhs); bool operator==(const Script& rhs) const; bool operator!=(const Script& rhs) const; private: QString m_interpreter; QString m_script; }; } Q_DECLARE_METATYPE(Sigcore::Script) #endif