Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 924 Bytes

node_API.md

File metadata and controls

47 lines (30 loc) · 924 Bytes

Node API

The node API allows one to spawn the initial actors. See this example: main.c

Functions

thorium_node_init

void thorium_node_init(struct thorium_node *node, int *argc, char ***argv);

Initialize a node.

thorium_node_spawn

int thorium_node_spawn(struct thorium_node *node, int script);

Spawn an actor. This is usually used to spawn the first actor of a node. Actors spawned with this function will receive a message with tag ACTION_START.

thorium_node_add_script

void thorium_node_add_script(struct thorium_node *node, int name, struct thorium_script *script);

Add a script which describe the behavior of an actor (like in a movie).

thorium_node_run

void thorium_node_run(struct thorium_node *node);

Run a node.

thorium_node_destroy

void thorium_node_destroy(struct thorium_node *node);

Destroy a node