world.c File Reference

#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "stage_internal.h"

Defines

#define _GNU_SOURCE
#define STG_TOKEN_MAX   64

Functions

void stg_world_set_interval_real (stg_world_t *world, unsigned int val)
void stg_world_set_interval_sim (stg_world_t *world, unsigned int val)
stg_world_t * stg_world_create_from_file (const char *worldfile_path)
stg_world_t * stg_world_create (stg_id_t id, const char *token, int sim_interval, int real_interval, double ppm, double width, double height)
void stg_world_stop (stg_world_t *world)
void stg_world_start (stg_world_t *world)
void stg_world_dimensions (stg_world_t *world, double *min_x, double *min_y, double *max_x, double *max_y)
void stg_world_destroy (stg_world_t *world)
void world_destroy_cb (gpointer world)
int stg_world_update (stg_world_t *world, int sleepflag)
stg_model_t * stg_world_get_model (stg_world_t *world, stg_id_t mid)
void stg_world_add_model (stg_world_t *world, stg_model_t *mod)
int stg_world_model_destroy (stg_world_t *world, stg_id_t model)
void add_callback_wrapper (gpointer key, gpointer value, gpointer user)
void remove_callback_wrapper (gpointer key, gpointer value, gpointer user)
void stg_world_add_property_callback (stg_world_t *world, char *propname, stg_property_callback_t callback, void *userdata)
void stg_world_remove_property_callback (stg_world_t *world, char *propname, stg_property_callback_t callback)
void stg_world_print (stg_world_t *world)
void world_print_cb (gpointer key, gpointer value, gpointer user)
stg_model_t * stg_world_model_name_lookup (stg_world_t *world, const char *name)
void stg_model_save_cb (gpointer key, gpointer data, gpointer user)
void stg_model_reload_cb (gpointer key, gpointer data, gpointer user)
void stg_world_save (stg_world_t *world)
void stg_world_reload (stg_world_t *world)

Variables

const double STG_DEFAULT_RESOLUTION = 0.02
const double STG_DEFAULT_INTERVAL_REAL = 100.0
const double STG_DEFAULT_INTERVAL_SIM = 100.0
const double STG_DEFAULT_WORLD_WIDTH = 20.0
const double STG_DEFAULT_WORLD_HEIGHT = 20.0
int _stg_quit
int _stg_disable_gui
stg_type_record_t typetable []

Define Documentation

#define _GNU_SOURCE
 

#define STG_TOKEN_MAX   64
 


Function Documentation

void stg_world_set_interval_real stg_world_t *  world,
unsigned int  val
 

void stg_world_set_interval_sim stg_world_t *  world,
unsigned int  val
 

stg_world_t* stg_world_create_from_file const char *  worldfile_path  ) 
 

typestr,

stg_world_t* stg_world_create stg_id_t  id,
const char *  token,
int  sim_interval,
int  real_interval,
double  ppm,
double  width,
double  height
 

void stg_world_stop stg_world_t *  world  ) 
 

void stg_world_start stg_world_t *  world  ) 
 

void stg_world_dimensions stg_world_t *  world,
double *  min_x,
double *  min_y,
double *  max_x,
double *  max_y
 

void stg_world_destroy stg_world_t *  world  ) 
 

void world_destroy_cb gpointer  world  ) 
 

int stg_world_update stg_world_t *  world,
int  sleepflag
 

stg_model_t* stg_world_get_model stg_world_t *  world,
stg_id_t  mid
 

void stg_world_add_model stg_world_t *  world,
stg_model_t *  mod
 

int stg_world_model_destroy stg_world_t *  world,
stg_id_t  model
 

void add_callback_wrapper gpointer  key,
gpointer  value,
gpointer  user
 

void remove_callback_wrapper gpointer  key,
gpointer  value,
gpointer  user
 

void stg_world_add_property_callback stg_world_t *  world,
char *  propname,
stg_property_callback_t  callback,
void *  userdata
 

void stg_world_remove_property_callback stg_world_t *  world,
char *  propname,
stg_property_callback_t  callback
 

void stg_world_print stg_world_t *  world  ) 
 

void world_print_cb gpointer  key,
gpointer  value,
gpointer  user
 

stg_model_t* stg_world_model_name_lookup stg_world_t *  world,
const char *  name
 

void stg_model_save_cb gpointer  key,
gpointer  data,
gpointer  user
 

void stg_model_reload_cb gpointer  key,
gpointer  data,
gpointer  user
 

void stg_world_save stg_world_t *  world  ) 
 

void stg_world_reload stg_world_t *  world  ) 
 


Variable Documentation

const double STG_DEFAULT_RESOLUTION = 0.02
 

const double STG_DEFAULT_INTERVAL_REAL = 100.0
 

const double STG_DEFAULT_INTERVAL_SIM = 100.0
 

const double STG_DEFAULT_WORLD_WIDTH = 20.0
 

const double STG_DEFAULT_WORLD_HEIGHT = 20.0
 

int _stg_quit
 

int _stg_disable_gui
 

stg_type_record_t typetable[]