-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDeserializerFactory.h
More file actions
44 lines (31 loc) · 992 Bytes
/
DeserializerFactory.h
File metadata and controls
44 lines (31 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// FormulaEngine Project
// By Mike Lewis - 2016
//
// Deserialization infrastructure
//
// Provides a compact interface for loading script data
// from disk into a running ScriptWorld instance. There
// are also some utility methods for loading subsets of
// a full script file, though these methods technically
// leak abstraction details.
//
#pragma once
// Forward declarations
class FormulaParser;
class Scriptable;
class ScriptWorld;
namespace picojson {
class value;
typedef std::vector<value> array;
}
//
// Deserialization API
//
namespace DeserializerFactory {
// Primary function for deserializing script data
void LoadFileIntoScriptWorld (const char filename[], ScriptWorld * world);
// Helpers for deserializing script subsets
void LoadArrayOfEvents (const picojson::value & eventarray, ScriptWorld * world, FormulaParser * parser, Scriptable * scriptable);
void LoadArrayOfLists (const picojson::array & listarray, ScriptWorld * world, Scriptable * instance);
}