C# Code Generator

Currently I've been working on expanding my reflection system to also include code generation. Below are some examples of the source c++ code and the generated c# code.

 Declaration of Camera Component Class.

Declaration of Camera Component Class.

 A Few of the Camera component's member variables.

A Few of the Camera component's member variables.

 The generated C# code used to access the member variables from script code.

The generated C# code used to access the member variables from script code.

 A Struct declared in c++ that will be exported to the C#.

A Struct declared in c++ that will be exported to the C#.

 The generated C# struct for "GameTime".

The generated C# struct for "GameTime".

 Functions declared in C++ that will be exported and callable from C#.

Functions declared in C++ that will be exported and callable from C#.

TimeOfDayComponent_C#.PNG

The generated C# code for "CTimeOfDayComponent".

Currently the code generation and reflection system supports four types; Classes, Structs, functions, and enums. Classes that require reflection will be prefixed with the "BlackClass" macro, while structs have "BlackStruct". Both of these types must contain a "BLACK_TYPEINFO" macro for the generated typeinfo. Enums are prefixed with "BlackEnum", Functions "BlackFunction" , and lastly properties "BlackProperty". Any Class, Struct, or Enum that must be exported to script code must contain the "ScriptExport" meta data. Properties and functions are more diverse in their options. Properties contain three types of meta data for script export. They can be readable "ScriptReadOnly" , writable "ScriptWriteOnly", or both "ScriptReadWritable". Functions may be callable from code, using the meta "ScriptCallable"  or implementable in script "ScriptImplementable".