Freeciv-3.1
Loading...
Searching...
No Matches
Functions
api_common_utilities.c File Reference
#include <math.h>
#include "deprecations.h"
#include "log.h"
#include "rand.h"
#include "map.h"
#include "version.h"
#include "luascript.h"
#include "api_common_utilities.h"

Go to the source code of this file.

Functions

int api_utilities_random (lua_State *L, int min, int max)
 
const char * api_utilities_fc_version (lua_State *L)
 
void api_utilities_log_base (lua_State *L, int level, const char *message)
 
int api_utilities_direction_id (lua_State *L, Direction dir)
 
const char * api_utilities_dir2str (lua_State *L, Direction dir)
 
const Directionapi_utilities_str2dir (lua_State *L, const char *dir)
 
const Directionapi_utilities_dir_ccw (lua_State *L, Direction dir)
 
const Directionapi_utilities_dir_cw (lua_State *L, Direction dir)
 
const Directionapi_utilities_opposite_dir (lua_State *L, Direction dir)
 
void api_utilities_deprecation_warning (lua_State *L, char *method, char *replacement, char *deprecated_since)
 

Function Documentation

◆ api_utilities_deprecation_warning()

void api_utilities_deprecation_warning ( lua_State *  L,
char *  method,
char *  replacement,
char *  deprecated_since 
)

Lua script wants to warn about use of deprecated construct.

Definition at line 151 of file api_common_utilities.c.

Referenced by tolua_common_a_log_deprecation_warning00().

◆ api_utilities_dir2str()

const char * api_utilities_dir2str ( lua_State *  L,
Direction  dir 
)

Definition at line 86 of file api_common_utilities.c.

Referenced by tolua_game_Direction_properties_name00().

◆ api_utilities_dir_ccw()

const Direction * api_utilities_dir_ccw ( lua_State *  L,
Direction  dir 
)

Previous (counter-clockwise) valid direction

Definition at line 108 of file api_common_utilities.c.

Referenced by tolua_game_direction_next_ccw00().

◆ api_utilities_dir_cw()

const Direction * api_utilities_dir_cw ( lua_State *  L,
Direction  dir 
)

Next (clockwise) valid direction

Definition at line 124 of file api_common_utilities.c.

Referenced by tolua_game_direction_next_cw00().

◆ api_utilities_direction_id()

int api_utilities_direction_id ( lua_State *  L,
Direction  dir 
)

Definition at line 76 of file api_common_utilities.c.

Referenced by tolua_game_Direction_properties_id00().

◆ api_utilities_fc_version()

const char * api_utilities_fc_version ( lua_State *  L)

Return the version of freeciv lua script

Definition at line 51 of file api_common_utilities.c.

Referenced by tolua_common_a_fc_version00().

◆ api_utilities_log_base()

void api_utilities_log_base ( lua_State *  L,
int  level,
const char *  message 
)

One log message. This module is used by script_game and script_auth.

Definition at line 59 of file api_common_utilities.c.

Referenced by tolua_common_a_log_base00().

◆ api_utilities_opposite_dir()

const Direction * api_utilities_opposite_dir ( lua_State *  L,
Direction  dir 
)

Opposite direction - validity not checked, but it's valid iff original direction is.

Definition at line 141 of file api_common_utilities.c.

Referenced by tolua_game_direction_opposite00().

◆ api_utilities_random()

int api_utilities_random ( lua_State *  L,
int  min,
int  max 
)

Generate random number.

Definition at line 37 of file api_common_utilities.c.

Referenced by tolua_common_a_random00().

◆ api_utilities_str2dir()

const Direction * api_utilities_str2dir ( lua_State *  L,
const char *  dir 
)

Convert text describing direction into direction

Definition at line 97 of file api_common_utilities.c.

Referenced by tolua_game_direction_str2dir00(), and tolua_game_find_direction00().