script_info.hpp

Go to the documentation of this file.
00001 /* $Id$ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * OpenTTD 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, version 2.
00006  * OpenTTD 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.
00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
00008  */
00009 
00012 #ifndef SCRIPT_INFO
00013 #define SCRIPT_INFO
00014 
00015 #include "../misc/countedptr.hpp"
00016 
00017 class ScriptFileInfo : public SimpleCountedObject {
00018 public:
00019   ScriptFileInfo() :
00020     SQ_instance(NULL),
00021     main_script(NULL),
00022     author(NULL),
00023     name(NULL),
00024     short_name(NULL),
00025     description(NULL),
00026     date(NULL),
00027     instance_name(NULL),
00028     version(0),
00029     url(NULL)
00030   {}
00031   ~ScriptFileInfo();
00032 
00036   const char *GetAuthor() const { return this->author; }
00037 
00041   const char *GetName() const { return this->name; }
00042 
00046   const char *GetShortName() const { return this->short_name; }
00047 
00051   const char *GetDescription() const { return this->description; }
00052 
00056   int GetVersion() const { return this->version; }
00057 
00061   const char *GetDate() const { return this->date; }
00062 
00066   const char *GetInstanceName() const { return this->instance_name; }
00067 
00071   const char *GetURL() const { return this->url; }
00072 
00076   const char *GetMainScript() const { return this->main_script; }
00077 
00081   bool CheckMethod(const char *name) const;
00082 
00086   static SQInteger Constructor(HSQUIRRELVM vm, ScriptFileInfo *info);
00087 
00088 protected:
00089   class Squirrel *engine;
00090   HSQOBJECT *SQ_instance;
00091 private:
00092   char *main_script;
00093   const char *author;
00094   const char *name;
00095   const char *short_name;
00096   const char *description;
00097   const char *date;
00098   const char *instance_name;
00099   int version;
00100   const char *url;
00101 };
00102 
00103 #endif /* SCRIPT_INFO */

Generated on Sat Dec 26 20:06:04 2009 for OpenTTD by  doxygen 1.5.6