ScummVM API documentation
function.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef MEDIASTATION_MEDIASCRIPT_FUNCTION_H
23 #define MEDIASTATION_MEDIASCRIPT_FUNCTION_H
24 
25 #include "common/array.h"
26 #include "common/hashmap.h"
27 
28 #include "mediastation/clients.h"
29 #include "mediastation/datafile.h"
30 #include "mediastation/mediascript/codechunk.h"
31 
32 namespace MediaStation {
33 
35 public:
36  ScriptFunction(Chunk &chunk);
37  ~ScriptFunction();
38 
40 
41  uint _contextId = 0;
42  uint _id = 0;
43 
44 private:
45  CodeChunk *_code = nullptr;
46 };
47 
49 public:
50  FunctionManager() {};
51  virtual ~FunctionManager();
52 
53  virtual bool attemptToReadFromStream(Chunk &chunk, uint sectionType) override;
54  ScriptValue call(uint functionId, Common::Array<ScriptValue> &args);
55  void deleteFunctionsForContext(uint contextId);
56 
57  ScriptValue script_Random(Common::Array<ScriptValue> &args);
58 
59 private:
61 };
62 
63 } // End of namespace MediaStation
64 
65 #endif
Definition: actor.h:33
Definition: function.h:34
Definition: datafile.h:102
Definition: function.h:48
Definition: codechunk.h:33
Definition: clients.h:29
Definition: hashmap.h:85
Definition: scriptvalue.h:36