Page tree

This page has not yet been translated to English.

Skip to end of metadata
Go to start of metadata

Generating source code to work wth game data.

Charon.exe GENERATE CSHARPCODE --dataBase "c:\my app\gamedata.json" --namespace "MyGame.GameParameters" --output "c:\my app\gamedata.cs"

You can save templates for code generation for further editing and expansion. Code can be generated using this templates by Visual Studio, MonoDevelop or stand-alone utility.

Command parameters

Parameter

Type

Required

Description

Example

dataBase

string

yes

Path to game data file. Use quotation marks if your path contains spaces.

"c:\my app\gamedata.json"
/User/Data/gamedata.json
apiClassName

string

no

The name of the class providing access to the documents.
Default: GameData


documentClassName

string

no

Name of the base class for all entities.
Default: Document


namespace

string

no

Namespace to contain new generated types.
Example: GameParameters


options

list:

no

Source code generation parameters (see below). Use space to separate multiple parameters.

Default: HideReferences HideLocalizedStrings

LazyReferences HideReferences
128 16 1024
output

file, err, null, out, url

no

Path to the file to which source code will be written. If the file exists, it will be overwritten. The directory must already exist. Alternatively, you can use output to Standart Error, Standart Output, dev/null & URL.

Default: out.

"c:\my app\gamedata.json"
/User/Data/gamedata.json
http://example.com/gamedata.json
outputEncoding

string

no

IANA name of the encoding to use when saving source code.

Default: utf-8

ascii

Source code generation parameters

Parameter name

Value

Description

LazyReferences

1

Document references will be used when they are first addressed instead of when initially loading game data.
This may slightly increase loading speed.

HideReferences

2

Replace document reference properties with properties accessing the actual document.

HideLocalizedStrings

4

Replace properties with localized string dictionary with properties containing strings from selected localization.

SuppressDocumentClass

16

Document class will not be generated.

SuppressApiClass

32

API class will not be generated.

SuppressCollectionClass

32

ReadOnlyList<T>, ReadOnlyDictionary<Key, Value> classes will not be generated.

SuppressLocalizedStringClass

128

LocalizedString class will not be generated.

SuppressReferenceClass

256

Reference<T> class will not be generated.

SuppressDataContractAttributes

512

DataContract and DataMember attributes will not be added to generated classes.

DisableExpressions

1024

Expression classes will not be generated and Formula fields will not be parsed.

DisableJsonSerialization

2048

JSON format deserialisation classes will not be generated.

DisableBsonSerialization

4096

BSON format deserialisation classes will not be generated.

DisableMessagePackSerialization

8192

Message Pack format deserialisation classes will not be generated.

DisableXmlSerialization

16384

XML format deserialisation classes will not be generated.

Related pages