Module Murder_generator.Export

type state = {
names : string list;

The names of each player.

language : Translation.language;

The current language. It will be ignored in outputs that are meant to return a reusable file (like a JSON file), but not for the one targetted to the final user (character sheets or tools for the game master).

date : Libutils.Date.t;

The date of the final scenario.

translation : Translation.element;

The translation objects.

generic_translation : string Translation.t;

Generic translations, defined in translations.json instead of the ones defined in the files in data/.

constructor_maps : Attribute.constructor_maps;

Informations about constructors

state : State.t;

The generated state.

}

Each function in this file takes an argument of this type. It contains all the information needed to generate any file.

type t

A type storing the state as well as other informations. This type is used thorough this file.

val process : state -> t

A function to create the information needed by the functions of this file.

val to_json : t -> string

Produce a JSON representation of the state.

val to_block : t -> 'node InOut.block

Produce a printable representation of the state.

val from_json : Driver.import_information -> string -> string -> string list * State.t

Revert to_json back to a list of names and a state. The first argument is the file name (to report errors), and the second one its actual content.

val all_production : (string * string * string * string * bool * (t -> string)) list

All the functions of this file are resumed in the following list. Each function is associated two identifiers in translations.json (one for the name and one for the description), a mime type, a boolean, and an extension. The boolean indicates whether newlines should be converted to suits the host’s operating system.

val recode : ?⁠encoding:Uutf.encoding -> string -> string

Recode a string into UTF-8, removing any trailing BOM. If the current encoding of the string is not given, it will be guessed using the first characters.