Freeciv21
Develop your civilization from humble roots to a global empire
api_common_utilities.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  part of Freeciv21. Freeciv21 is free software: you can redistribute it
4  and/or modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation, either version 3 of the
6  License, or (at your option) any later version. You should have received
7  a copy of the GNU General Public License along with Freeciv21. If not,
8  see https://www.gnu.org/licenses/.
9 **************************************************************************/
10 #pragma once
11 
12 // sol2
13 #include "sol/sol.hpp"
14 
15 /* common/scriptcore */
16 #include "luascript_types.h"
17 
18 struct lua_State;
19 
20 int api_utilities_random(int min, int max);
21 
22 const Direction *api_utilities_str2dir(lua_State *L, const char *dir);
23 const Direction *api_utilities_dir_ccw(lua_State *L, Direction dir);
24 const Direction *api_utilities_dir_cw(lua_State *L, Direction dir);
25 const Direction *api_utilities_opposite_dir(lua_State *L, Direction dir);
26 
27 const char *api_utilities_fc_version();
28 
29 void api_utilities_log_base(sol::this_state s, int level,
30  const char *message);
31 
32 void api_utilities_deprecation_warning(char *method, char *replacement,
33  char *deprecated_since);
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.
enum direction8 Direction
struct setting_list * level[OLEVELS_NUM]
Definition: settings.cpp:167