The Battle for Wesnoth  1.19.13+dev
Functions
wfl::builtins Namespace Reference

Functions

 DEFINE_WFL_FUNCTION (debug, 0, 1)
 
 DEFINE_WFL_FUNCTION (dir, 1, 1)
 
 DEFINE_WFL_FUNCTION (if, 2, -1)
 
 DEFINE_WFL_FUNCTION (switch, 3, -1)
 
 DEFINE_WFL_FUNCTION (abs, 1, 1)
 
 DEFINE_WFL_FUNCTION (min, 1, -1)
 
 DEFINE_WFL_FUNCTION (max, 1, -1)
 
 DEFINE_WFL_FUNCTION (debug_float, 2, 3)
 
 DEFINE_WFL_FUNCTION (debug_print, 1, 2)
 
 DEFINE_WFL_FUNCTION (debug_profile, 1, 2)
 
 DEFINE_WFL_FUNCTION (keys, 1, 1)
 
 DEFINE_WFL_FUNCTION (values, 1, 1)
 
 DEFINE_WFL_FUNCTION (tolist, 1, 1)
 
 DEFINE_WFL_FUNCTION (tomap, 1, 2)
 
 DEFINE_WFL_FUNCTION (substring, 2, 3)
 
 DEFINE_WFL_FUNCTION (replace, 3, 4)
 
 DEFINE_WFL_FUNCTION (replace_all, 3, 3)
 
 DEFINE_WFL_FUNCTION (starts_with, 2, 2)
 
 DEFINE_WFL_FUNCTION (ends_with, 2, 2)
 
 DEFINE_WFL_FUNCTION (insert, 3, 3)
 
 DEFINE_WFL_FUNCTION (length, 1, 1)
 
 DEFINE_WFL_FUNCTION (byte_index, 2, 2)
 
 DEFINE_WFL_FUNCTION (concatenate, 1, -1)
 
 DEFINE_WFL_FUNCTION (str_upper, 1, 1)
 
 DEFINE_WFL_FUNCTION (str_lower, 1, 1)
 
 DEFINE_WFL_FUNCTION (sin, 1, 1)
 
 DEFINE_WFL_FUNCTION (cos, 1, 1)
 
 DEFINE_WFL_FUNCTION (tan, 1, 1)
 
 DEFINE_WFL_FUNCTION (asin, 1, 1)
 
 DEFINE_WFL_FUNCTION (acos, 1, 1)
 
 DEFINE_WFL_FUNCTION (atan, 1, 2)
 
 DEFINE_WFL_FUNCTION (sqrt, 1, 1)
 
 DEFINE_WFL_FUNCTION (cbrt, 1, 1)
 
 DEFINE_WFL_FUNCTION (root, 2, 2)
 
 DEFINE_WFL_FUNCTION (log, 1, 2)
 
 DEFINE_WFL_FUNCTION (exp, 1, 1)
 
 DEFINE_WFL_FUNCTION (pi, 0, 0)
 
 DEFINE_WFL_FUNCTION (hypot, 2, 2)
 
 DEFINE_WFL_FUNCTION (index_of, 2, 2)
 
 DEFINE_WFL_FUNCTION (choose, 2, 3)
 
 DEFINE_WFL_FUNCTION (wave, 1, 1)
 
 DEFINE_WFL_FUNCTION (lerp, 3, 3)
 
 DEFINE_WFL_FUNCTION (lerp_index, 2, 2)
 
 DEFINE_WFL_FUNCTION (get_palette, 1, 1)
 
 DEFINE_WFL_FUNCTION (clamp, 3, 3)
 
 DEFINE_WFL_FUNCTION (sort, 1, 2)
 
 DEFINE_WFL_FUNCTION (reverse, 1, 1)
 
 DEFINE_WFL_FUNCTION (contains_string, 2, 2)
 
 DEFINE_WFL_FUNCTION (find_string, 2, 2)
 
 DEFINE_WFL_FUNCTION (filter, 2, 3)
 
 DEFINE_WFL_FUNCTION (find, 2, 3)
 
 DEFINE_WFL_FUNCTION (map, 2, 3)
 
 DEFINE_WFL_FUNCTION (take_while, 2, 2)
 
 DEFINE_WFL_FUNCTION (zip, 1, -1)
 
 DEFINE_WFL_FUNCTION (reduce, 2, 3)
 
 DEFINE_WFL_FUNCTION (sum, 1, 2)
 
 DEFINE_WFL_FUNCTION (head, 1, 2)
 
 DEFINE_WFL_FUNCTION (tail, 1, 2)
 
 DEFINE_WFL_FUNCTION (size, 1, 1)
 
 DEFINE_WFL_FUNCTION (null, 0, -1)
 
 DEFINE_WFL_FUNCTION (ceil, 1, 1)
 
 DEFINE_WFL_FUNCTION (round, 1, 1)
 
 DEFINE_WFL_FUNCTION (floor, 1, 1)
 
 DEFINE_WFL_FUNCTION (trunc, 1, 1)
 
 DEFINE_WFL_FUNCTION (frac, 1, 1)
 
 DEFINE_WFL_FUNCTION (sgn, 1, 1)
 
 DEFINE_WFL_FUNCTION (as_decimal, 1, 1)
 
 DEFINE_WFL_FUNCTION (loc, 2, 2)
 
 DEFINE_WFL_FUNCTION (pair, 2, 2)
 
 DEFINE_WFL_FUNCTION (distance_between, 2, 2)
 
 DEFINE_WFL_FUNCTION (nearest_loc, 2, 2)
 
 DEFINE_WFL_FUNCTION (adjacent_locs, 1, 1)
 
 DEFINE_WFL_FUNCTION (locations_in_radius, 2, 2)
 
 DEFINE_WFL_FUNCTION (are_adjacent, 2, 2)
 
 DEFINE_WFL_FUNCTION (relative_dir, 2, 2)
 
 DEFINE_WFL_FUNCTION (direction_from, 2, 3)
 
 DEFINE_WFL_FUNCTION (rotate_loc_around, 2, 3)
 
 DEFINE_WFL_FUNCTION (type, 1, 1)
 

Function Documentation

◆ DEFINE_WFL_FUNCTION() [1/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( abs  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [2/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( acos  ,
,
 
)

Definition at line 568 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [3/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( adjacent_locs  ,
,
 
)

Definition at line 1351 of file function.cpp.

References wfl::add_debug_info(), get_adjacent_tiles(), and loc.

◆ DEFINE_WFL_FUNCTION() [4/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( are_adjacent  ,
,
 
)

Definition at line 1395 of file function.cpp.

References wfl::add_debug_info(), loc, and tiles_adjacent().

◆ DEFINE_WFL_FUNCTION() [5/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( as_decimal  ,
,
 
)

Definition at line 1282 of file function.cpp.

References d.

◆ DEFINE_WFL_FUNCTION() [6/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( asin  ,
,
 
)

Definition at line 557 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [7/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( atan  ,
,
 
)

Definition at line 579 of file function.cpp.

References utf8::size().

◆ DEFINE_WFL_FUNCTION() [8/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( byte_index  ,
,
 
)

Definition at line 501 of file function.cpp.

References utf8::index().

◆ DEFINE_WFL_FUNCTION() [9/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( cbrt  ,
,
 
)

Definition at line 604 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [10/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( ceil  ,
,
 
)

Definition at line 1207 of file function.cpp.

References d.

◆ DEFINE_WFL_FUNCTION() [11/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( choose  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [12/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( clamp  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [13/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( concatenate  ,
,
1 
)

Definition at line 508 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [14/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( contains_string  ,
,
 
)

Definition at line 864 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [15/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( cos  ,
,
 
)

Definition at line 539 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [16/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( debug  ,
,
 
)

Definition at line 95 of file function.cpp.

References wfl::formula_expression::evaluate(), and utf8::size().

◆ DEFINE_WFL_FUNCTION() [17/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( debug_float  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [18/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( debug_print  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [19/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( debug_profile  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [20/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( dir  ,
,
 
)

Definition at line 117 of file function.cpp.

References wfl::variant::as_callable(), i, and wfl::formula_input::name.

◆ DEFINE_WFL_FUNCTION() [21/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( direction_from  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [22/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( distance_between  ,
,
 
)

Definition at line 1306 of file function.cpp.

References wfl::add_debug_info(), distance_between(), and loc.

◆ DEFINE_WFL_FUNCTION() [23/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( ends_with  ,
,
 
)

Definition at line 470 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [24/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( exp  ,
,
 
)

Definition at line 644 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [25/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( filter  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [26/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( find  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [27/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( find_string  ,
,
 
)

Definition at line 872 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [28/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( floor  ,
,
 
)

Definition at line 1239 of file function.cpp.

References d.

◆ DEFINE_WFL_FUNCTION() [29/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( frac  ,
,
 
)

Definition at line 1261 of file function.cpp.

References d.

◆ DEFINE_WFL_FUNCTION() [30/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( get_palette  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [31/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( head  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [32/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( hypot  ,
,
 
)

Definition at line 662 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [33/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( if  ,
,
1 
)

Definition at line 133 of file function.cpp.

References n, and utf8::size().

◆ DEFINE_WFL_FUNCTION() [34/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( index_of  ,
,
 
)

Definition at line 669 of file function.cpp.

References i, and wfl::variant::num_elements().

◆ DEFINE_WFL_FUNCTION() [35/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( insert  ,
,
 
)

Definition at line 477 of file function.cpp.

References utf8::insert().

◆ DEFINE_WFL_FUNCTION() [36/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( keys  ,
,
 
)

Definition at line 333 of file function.cpp.

References wfl::variant::get_keys().

◆ DEFINE_WFL_FUNCTION() [37/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( length  ,
,
 
)

Definition at line 496 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [38/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( lerp  ,
,
 
)

Definition at line 729 of file function.cpp.

References wfl::add_debug_info().

◆ DEFINE_WFL_FUNCTION() [39/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( lerp_index  ,
,
 
)

Definition at line 737 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [40/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( loc  ,
,
 
)

Definition at line 1290 of file function.cpp.

References wfl::add_debug_info().

◆ DEFINE_WFL_FUNCTION() [41/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( locations_in_radius  ,
,
 
)

Definition at line 1366 of file function.cpp.

References get_tiles_in_radius(), loc, and n.

◆ DEFINE_WFL_FUNCTION() [42/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( log  ,
,
 
)

Definition at line 623 of file function.cpp.

References utf8::size().

◆ DEFINE_WFL_FUNCTION() [43/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( map  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [44/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( max  ,
,
1 
)

◆ DEFINE_WFL_FUNCTION() [45/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( min  ,
,
1 
)

◆ DEFINE_WFL_FUNCTION() [46/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( nearest_loc  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [47/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( null  ,
,
1 
)

Definition at line 1196 of file function.cpp.

References i.

◆ DEFINE_WFL_FUNCTION() [48/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( pair  ,
,
 
)

Definition at line 1298 of file function.cpp.

References wfl::add_debug_info().

◆ DEFINE_WFL_FUNCTION() [49/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( pi  ,
,
 
)

Definition at line 657 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [50/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( reduce  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [51/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( relative_dir  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [52/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( replace  ,
,
 
)

Definition at line 422 of file function.cpp.

References utf8::size().

◆ DEFINE_WFL_FUNCTION() [53/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( replace_all  ,
,
 
)

Definition at line 454 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [54/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( reverse  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [55/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( root  ,
,
 
)

Definition at line 611 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [56/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( rotate_loc_around  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [57/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( round  ,
,
 
)

Definition at line 1221 of file function.cpp.

References d, and f.

◆ DEFINE_WFL_FUNCTION() [58/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( sgn  ,
,
 
)

Definition at line 1270 of file function.cpp.

References d.

◆ DEFINE_WFL_FUNCTION() [59/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( sin  ,
,
 
)

Definition at line 532 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [60/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( size  ,
,
 
)

Definition at line 1190 of file function.cpp.

References wfl::variant::num_elements().

◆ DEFINE_WFL_FUNCTION() [61/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( sort  ,
,
 
)

Definition at line 825 of file function.cpp.

References n, wfl::variant::num_elements(), and utf8::size().

◆ DEFINE_WFL_FUNCTION() [62/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( sqrt  ,
,
 
)

Definition at line 593 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [63/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( starts_with  ,
,
 
)

Definition at line 463 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [64/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( str_lower  ,
,
 
)

Definition at line 525 of file function.cpp.

References utils::views::transform.

◆ DEFINE_WFL_FUNCTION() [65/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( str_upper  ,
,
 
)

Definition at line 518 of file function.cpp.

References utils::views::transform.

◆ DEFINE_WFL_FUNCTION() [66/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( substring  ,
,
 
)

Definition at line 391 of file function.cpp.

References utf8::size().

◆ DEFINE_WFL_FUNCTION() [67/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( sum  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [68/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( switch  ,
,
1 
)

Definition at line 148 of file function.cpp.

References n, and utf8::size().

◆ DEFINE_WFL_FUNCTION() [69/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( tail  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [70/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( take_while  ,
,
 
)

Definition at line 997 of file function.cpp.

References wfl::variant::as_bool(), wfl::variant::begin(), and wfl::variant::end().

◆ DEFINE_WFL_FUNCTION() [71/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( tan  ,
,
 
)

Definition at line 546 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [72/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( tolist  ,
,
 
)

Definition at line 345 of file function.cpp.

References wfl::variant::begin(), and wfl::variant::end().

◆ DEFINE_WFL_FUNCTION() [73/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( tomap  ,
,
 
)

◆ DEFINE_WFL_FUNCTION() [74/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( trunc  ,
,
 
)

Definition at line 1253 of file function.cpp.

References d.

◆ DEFINE_WFL_FUNCTION() [75/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( type  ,
,
 
)

Definition at line 1461 of file function.cpp.

References wfl::variant::type_string().

◆ DEFINE_WFL_FUNCTION() [76/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( values  ,
,
 
)

Definition at line 339 of file function.cpp.

References wfl::variant::get_values().

◆ DEFINE_WFL_FUNCTION() [77/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( wave  ,
,
 
)

Definition at line 722 of file function.cpp.

◆ DEFINE_WFL_FUNCTION() [78/78]

wfl::builtins::DEFINE_WFL_FUNCTION ( zip  ,
,
1 
)

Definition at line 1065 of file function.cpp.

References i, output(), and utils::views::transform.