16 #include "sol/sol.hpp"
42 return (min + floor(roll * (max - min + 1)));
100 new_dir =
dir_cw(new_dir);
121 char *deprecated_since)
125 if (deprecated_since !=
nullptr && replacement !=
nullptr) {
127 deprecations_category,
128 "Deprecated: lua construct \"%s\", deprecated since \"%s\", used. "
129 "Use \"%s\" instead",
130 method, deprecated_since, replacement);
131 }
else if (replacement !=
nullptr) {
132 qCWarning(deprecations_category,
133 "Deprecated: lua construct \"%s\" used. "
134 "Use \"%s\" instead",
135 method, replacement);
137 qCWarning(deprecations_category,
138 "Deprecated: lua construct \"%s\" used.", method);
const Direction * api_utilities_dir_cw(lua_State *L, Direction dir)
Next (clockwise) valid direction.
void api_utilities_log_base(sol::this_state s, int level, const char *message)
One log message.
int api_utilities_random(int min, int max)
Generate random number.
const Direction * api_utilities_opposite_dir(lua_State *L, Direction dir)
Opposite direction - validity not checked, but it's valid iff original direction is.
const Direction * api_utilities_str2dir(lua_State *L, const char *dir)
Convert text describing direction into direction.
const char * api_utilities_fc_version()
Return the version of freeciv lua script.
void api_utilities_deprecation_warning(char *method, char *replacement, char *deprecated_since)
Lua script wants to warn about use of deprecated construct.
const Direction * api_utilities_dir_ccw(lua_State *L, Direction dir)
Previous (counter-clockwise) valid direction.
const Direction * luascript_dir(enum direction8 dir)
Returns a pointer to a given value of enum direction8 (always the same address for the same value),...
void luascript_log(struct fc_lua *fcl, QtMsgType level, const char *format,...)
Print a message to the selected output handle.
struct fc_lua * luascript_get_fcl(lua_State *L)
Get the freeciv lua struct from a lua state.
#define LUASCRIPT_CHECK_STATE(L,...)
#define LUASCRIPT_CHECK_ARG_NIL(L, value, narg, type,...)
#define LUASCRIPT_CHECK(L, check, msg,...)
enum direction8 Direction
enum direction8 opposite_direction(enum direction8 dir)
Return direction that is opposite to given one.
enum direction8 dir_ccw(enum direction8 dir)
Returns the next direction counter-clock-wise.
bool is_valid_dir(enum direction8 dir)
Returns TRUE iff the given direction is a valid one.
enum direction8 dir_cw(enum direction8 dir)
Returns the next direction clock-wise.
static void static sol::state * fcl
Lua virtual machine state.
struct setting_list * level[OLEVELS_NUM]
int fc_strcasecmp(const char *str0, const char *str1)
Compare strings like strcmp(), but ignoring case.
const char * freeciv_name_version()
Return string containing both name of Freeciv21 and version.