Type Definition vibha::GameInitFn [] [src]

type GameInitFn = unsafe extern "C" fn(_: u64) -> *mut c_void;

Initializes a game session.

The argument passed is expected to be used as an RNG seed of some sort. If your game has no randomization at all it can be ignored, but otherwise you should use this seed in place of any other seed source.

Returns a pointer to the game data, which is then passed along to the other two functions of the DLL. If the game somehow couldn't be initialized you can return a null pointer instead.

Your game DLL should store all data for the game within the game data structure. It should not use globals of any kind. This way the driving program can run more than one session of the game at the same time (eg: a single bot that runs a different session of the game for each player that PMs it).