cs sdk v 1.14 released

Home  |  Product  |  Documents  |  Tutorials  |  FAQ |   Download  |   Forum |   Contacts  |   Link  


  Cross Suit

 Cross Suit SDK

 Documents
      classes
 Starting...
           Tutorials

 LUA tutorials

   Support

  Forum
  q&a

 Product parts

 Virtual File system

 Virtual Render
 Virtual Machine
   

  Demo Games

   

 3D Engine

  gvSystem(dx9)

 Link

 

 

lua_Script.h

Go to the documentation of this file.
00001 #pragma once
00002 
00003 
00004 #include "lua_sgLUA.h"
00005 
00006 class ScriptEngine;
00007 
00008 class Script 
00009 {       
00010 private:
00011 
00012         lua_State*              m_pThreadState;
00013 
00014         ScriptEngine*   m_pEngine;
00015 
00016         void ResumeScript(float fParam);
00017 
00018 public:
00019         enum ScriptState
00020         {
00021                 SS_WAITFRAME,
00022                 SS_WAITTIME,
00023                 SS_RUNNING,
00024                 SS_NOTLOADED,
00025                 SS_DONE
00026         };
00027 
00028         ScriptState             m_State;
00029         float                   m_WaitTimeStamp;        // Time to wake up
00030         int                             m_WaitFrame;            // Number of frames to wait
00031         float                   m_Time;                         // Current time
00032 
00033 public:
00034 
00035         Script(ScriptEngine* pEngine);
00036         virtual ~Script();
00037 
00038         // Called every frame to update this script
00039         virtual Script*         Update(float fElapsed);
00040 
00041         // Execute a script file
00042         virtual void            RunFile(const char* filename);
00043         virtual void            RunFillBuffer(unsigned char* fbuffer,unsigned long fsize,const char* useTag=0x00);
00044         
00045         // Reports or logs script errors
00046         virtual void            Error();
00047 
00048         Script*         m_pNext;        // linked list of running scripts
00049         //
00050         void setString(const gvStringc& variable, const gvStringc& value);
00051         void setNumber(const gvStringc& variable, int ivalue);  
00052         int getNumber(const gvStringc& variable);
00053         gvStringc getString(const gvStringc& variable);
00054         int lua_function_call(const char* funcName,const geArray<int>& variable);
00055         int garbageCollectionLua(void);
00056         Var* current_ret_lua_value;
00057 };
00058 
00059 extern Script* GetScriptObject(lua_State* l);
00060 
00061 
00062 
00063 
00064 

Copyright(C) gvSystem & GamePlus All Rights Reserved.