1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413
|
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
#ifndef S_SKIRMISH_AI_CALLBACK_H
#define S_SKIRMISH_AI_CALLBACK_H
#include "aidefines.h"
#if defined(__cplusplus)
extern "C" {
#endif
/**
* @brief Skirmish AI Callback function pointers.
* Each Skirmish AI instance will receive an instance of this struct
* in its init(skirmishAIId) function and with the SInitEvent.
*
* This struct contians only activities that leave the game state as it is,
* in spring terms: unsynced events
* Activities that change game state (-> synced events) are handled through
* AI commands, defined in AISCommands.h.
*
* The skirmishAIId passed as the first parameter to each function in this
* struct has to be the ID of the AI instance using the callback.
*/
struct SSkirmishAICallback {
/**
* Whenever an AI wants to change the engine state in any way,
* it has to call this method.
* In other words, all commands from AIs to the engine (and other AIs)
* go through this method.
*
* @param skirmishAIId the ID of the AI that sends the command
* @param toId the team number of the AI that should receive
* the command, or COMMAND_TO_ID_ENGINE if it is addressed
* to the engine
* @param commandId used on asynchronous commands, this allows the AI to
* identify a possible result event, which would come
* with the same id
* @param commandTopic unique identifier of a command
* (see COMMAND_* defines in AISCommands.h)
* @param commandData a commandTopic specific struct, which contains
* the data associated with the command
* (see *Command structs)
* @return 0: if command handling ok
* != 0: something else otherwise
*/
int (CALLING_CONV *Engine_handleCommand)(int skirmishAIId, int toId, int commandId, int commandTopic, void* commandData);
/// Returns the major engine revision number (e.g. 83)
const char* (CALLING_CONV *Engine_Version_getMajor)(int skirmishAIId);
/**
* Minor version number (e.g. "5")
* @deprecated since 4. October 2011 (pre release 83), will always return "0"
*/
const char* (CALLING_CONV *Engine_Version_getMinor)(int skirmishAIId);
/**
* Clients that only differ in patchset can still play together.
* Also demos should be compatible between patchsets.
*/
const char* (CALLING_CONV *Engine_Version_getPatchset)(int skirmishAIId);
/**
* SCM Commits version part (e.g. "" or "13")
* Number of commits since the last version tag.
* This matches the regex "[0-9]*".
*/
const char* (CALLING_CONV *Engine_Version_getCommits)(int skirmishAIId);
/**
* SCM unique identifier for the current commit.
* This matches the regex "([0-9a-f]{6})?".
*/
const char* (CALLING_CONV *Engine_Version_getHash)(int skirmishAIId);
/**
* SCM branch name (e.g. "master" or "develop")
*/
const char* (CALLING_CONV *Engine_Version_getBranch)(int skirmishAIId);
/// Additional information (compiler flags, svn revision etc.)
const char* (CALLING_CONV *Engine_Version_getAdditional)(int skirmishAIId);
/// time of build
const char* (CALLING_CONV *Engine_Version_getBuildTime)(int skirmishAIId);
/// Returns whether this is a release build of the engine
bool (CALLING_CONV *Engine_Version_isRelease)(int skirmishAIId);
/**
* The basic part of a spring version.
* This may only be used for sync-checking if IsRelease() returns true.
* @return "Major.PatchSet" or "Major.PatchSet.1"
*/
const char* (CALLING_CONV *Engine_Version_getNormal)(int skirmishAIId);
/**
* The sync relevant part of a spring version.
* This may be used for sync-checking through a simple string-equality test.
* @return "Major" or "Major.PatchSet.1-Commits-gHash Branch"
*/
const char* (CALLING_CONV *Engine_Version_getSync)(int skirmishAIId);
/**
* The verbose, human readable version.
* @return "Major.Patchset[.1-Commits-gHash Branch] (Additional)"
*/
const char* (CALLING_CONV *Engine_Version_getFull)(int skirmishAIId);
/** Returns the number of teams in this game */
int (CALLING_CONV *Teams_getSize)(int skirmishAIId);
/** Returns the number of skirmish AIs in this game */
int (CALLING_CONV *SkirmishAIs_getSize)(int skirmishAIId);
/** Returns the maximum number of skirmish AIs in any game */
int (CALLING_CONV *SkirmishAIs_getMax)(int skirmishAIId);
/**
* Returns the ID of the team controled by this Skirmish AI.
*/
int (CALLING_CONV *SkirmishAI_getTeamId)(int skirmishAIId);
/**
* Returns the number of info key-value pairs in the info map
* for this Skirmish AI.
*/
int (CALLING_CONV *SkirmishAI_Info_getSize)(int skirmishAIId);
/**
* Returns the key at index infoIndex in the info map
* for this Skirmish AI, or NULL if the infoIndex is invalid.
*/
const char* (CALLING_CONV *SkirmishAI_Info_getKey)(int skirmishAIId, int infoIndex);
/**
* Returns the value at index infoIndex in the info map
* for this Skirmish AI, or NULL if the infoIndex is invalid.
*/
const char* (CALLING_CONV *SkirmishAI_Info_getValue)(int skirmishAIId, int infoIndex);
/**
* Returns the description of the key at index infoIndex in the info map
* for this Skirmish AI, or NULL if the infoIndex is invalid.
*/
const char* (CALLING_CONV *SkirmishAI_Info_getDescription)(int skirmishAIId, int infoIndex);
/**
* Returns the value associated with the given key in the info map
* for this Skirmish AI, or NULL if not found.
*/
const char* (CALLING_CONV *SkirmishAI_Info_getValueByKey)(int skirmishAIId, const char* const key);
/**
* Returns the number of option key-value pairs in the options map
* for this Skirmish AI.
*/
int (CALLING_CONV *SkirmishAI_OptionValues_getSize)(int skirmishAIId);
/**
* Returns the key at index optionIndex in the options map
* for this Skirmish AI, or NULL if the optionIndex is invalid.
*/
const char* (CALLING_CONV *SkirmishAI_OptionValues_getKey)(int skirmishAIId, int optionIndex);
/**
* Returns the value at index optionIndex in the options map
* for this Skirmish AI, or NULL if the optionIndex is invalid.
*/
const char* (CALLING_CONV *SkirmishAI_OptionValues_getValue)(int skirmishAIId, int optionIndex);
/**
* Returns the value associated with the given key in the options map
* for this Skirmish AI, or NULL if not found.
*/
const char* (CALLING_CONV *SkirmishAI_OptionValues_getValueByKey)(int skirmishAIId, const char* const key);
/** This will end up in infolog */
void (CALLING_CONV *Log_log)(int skirmishAIId, const char* const msg);
/**
* Inform the engine of an error that happend in the interface.
* @param msg error message
* @param severety from 10 for minor to 0 for fatal
* @param die if this is set to true, the engine assumes
* the interface is in an irreparable state, and it will
* unload it immediately.
*/
void (CALLING_CONV *Log_exception)(int skirmishAIId, const char* const msg, int severety, bool die);
/** Returns '/' on posix and '\\' on windows */
char (CALLING_CONV *DataDirs_getPathSeparator)(int skirmishAIId);
/**
* This interfaces main data dir, which is where the shared library
* and the InterfaceInfo.lua file are located, e.g.:
* /usr/share/games/spring/AI/Skirmish/RAI/0.601/
*/
const char* (CALLING_CONV *DataDirs_getConfigDir)(int skirmishAIId);
/**
* This interfaces writable data dir, which is where eg logs, caches
* and learning data should be stored, e.g.:
* /home/userX/.spring/AI/Skirmish/RAI/0.601/
*/
const char* (CALLING_CONV *DataDirs_getWriteableDir)(int skirmishAIId);
/**
* Returns an absolute path which consists of:
* data-dir + Skirmish-AI-path + relative-path.
*
* example:
* input: "log/main.log", writeable, create, !dir, !common
* output: "/home/userX/.spring/AI/Skirmish/RAI/0.601/log/main.log"
* The path "/home/userX/.spring/AI/Skirmish/RAI/0.601/log/" is created,
* if it does not yet exist.
*
* @see DataDirs_Roots_locatePath
* @param path store for the resulting absolute path
* @param path_sizeMax storage size of the above
* @param writeable if true, only the writable data-dir is considered
* @param create if true, and realPath is not found, its dir structure
* is created recursively under the writable data-dir
* @param dir if true, realPath specifies a dir, which means if
* create is true, the whole path will be created,
* including the last part
* @param common if true, the version independent data-dir is formed,
* which uses "common" instead of the version, eg:
* "/home/userX/.spring/AI/Skirmish/RAI/common/..."
* @return whether the locating process was successfull
* -> the path exists and is stored in an absolute form in path
*/
bool (CALLING_CONV *DataDirs_locatePath)(int skirmishAIId, char* path, int path_sizeMax, const char* const relPath, bool writeable, bool create, bool dir, bool common);
/**
* @see locatePath()
*/
char* (CALLING_CONV *DataDirs_allocatePath)(int skirmishAIId, const char* const relPath, bool writeable, bool create, bool dir, bool common);
/** Returns the number of springs data dirs. */
int (CALLING_CONV *DataDirs_Roots_getSize)(int skirmishAIId);
/** Returns the data dir at dirIndex, which is valid between 0 and (DataDirs_Roots_getSize() - 1). */
bool (CALLING_CONV *DataDirs_Roots_getDir)(int skirmishAIId, char* path, int path_sizeMax, int dirIndex);
/**
* Returns an absolute path which consists of:
* data-dir + relative-path.
*
* example:
* input: "AI/Skirmish", writeable, create, dir
* output: "/home/userX/.spring/AI/Skirmish/"
* The path "/home/userX/.spring/AI/Skirmish/" is created,
* if it does not yet exist.
*
* @see DataDirs_locatePath
* @param path store for the resulting absolute path
* @param path_sizeMax storage size of the above
* @param relPath the relative path to find
* @param writeable if true, only the writable data-dir is considered
* @param create if true, and realPath is not found, its dir structure
* is created recursively under the writable data-dir
* @param dir if true, realPath specifies a dir, which means if
* create is true, the whole path will be created,
* including the last part
* @return whether the locating process was successfull
* -> the path exists and is stored in an absolute form in path
*/
bool (CALLING_CONV *DataDirs_Roots_locatePath)(int skirmishAIId, char* path, int path_sizeMax, const char* const relPath, bool writeable, bool create, bool dir);
char* (CALLING_CONV *DataDirs_Roots_allocatePath)(int skirmishAIId, const char* const relPath, bool writeable, bool create, bool dir);
// BEGINN misc callback functions
/**
* Returns the current game time measured in frames (the
* simulation runs at 30 frames per second at normal speed)
*
* This should not be used, as we get the frame from the SUpdateEvent.
* @deprecated
*/
int (CALLING_CONV *Game_getCurrentFrame)(int skirmishAIId);
int (CALLING_CONV *Game_getAiInterfaceVersion)(int skirmishAIId);
int (CALLING_CONV *Game_getMyTeam)(int skirmishAIId);
int (CALLING_CONV *Game_getMyAllyTeam)(int skirmishAIId);
int (CALLING_CONV *Game_getPlayerTeam)(int skirmishAIId, int playerId);
/**
* Returns the number of active teams participating
* in the currently running game.
* A return value of 6 for example, would mean that teams 0 till 5
* take part in the game.
*/
int (CALLING_CONV *Game_getTeams)(int skirmishAIId);
/**
* Returns the name of the side of a team in the game.
*
* This should not be used, as it may be "",
* and as the AI should rather rely on the units it has,
* which will lead to a more stable and versatile AI.
* @deprecated
*
* @return eg. "ARM" or "CORE"; may be "", depending on how the game was setup
*/
const char* (CALLING_CONV *Game_getTeamSide)(int skirmishAIId, int otherTeamId);
/**
* Returns the color of a team in the game.
*
* This should only be used when drawing stuff,
* and not for team-identification.
* @return the RGB color of a team, with values in [0, 255]
*/
void (CALLING_CONV *Game_getTeamColor)(int skirmishAIId, int otherTeamId, short* return_colorS3_out);
/**
* Returns the income multiplier of a team in the game.
* All the teams resource income is multiplied by this factor.
* The default value is 1.0f, the valid range is [0.0, FLOAT_MAX].
*/
float (CALLING_CONV *Game_getTeamIncomeMultiplier)(int skirmishAIId, int otherTeamId);
/// Returns the ally-team of a team
int (CALLING_CONV *Game_getTeamAllyTeam)(int skirmishAIId, int otherTeamId);
/**
* Returns the current level of a resource of another team.
* Allways works for allied teams.
* Works for all teams when cheating is enabled.
* @return current level of the requested resource of the other team, or -1.0 on an invalid request
*/
float (CALLING_CONV *Game_getTeamResourceCurrent)(int skirmishAIId, int otherTeamId, int resourceId);
/**
* Returns the current income of a resource of another team.
* Allways works for allied teams.
* Works for all teams when cheating is enabled.
* @return current income of the requested resource of the other team, or -1.0 on an invalid request
*/
float (CALLING_CONV *Game_getTeamResourceIncome)(int skirmishAIId, int otherTeamId, int resourceId);
/**
* Returns the current usage of a resource of another team.
* Allways works for allied teams.
* Works for all teams when cheating is enabled.
* @return current usage of the requested resource of the other team, or -1.0 on an invalid request
*/
float (CALLING_CONV *Game_getTeamResourceUsage)(int skirmishAIId, int otherTeamId, int resourceId);
/**
* Returns the storage capacity for a resource of another team.
* Allways works for allied teams.
* Works for all teams when cheating is enabled.
* @return storage capacity for the requested resource of the other team, or -1.0 on an invalid request
*/
float (CALLING_CONV *Game_getTeamResourceStorage)(int skirmishAIId, int otherTeamId, int resourceId);
/// Returns true, if the two supplied ally-teams are currently allied
bool (CALLING_CONV *Game_isAllied)(int skirmishAIId, int firstAllyTeamId, int secondAllyTeamId);
bool (CALLING_CONV *Game_isExceptionHandlingEnabled)(int skirmishAIId);
bool (CALLING_CONV *Game_isDebugModeEnabled)(int skirmishAIId);
int (CALLING_CONV *Game_getMode)(int skirmishAIId);
bool (CALLING_CONV *Game_isPaused)(int skirmishAIId);
float (CALLING_CONV *Game_getSpeedFactor)(int skirmishAIId);
const char* (CALLING_CONV *Game_getSetupScript)(int skirmishAIId);
/**
* Returns the categories bit field value.
* @return the categories bit field value or 0,
* in case of empty name or too many categories
* @see getCategoryName
*/
int (CALLING_CONV *Game_getCategoryFlag)(int skirmishAIId, const char* categoryName);
/**
* Returns the bitfield values of a list of category names.
* @param categoryNames space delimited list of names
* @see Game#getCategoryFlag
*/
int (CALLING_CONV *Game_getCategoriesFlag)(int skirmishAIId, const char* categoryNames);
/**
* Return the name of the category described by a category flag.
* @see Game#getCategoryFlag
*/
void (CALLING_CONV *Game_getCategoryName)(int skirmishAIId, int categoryFlag, char* name, int name_sizeMax);
/**
* This is a set of parameters that is created by SetGameRulesParam() and may change during the game.
* Each parameter is uniquely identified only by its id (which is the index in the vector).
* Parameters may or may not have a name.
* @return visible to skirmishAIId parameters.
* If cheats are enabled, this will return all parameters.
*/
int (CALLING_CONV *Game_getGameRulesParams)(int skirmishAIId, int* paramIds, int paramIds_sizeMax); //$ FETCHER:MULTI:IDs:GameRulesParam:paramIds
/**
* @return only visible to skirmishAIId parameter.
* If cheats are enabled, this will return parameter despite it's losStatus.
*/
int (CALLING_CONV *Game_getGameRulesParamByName)(int skirmishAIId, const char* rulesParamName); //$ REF:RETURN->GameRulesParam
/**
* @return only visible to skirmishAIId parameter.
* If cheats are enabled, this will return parameter despite it's losStatus.
*/
int (CALLING_CONV *Game_getGameRulesParamById)(int skirmishAIId, int rulesParamId); //$ REF:RETURN->GameRulesParam
/**
* Not every mod parameter has a name.
*/
const char* (CALLING_CONV *GameRulesParam_getName)(int skirmishAIId, int gameRulesParamId);
/**
* @return float value of parameter if it's set, 0.0 otherwise.
*/
float (CALLING_CONV *GameRulesParam_getValueFloat)(int skirmishAIId, int gameRulesParamId);
/**
* @return string value of parameter if it's set, empty string otherwise.
*/
const char* (CALLING_CONV *GameRulesParam_getValueString)(int skirmishAIId, int gameRulesParamId);
// END misc callback functions
// BEGINN Visualization related callback functions
float (CALLING_CONV *Gui_getViewRange)(int skirmishAIId);
float (CALLING_CONV *Gui_getScreenX)(int skirmishAIId);
float (CALLING_CONV *Gui_getScreenY)(int skirmishAIId);
void (CALLING_CONV *Gui_Camera_getDirection)(int skirmishAIId, float* return_posF3_out);
void (CALLING_CONV *Gui_Camera_getPosition)(int skirmishAIId, float* return_posF3_out);
// END Visualization related callback functions
// BEGINN kind of deprecated; it is recommended not to use these
// bool (CALLING_CONV *getProperty)(int skirmishAIId, int id, int property, void* dst);
// bool (CALLING_CONV *getValue)(int skirmishAIId, int id, void* dst);
// END kind of deprecated; it is recommended not to use these
// BEGINN OBJECT Cheats
/**
* Returns whether this AI may use active cheats.
*/
bool (CALLING_CONV *Cheats_isEnabled)(int skirmishAIId);
/**
* Set whether this AI may use active cheats.
*/
bool (CALLING_CONV *Cheats_setEnabled)(int skirmishAIId, bool enable);
/**
* Set whether this AI may receive cheat events.
* When enabled, you would for example get informed when enemy units are
* created, even without sensor coverage.
*/
bool (CALLING_CONV *Cheats_setEventsEnabled)(int skirmishAIId, bool enabled);
/**
* Returns whether cheats will desync if used by an AI.
* @return always true, unless we are both the host and the only client.
*/
bool (CALLING_CONV *Cheats_isOnlyPassive)(int skirmishAIId);
// END OBJECT Cheats
// BEGINN OBJECT Resource
int (CALLING_CONV *getResources)(int skirmishAIId); //$ FETCHER:MULTI:NUM:Resource
int (CALLING_CONV *getResourceByName)(int skirmishAIId, const char* resourceName); //$ REF:RETURN->Resource
const char* (CALLING_CONV *Resource_getName)(int skirmishAIId, int resourceId);
float (CALLING_CONV *Resource_getOptimum)(int skirmishAIId, int resourceId);
float (CALLING_CONV *Economy_getCurrent)(int skirmishAIId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *Economy_getIncome)(int skirmishAIId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *Economy_getUsage)(int skirmishAIId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *Economy_getStorage)(int skirmishAIId, int resourceId); //$ REF:resourceId->Resource
// END OBJECT Resource
// BEGINN OBJECT File
/** Return -1 when the file does not exist */
int (CALLING_CONV *File_getSize)(int skirmishAIId, const char* fileName);
/** Returns false when file does not exist, or the buffer is too small */
bool (CALLING_CONV *File_getContent)(int skirmishAIId, const char* fileName, void* buffer, int bufferLen);
// bool (CALLING_CONV *File_locateForReading)(int skirmishAIId, char* fileName, int fileName_sizeMax);
// bool (CALLING_CONV *File_locateForWriting)(int skirmishAIId, char* fileName, int fileName_sizeMax);
// END OBJECT File
// BEGINN OBJECT UnitDef
/**
* A UnitDef contains all properties of a unit that are specific to its type,
* for example the number and type of weapons or max-speed.
* These properties are usually fixed, and not meant to change during a game.
* The unitId is a unique id for this type of unit.
*/
int (CALLING_CONV *getUnitDefs)(int skirmishAIId, int* unitDefIds, int unitDefIds_sizeMax); //$ FETCHER:MULTI:IDs:UnitDef:unitDefIds
int (CALLING_CONV *getUnitDefByName)(int skirmishAIId, const char* unitName); //$ REF:RETURN->UnitDef
// int (CALLING_CONV *UnitDef_getId)(int skirmishAIId, int unitDefId);
/** Forces loading of the unit model */
float (CALLING_CONV *UnitDef_getHeight)(int skirmishAIId, int unitDefId);
/** Forces loading of the unit model */
float (CALLING_CONV *UnitDef_getRadius)(int skirmishAIId, int unitDefId);
const char* (CALLING_CONV *UnitDef_getName)(int skirmishAIId, int unitDefId);
const char* (CALLING_CONV *UnitDef_getHumanName)(int skirmishAIId, int unitDefId);
const char* (CALLING_CONV *UnitDef_getFileName)(int skirmishAIId, int unitDefId);
/** @deprecated */
int (CALLING_CONV *UnitDef_getAiHint)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getCobId)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getTechLevel)(int skirmishAIId, int unitDefId);
/** @deprecated */
const char* (CALLING_CONV *UnitDef_getGaia)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getUpkeep)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
/** This amount of the resource will always be created. */
float (CALLING_CONV *UnitDef_getResourceMake)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
/**
* This amount of the resource will be created when the unit is on and enough
* energy can be drained.
*/
float (CALLING_CONV *UnitDef_getMakesResource)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *UnitDef_getCost)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *UnitDef_getExtractsResource)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *UnitDef_getResourceExtractorRange)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *UnitDef_getWindResourceGenerator)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *UnitDef_getTidalResourceGenerator)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *UnitDef_getStorage)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
bool (CALLING_CONV *UnitDef_isSquareResourceExtractor)(int skirmishAIId, int unitDefId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *UnitDef_getBuildTime)(int skirmishAIId, int unitDefId);
/** This amount of auto-heal will always be applied. */
float (CALLING_CONV *UnitDef_getAutoHeal)(int skirmishAIId, int unitDefId);
/** This amount of auto-heal will only be applied while the unit is idling. */
float (CALLING_CONV *UnitDef_getIdleAutoHeal)(int skirmishAIId, int unitDefId);
/** Time a unit needs to idle before it is considered idling. */
int (CALLING_CONV *UnitDef_getIdleTime)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getPower)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getHealth)(int skirmishAIId, int unitDefId);
/**
* Returns the bit field value denoting the categories this unit is in.
* @see Game#getCategoryFlag
* @see Game#getCategoryName
*/
int (CALLING_CONV *UnitDef_getCategory)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getTurnRate)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isTurnInPlace)(int skirmishAIId, int unitDefId);
/**
* Units above this distance to goal will try to turn while keeping
* some of their speed.
* 0 to disable
*/
float (CALLING_CONV *UnitDef_getTurnInPlaceDistance)(int skirmishAIId, int unitDefId);
/**
* Units below this speed will turn in place regardless of their
* turnInPlace setting.
*/
float (CALLING_CONV *UnitDef_getTurnInPlaceSpeedLimit)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isUpright)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isCollide)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getLosRadius)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getAirLosRadius)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getLosHeight)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getRadarRadius)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getSonarRadius)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getJammerRadius)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getSonarJamRadius)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getSeismicRadius)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getSeismicSignature)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isStealth)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isSonarStealth)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isBuildRange3D)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getBuildDistance)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getBuildSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getReclaimSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getRepairSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxRepairSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getResurrectSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getCaptureSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getTerraformSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMass)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isPushResistant)(int skirmishAIId, int unitDefId);
/** Should the unit move sideways when it can not shoot? */
bool (CALLING_CONV *UnitDef_isStrafeToAttack)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMinCollisionSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getSlideTolerance)(int skirmishAIId, int unitDefId);
/**
* Build location relevant maximum steepness of the underlaying terrain.
* Used to calculate the maxHeightDif.
*/
float (CALLING_CONV *UnitDef_getMaxSlope)(int skirmishAIId, int unitDefId);
/**
* Maximum terra-form height this building allows.
* If this value is 0.0, you can only build this structure on
* totally flat terrain.
*/
float (CALLING_CONV *UnitDef_getMaxHeightDif)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMinWaterDepth)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getWaterline)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxWaterDepth)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getArmoredMultiple)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getArmorType)(int skirmishAIId, int unitDefId);
/**
* The flanking bonus indicates how much additional damage you can inflict to
* a unit, if it gets attacked from different directions.
* See the spring source code if you want to know it more precisely.
*
* @return 0: no flanking bonus
* 1: global coords, mobile
* 2: unit coords, mobile
* 3: unit coords, locked
*/
int (CALLING_CONV *UnitDef_FlankingBonus_getMode)(int skirmishAIId, int unitDefId);
/**
* The unit takes less damage when attacked from this direction.
* This encourage flanking fire.
*/
void (CALLING_CONV *UnitDef_FlankingBonus_getDir)(int skirmishAIId, int unitDefId, float* return_posF3_out);
/** Damage factor for the least protected direction */
float (CALLING_CONV *UnitDef_FlankingBonus_getMax)(int skirmishAIId, int unitDefId);
/** Damage factor for the most protected direction */
float (CALLING_CONV *UnitDef_FlankingBonus_getMin)(int skirmishAIId, int unitDefId);
/**
* How much the ability of the flanking bonus direction to move builds up each
* frame.
*/
float (CALLING_CONV *UnitDef_FlankingBonus_getMobilityAdd)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxWeaponRange)(int skirmishAIId, int unitDefId);
/** @deprecated */
const char* (CALLING_CONV *UnitDef_getType)(int skirmishAIId, int unitDefId);
const char* (CALLING_CONV *UnitDef_getTooltip)(int skirmishAIId, int unitDefId);
const char* (CALLING_CONV *UnitDef_getWreckName)(int skirmishAIId, int unitDefId);
const char* (CALLING_CONV *UnitDef_getDeathExplosion)(int skirmishAIId, int unitDefId);
const char* (CALLING_CONV *UnitDef_getSelfDExplosion)(int skirmishAIId, int unitDefId);
/**
* Returns the name of the category this unit is in.
* @see Game#getCategoryFlag
* @see Game#getCategoryName
*/
const char* (CALLING_CONV *UnitDef_getCategoryString)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToSelfD)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getSelfDCountdown)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToSubmerge)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToFly)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToMove)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToHover)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isFloater)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isBuilder)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isActivateWhenBuilt)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isOnOffable)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isFullHealthFactory)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isFactoryHeadingTakeoff)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isReclaimable)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isCapturable)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToRestore)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToRepair)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToSelfRepair)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToReclaim)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToAttack)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToPatrol)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToFight)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToGuard)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToAssist)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAssistable)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToRepeat)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToFireControl)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getFireState)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getMoveState)(int skirmishAIId, int unitDefId);
// beginn: aircraft stuff
float (CALLING_CONV *UnitDef_getWingDrag)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getWingAngle)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getDrag)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getFrontToSpeed)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getSpeedToFront)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMyGravity)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxBank)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxPitch)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getTurnRadius)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getWantedHeight)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getVerticalSpeed)(int skirmishAIId, int unitDefId);
/**
* @deprecated
*/
bool (CALLING_CONV *UnitDef_isAbleToCrash)(int skirmishAIId, int unitDefId);
/**
* @deprecated
*/
bool (CALLING_CONV *UnitDef_isHoverAttack)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAirStrafe)(int skirmishAIId, int unitDefId);
/**
* @return < 0: it can land
* >= 0: how much the unit will move during hovering on the spot
*/
float (CALLING_CONV *UnitDef_getDlHoverFactor)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxAcceleration)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxDeceleration)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxAileron)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxElevator)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMaxRudder)(int skirmishAIId, int unitDefId);
// end: aircraft stuff
/**
* The yard map defines which parts of the square a unit occupies
* can still be walked on by other units.
* Example:
* In the BA Arm T2 K-Bot lab, htere is a line in hte middle where units
* walk, otherwise they would not be able ot exit the lab once they are
* built.
* @return 0 if invalid facing or the unit has no yard-map defined,
* the size of the yard-map otherwise: getXSize() * getXSize()
*/
int (CALLING_CONV *UnitDef_getYardMap)(int skirmishAIId, int unitDefId, int facing, short* yardMap, int yardMap_sizeMax); //$ ARRAY:yardMap
int (CALLING_CONV *UnitDef_getXSize)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getZSize)(int skirmishAIId, int unitDefId);
/** @deprecated */
int (CALLING_CONV *UnitDef_getBuildAngle)(int skirmishAIId, int unitDefId);
// beginn: transports stuff
float (CALLING_CONV *UnitDef_getLoadingRadius)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getUnloadSpread)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getTransportCapacity)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getTransportSize)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getMinTransportSize)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAirBase)(int skirmishAIId, int unitDefId);
/** */
bool (CALLING_CONV *UnitDef_isFirePlatform)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getTransportMass)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getMinTransportMass)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isHoldSteady)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isReleaseHeld)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isNotTransportable)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isTransportByEnemy)(int skirmishAIId, int unitDefId);
/**
* @return 0: land unload
* 1: fly-over drop
* 2: land flood
*/
int (CALLING_CONV *UnitDef_getTransportUnloadMethod)(int skirmishAIId, int unitDefId);
/**
* Dictates fall speed of all transported units.
* This only makes sense for air transports,
* if they an drop units while in the air.
*/
float (CALLING_CONV *UnitDef_getFallSpeed)(int skirmishAIId, int unitDefId);
/** Sets the transported units FBI, overrides fallSpeed */
float (CALLING_CONV *UnitDef_getUnitFallSpeed)(int skirmishAIId, int unitDefId);
// end: transports stuff
/** If the unit can cloak */
bool (CALLING_CONV *UnitDef_isAbleToCloak)(int skirmishAIId, int unitDefId);
/** If the unit wants to start out cloaked */
bool (CALLING_CONV *UnitDef_isStartCloaked)(int skirmishAIId, int unitDefId);
/** Energy cost per second to stay cloaked when stationary */
float (CALLING_CONV *UnitDef_getCloakCost)(int skirmishAIId, int unitDefId);
/** Energy cost per second to stay cloaked when moving */
float (CALLING_CONV *UnitDef_getCloakCostMoving)(int skirmishAIId, int unitDefId);
/** If enemy unit comes within this range, decloaking is forced */
float (CALLING_CONV *UnitDef_getDecloakDistance)(int skirmishAIId, int unitDefId);
/** Use a spherical, instead of a cylindrical test? */
bool (CALLING_CONV *UnitDef_isDecloakSpherical)(int skirmishAIId, int unitDefId);
/** Will the unit decloak upon firing? */
bool (CALLING_CONV *UnitDef_isDecloakOnFire)(int skirmishAIId, int unitDefId);
/** Will the unit self destruct if an enemy comes to close? */
bool (CALLING_CONV *UnitDef_isAbleToKamikaze)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getKamikazeDist)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isTargetingFacility)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_canManualFire)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isNeedGeo)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isFeature)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isHideDamage)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isCommander)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isShowPlayerName)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToResurrect)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToCapture)(int skirmishAIId, int unitDefId);
/**
* Indicates the trajectory types supported by this unit.
*
* @return 0: (default) = only low
* 1: only high
* 2: choose
*/
int (CALLING_CONV *UnitDef_getHighTrajectoryType)(int skirmishAIId, int unitDefId);
/**
* Returns the bit field value denoting the categories this unit shall not
* chase.
* @see Game#getCategoryFlag
* @see Game#getCategoryName
*/
int (CALLING_CONV *UnitDef_getNoChaseCategory)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isLeaveTracks)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getTrackWidth)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getTrackOffset)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getTrackStrength)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getTrackStretch)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getTrackType)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isAbleToDropFlare)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getFlareReloadTime)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getFlareEfficiency)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getFlareDelay)(int skirmishAIId, int unitDefId);
void (CALLING_CONV *UnitDef_getFlareDropVector)(int skirmishAIId, int unitDefId, float* return_posF3_out);
int (CALLING_CONV *UnitDef_getFlareTime)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getFlareSalvoSize)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getFlareSalvoDelay)(int skirmishAIId, int unitDefId);
/** Only matters for fighter aircraft */
bool (CALLING_CONV *UnitDef_isAbleToLoopbackAttack)(int skirmishAIId, int unitDefId);
/**
* Indicates whether the ground will be leveled/flattened out
* after this building has been built on it.
* Only matters for buildings.
*/
bool (CALLING_CONV *UnitDef_isLevelGround)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_isUseBuildingGroundDecal)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getBuildingDecalType)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getBuildingDecalSizeX)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getBuildingDecalSizeY)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_getBuildingDecalDecaySpeed)(int skirmishAIId, int unitDefId);
/**
* Maximum flight time in seconds before the aircraft needs
* to return to an air repair bay to refuel.
*/
float (CALLING_CONV *UnitDef_getMaxFuel)(int skirmishAIId, int unitDefId);
/** Time to fully refuel the unit */
float (CALLING_CONV *UnitDef_getRefuelTime)(int skirmishAIId, int unitDefId);
/** Minimum build power of airbases that this aircraft can land on */
float (CALLING_CONV *UnitDef_getMinAirBasePower)(int skirmishAIId, int unitDefId);
/** Number of units of this type allowed simultaneously in the game */
int (CALLING_CONV *UnitDef_getMaxThisUnit)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getDecoyDef)(int skirmishAIId, int unitDefId); //$ REF:RETURN->UnitDef
bool (CALLING_CONV *UnitDef_isDontLand)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getShieldDef)(int skirmishAIId, int unitDefId); //$ REF:RETURN->WeaponDef
int (CALLING_CONV *UnitDef_getStockpileDef)(int skirmishAIId, int unitDefId); //$ REF:RETURN->WeaponDef
int (CALLING_CONV *UnitDef_getBuildOptions)(int skirmishAIId, int unitDefId, int* unitDefIds, int unitDefIds_sizeMax); //$ REF:MULTI:unitDefIds->UnitDef
int (CALLING_CONV *UnitDef_getCustomParams)(int skirmishAIId, int unitDefId, const char** keys, const char** values); //$ MAP
bool (CALLING_CONV *UnitDef_isMoveDataAvailable)(int skirmishAIId, int unitDefId); //$ AVAILABLE:MoveData
/// @deprecated
float (CALLING_CONV *UnitDef_MoveData_getMaxAcceleration)(int skirmishAIId, int unitDefId);
/// @deprecated
float (CALLING_CONV *UnitDef_MoveData_getMaxBreaking)(int skirmishAIId, int unitDefId);
/// @deprecated
float (CALLING_CONV *UnitDef_MoveData_getMaxSpeed)(int skirmishAIId, int unitDefId);
/// @deprecated
short (CALLING_CONV *UnitDef_MoveData_getMaxTurnRate)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_MoveData_getXSize)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_MoveData_getZSize)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_MoveData_getDepth)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_MoveData_getMaxSlope)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_MoveData_getSlopeMod)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_MoveData_getDepthMod)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_MoveData_getPathType)(int skirmishAIId, int unitDefId);
float (CALLING_CONV *UnitDef_MoveData_getCrushStrength)(int skirmishAIId, int unitDefId);
/** enum MoveType { Ground_Move=0, Hover_Move=1, Ship_Move=2 }; */
int (CALLING_CONV *UnitDef_MoveData_getMoveType)(int skirmishAIId, int unitDefId);
/** enum SpeedModClass { Tank=0, KBot=1, Hover=2, Ship=3 }; */
int (CALLING_CONV *UnitDef_MoveData_getSpeedModClass)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_MoveData_getTerrainClass)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_MoveData_getFollowGround)(int skirmishAIId, int unitDefId);
bool (CALLING_CONV *UnitDef_MoveData_isSubMarine)(int skirmishAIId, int unitDefId);
const char* (CALLING_CONV *UnitDef_MoveData_getName)(int skirmishAIId, int unitDefId);
int (CALLING_CONV *UnitDef_getWeaponMounts)(int skirmishAIId, int unitDefId); //$ FETCHER:MULTI:NUM:WeaponMount
const char* (CALLING_CONV *UnitDef_WeaponMount_getName)(int skirmishAIId, int unitDefId, int weaponMountId);
int (CALLING_CONV *UnitDef_WeaponMount_getWeaponDef)(int skirmishAIId, int unitDefId, int weaponMountId); //$ REF:RETURN->WeaponDef
int (CALLING_CONV *UnitDef_WeaponMount_getSlavedTo)(int skirmishAIId, int unitDefId, int weaponMountId);
void (CALLING_CONV *UnitDef_WeaponMount_getMainDir)(int skirmishAIId, int unitDefId, int weaponMountId, float* return_posF3_out);
float (CALLING_CONV *UnitDef_WeaponMount_getMaxAngleDif)(int skirmishAIId, int unitDefId, int weaponMountId);
/**
* How many seconds of fuel it costs for the owning unit to fire this weapon.
*/
float (CALLING_CONV *UnitDef_WeaponMount_getFuelUsage)(int skirmishAIId, int unitDefId, int weaponMountId);
/**
* Returns the bit field value denoting the categories this weapon should
* not target.
* @see Game#getCategoryFlag
* @see Game#getCategoryName
*/
int (CALLING_CONV *UnitDef_WeaponMount_getBadTargetCategory)(int skirmishAIId, int unitDefId, int weaponMountId);
/**
* Returns the bit field value denoting the categories this weapon should
* target, excluding all others.
* @see Game#getCategoryFlag
* @see Game#getCategoryName
*/
int (CALLING_CONV *UnitDef_WeaponMount_getOnlyTargetCategory)(int skirmishAIId, int unitDefId, int weaponMountId);
// END OBJECT UnitDef
// BEGINN OBJECT Unit
/**
* Returns the number of units a team can have, after which it can not build
* any more. It is possible that a team has more units then this value at
* some point in the game. This is possible for example with taking,
* reclaiming or capturing units.
* This value is usefull for controlling game performance, and will
* therefore often be set on games with old hardware to prevent lagging
* because of too many units.
*/
int (CALLING_CONV *Unit_getLimit)(int skirmishAIId); //$ STATIC
/**
* Returns the maximum total number of units that may exist at any one point
* in time induring the current game.
*/
int (CALLING_CONV *Unit_getMax)(int skirmishAIId); //$ STATIC
/**
* Returns all units that are not in this teams ally-team nor neutral
* and are in LOS.
* If cheats are enabled, this will return all enemies on the map.
*/
int (CALLING_CONV *getEnemyUnits)(int skirmishAIId, int* unitIds, int unitIds_sizeMax); //$ FETCHER:MULTI:IDs:Unit:unitIds
/**
* Returns all units that are not in this teams ally-team nor neutral
* and are in LOS plus they have to be located in the specified area
* of the map.
* If cheats are enabled, this will return all enemies
* in the specified area.
*/
int (CALLING_CONV *getEnemyUnitsIn)(int skirmishAIId, float* pos_posF3, float radius, int* unitIds, int unitIds_sizeMax); //$ FETCHER:MULTI:IDs:Unit:unitIds
/**
* Returns all units that are not in this teams ally-team nor neutral
* and are in under sensor coverage (sight or radar).
* If cheats are enabled, this will return all enemies on the map.
*/
int (CALLING_CONV *getEnemyUnitsInRadarAndLos)(int skirmishAIId, int* unitIds, int unitIds_sizeMax); //$ FETCHER:MULTI:IDs:Unit:unitIds
/**
* Returns all units that are in this teams ally-team, including this teams
* units.
*/
int (CALLING_CONV *getFriendlyUnits)(int skirmishAIId, int* unitIds, int unitIds_sizeMax); //$ FETCHER:MULTI:IDs:Unit:unitIds
/**
* Returns all units that are in this teams ally-team, including this teams
* units plus they have to be located in the specified area of the map.
*/
int (CALLING_CONV *getFriendlyUnitsIn)(int skirmishAIId, float* pos_posF3, float radius, int* unitIds, int unitIds_sizeMax); //$ FETCHER:MULTI:IDs:Unit:unitIds
/**
* Returns all units that are neutral and are in LOS.
*/
int (CALLING_CONV *getNeutralUnits)(int skirmishAIId, int* unitIds, int unitIds_sizeMax); //$ FETCHER:MULTI:IDs:Unit:unitIds
/**
* Returns all units that are neutral and are in LOS plus they have to be
* located in the specified area of the map.
*/
int (CALLING_CONV *getNeutralUnitsIn)(int skirmishAIId, float* pos_posF3, float radius, int* unitIds, int unitIds_sizeMax); //$ FETCHER:MULTI:IDs:Unit:unitIds
/**
* Returns all units that are of the team controlled by this AI instance. This
* list can also be created dynamically by the AI, through updating a list on
* each unit-created and unit-destroyed event.
*/
int (CALLING_CONV *getTeamUnits)(int skirmishAIId, int* unitIds, int unitIds_sizeMax); //$ FETCHER:MULTI:IDs:Unit:unitIds
/**
* Returns all units that are currently selected
* (usually only contains units if a human player
* is controlling this team as well).
*/
int (CALLING_CONV *getSelectedUnits)(int skirmishAIId, int* unitIds, int unitIds_sizeMax); //$ FETCHER:MULTI:IDs:Unit:unitIds
/**
* Returns the unit's unitdef struct from which you can read all
* the statistics of the unit, do NOT try to change any values in it.
*/
int (CALLING_CONV *Unit_getDef)(int skirmishAIId, int unitId); //$ REF:RETURN->UnitDef
/**
* This is a set of parameters that is created by SetUnitRulesParam() and may change during the game.
* Each parameter is uniquely identified only by its id (which is the index in the vector).
* Parameters may or may not have a name.
* @return visible to skirmishAIId parameters.
* If cheats are enabled, this will return all parameters.
*/
int (CALLING_CONV *Unit_getUnitRulesParams)(int skirmishAIId, int unitId, int* paramIds, int paramIds_sizeMax); //$ FETCHER:MULTI:IDs:UnitRulesParam:paramIds
/**
* @return only visible to skirmishAIId parameter.
* If cheats are enabled, this will return parameter despite it's losStatus.
*/
int (CALLING_CONV *Unit_getUnitRulesParamByName)(int skirmishAIId, int unitId, const char* rulesParamName); //$ REF:RETURN->UnitRulesParam
/**
* @return only visible to skirmishAIId parameter.
* If cheats are enabled, this will return parameter despite it's losStatus.
*/
int (CALLING_CONV *Unit_getUnitRulesParamById)(int skirmishAIId, int unitId, int rulesParamId); //$ REF:RETURN->UnitRulesParam
/**
* Not every mod parameter has a name.
*/
const char* (CALLING_CONV *Unit_UnitRulesParam_getName)(int skirmishAIId, int unitId, int unitRulesParamId);
/**
* @return float value of parameter if it's set, 0.0 otherwise.
*/
float (CALLING_CONV *Unit_UnitRulesParam_getValueFloat)(int skirmishAIId, int unitId, int unitRulesParamId);
/**
* @return string value of parameter if it's set, empty string otherwise.
*/
const char* (CALLING_CONV *Unit_UnitRulesParam_getValueString)(int skirmishAIId, int unitId, int unitRulesParamId);
int (CALLING_CONV *Unit_getTeam)(int skirmishAIId, int unitId);
int (CALLING_CONV *Unit_getAllyTeam)(int skirmishAIId, int unitId);
/**
* Indicates the units main function.
* This can be used as help for (skirmish) AIs.
*
* example:
* A unit can shoot, build and transport other units.
* To human players, it is obvious that transportation is the units
* main function, as it can transport a lot of units,
* but has only weak build- and fire-power.
* Instead of letting the AI developers write complex
* algorithms to find out the same, mod developers can set this value.
*
* @return 0: ???
* 1: ???
* 2: ???
* ...
* @deprecated
*/
int (CALLING_CONV *Unit_getAiHint)(int skirmishAIId, int unitId);
int (CALLING_CONV *Unit_getStockpile)(int skirmishAIId, int unitId);
int (CALLING_CONV *Unit_getStockpileQueued)(int skirmishAIId, int unitId);
float (CALLING_CONV *Unit_getCurrentFuel)(int skirmishAIId, int unitId);
/** The unit's max speed */
float (CALLING_CONV *Unit_getMaxSpeed)(int skirmishAIId, int unitId);
/** The furthest any weapon of the unit can fire */
float (CALLING_CONV *Unit_getMaxRange)(int skirmishAIId, int unitId);
/** The unit's max health */
float (CALLING_CONV *Unit_getMaxHealth)(int skirmishAIId, int unitId);
/** How experienced the unit is (0.0f - 1.0f) */
float (CALLING_CONV *Unit_getExperience)(int skirmishAIId, int unitId);
/** Returns the group a unit belongs to, -1 if none */
int (CALLING_CONV *Unit_getGroup)(int skirmishAIId, int unitId);
int (CALLING_CONV *Unit_getCurrentCommands)(int skirmishAIId, int unitId); //$ FETCHER:MULTI:NUM:CurrentCommand-Command
/**
* For the type of the command queue, see CCommandQueue::CommandQueueType
* in Sim/Unit/CommandAI/CommandQueue.h
*/
int (CALLING_CONV *Unit_CurrentCommand_getType)(int skirmishAIId, int unitId); //$ STATIC
/**
* For the id, see CMD_xxx codes in Sim/Unit/CommandAI/Command.h
* (custom codes can also be used)
*/
int (CALLING_CONV *Unit_CurrentCommand_getId)(int skirmishAIId, int unitId, int commandId);
short (CALLING_CONV *Unit_CurrentCommand_getOptions)(int skirmishAIId, int unitId, int commandId);
int (CALLING_CONV *Unit_CurrentCommand_getTag)(int skirmishAIId, int unitId, int commandId);
int (CALLING_CONV *Unit_CurrentCommand_getTimeOut)(int skirmishAIId, int unitId, int commandId);
int (CALLING_CONV *Unit_CurrentCommand_getParams)(int skirmishAIId, int unitId, int commandId, float* params, int params_sizeMax); //$ ARRAY:params
/** The commands that this unit can understand, other commands will be ignored */
int (CALLING_CONV *Unit_getSupportedCommands)(int skirmishAIId, int unitId); //$ FETCHER:MULTI:NUM:SupportedCommand-CommandDescription
/**
* For the id, see CMD_xxx codes in Sim/Unit/CommandAI/Command.h
* (custom codes can also be used)
*/
int (CALLING_CONV *Unit_SupportedCommand_getId)(int skirmishAIId, int unitId, int supportedCommandId);
const char* (CALLING_CONV *Unit_SupportedCommand_getName)(int skirmishAIId, int unitId, int supportedCommandId);
const char* (CALLING_CONV *Unit_SupportedCommand_getToolTip)(int skirmishAIId, int unitId, int supportedCommandId);
bool (CALLING_CONV *Unit_SupportedCommand_isShowUnique)(int skirmishAIId, int unitId, int supportedCommandId);
bool (CALLING_CONV *Unit_SupportedCommand_isDisabled)(int skirmishAIId, int unitId, int supportedCommandId);
int (CALLING_CONV *Unit_SupportedCommand_getParams)(int skirmishAIId, int unitId, int supportedCommandId, const char** params, int params_sizeMax); //$ ARRAY:params
/** The unit's current health */
float (CALLING_CONV *Unit_getHealth)(int skirmishAIId, int unitId);
float (CALLING_CONV *Unit_getSpeed)(int skirmishAIId, int unitId);
/**
* Indicate the relative power of the unit,
* used for experience calulations etc.
* This is sort of the measure of the units overall power.
*/
float (CALLING_CONV *Unit_getPower)(int skirmishAIId, int unitId);
// int (CALLING_CONV *Unit_getResourceInfos)(int skirmishAIId, int unitId); //$ FETCHER:MULTI:NUM:ResourceInfo
float (CALLING_CONV *Unit_getResourceUse)(int skirmishAIId, int unitId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *Unit_getResourceMake)(int skirmishAIId, int unitId, int resourceId); //$ REF:resourceId->Resource
void (CALLING_CONV *Unit_getPos)(int skirmishAIId, int unitId, float* return_posF3_out);
void (CALLING_CONV *Unit_getVel)(int skirmishAIId, int unitId, float* return_posF3_out);
bool (CALLING_CONV *Unit_isActivated)(int skirmishAIId, int unitId);
/** Returns true if the unit is currently being built */
bool (CALLING_CONV *Unit_isBeingBuilt)(int skirmishAIId, int unitId);
bool (CALLING_CONV *Unit_isCloaked)(int skirmishAIId, int unitId);
bool (CALLING_CONV *Unit_isParalyzed)(int skirmishAIId, int unitId);
bool (CALLING_CONV *Unit_isNeutral)(int skirmishAIId, int unitId);
/** Returns the unit's build facing (0-3) */
int (CALLING_CONV *Unit_getBuildingFacing)(int skirmishAIId, int unitId);
/** Number of the last frame this unit received an order from a player. */
int (CALLING_CONV *Unit_getLastUserOrderFrame)(int skirmishAIId, int unitId);
// END OBJECT Unit
// BEGINN OBJECT Team
bool (CALLING_CONV *Team_hasAIController)(int skirmishAIId, int teamId);
int (CALLING_CONV *getEnemyTeams)(int skirmishAIId, int* teamIds, int teamIds_sizeMax); //$ FETCHER:MULTI:IDs:Team:teamIds
int (CALLING_CONV *getAllyTeams)(int skirmishAIId, int* teamIds, int teamIds_sizeMax); //$ FETCHER:MULTI:IDs:Team:teamIds
/**
* This is a set of parameters that is created by SetTeamRulesParam() and may change during the game.
* Each parameter is uniquely identified only by its id (which is the index in the vector).
* Parameters may or may not have a name.
* @return visible to skirmishAIId parameters.
* If cheats are enabled, this will return all parameters.
*/
int (CALLING_CONV *Team_getTeamRulesParams)(int skirmishAIId, int teamId, int* paramIds, int paramIds_sizeMax); //$ FETCHER:MULTI:IDs:TeamRulesParam:paramIds
/**
* @return only visible to skirmishAIId parameter.
* If cheats are enabled, this will return parameter despite it's losStatus.
*/
int (CALLING_CONV *Team_getTeamRulesParamByName)(int skirmishAIId, int teamId, const char* rulesParamName); //$ REF:RETURN->TeamRulesParam
/**
* @return only visible to skirmishAIId parameter.
* If cheats are enabled, this will return parameter despite it's losStatus.
*/
int (CALLING_CONV *Team_getTeamRulesParamById)(int skirmishAIId, int teamId, int rulesParamId); //$ REF:RETURN->TeamRulesParam
/**
* Not every mod parameter has a name.
*/
const char* (CALLING_CONV *Team_TeamRulesParam_getName)(int skirmishAIId, int teamId, int teamRulesParamId);
/**
* @return float value of parameter if it's set, 0.0 otherwise.
*/
float (CALLING_CONV *Team_TeamRulesParam_getValueFloat)(int skirmishAIId, int teamId, int teamRulesParamId);
/**
* @return string value of parameter if it's set, empty string otherwise.
*/
const char* (CALLING_CONV *Team_TeamRulesParam_getValueString)(int skirmishAIId, int teamId, int teamRulesParamId);
// END OBJECT Team
// BEGINN OBJECT Group
int (CALLING_CONV *getGroups)(int skirmishAIId, int* groupIds, int groupIds_sizeMax); //$ FETCHER:MULTI:IDs:Group:groupIds
int (CALLING_CONV *Group_getSupportedCommands)(int skirmishAIId, int groupId); //$ FETCHER:MULTI:NUM:SupportedCommand-CommandDescription
/**
* For the id, see CMD_xxx codes in Sim/Unit/CommandAI/Command.h
* (custom codes can also be used)
*/
int (CALLING_CONV *Group_SupportedCommand_getId)(int skirmishAIId, int groupId, int supportedCommandId);
const char* (CALLING_CONV *Group_SupportedCommand_getName)(int skirmishAIId, int groupId, int supportedCommandId);
const char* (CALLING_CONV *Group_SupportedCommand_getToolTip)(int skirmishAIId, int groupId, int supportedCommandId);
bool (CALLING_CONV *Group_SupportedCommand_isShowUnique)(int skirmishAIId, int groupId, int supportedCommandId);
bool (CALLING_CONV *Group_SupportedCommand_isDisabled)(int skirmishAIId, int groupId, int supportedCommandId);
int (CALLING_CONV *Group_SupportedCommand_getParams)(int skirmishAIId, int groupId, int supportedCommandId, const char** params, int params_sizeMax); //$ ARRAY:params
/**
* For the id, see CMD_xxx codes in Sim/Unit/CommandAI/Command.h
* (custom codes can also be used)
*/
int (CALLING_CONV *Group_OrderPreview_getId)(int skirmishAIId, int groupId);
short (CALLING_CONV *Group_OrderPreview_getOptions)(int skirmishAIId, int groupId);
int (CALLING_CONV *Group_OrderPreview_getTag)(int skirmishAIId, int groupId);
int (CALLING_CONV *Group_OrderPreview_getTimeOut)(int skirmishAIId, int groupId);
int (CALLING_CONV *Group_OrderPreview_getParams)(int skirmishAIId, int groupId, float* params, int params_sizeMax); //$ ARRAY:params
bool (CALLING_CONV *Group_isSelected)(int skirmishAIId, int groupId);
// END OBJECT Group
// BEGINN OBJECT Mod
/**
* Returns the mod archive file name.
* CAUTION:
* Never use this as reference in eg. cache- or config-file names,
* as one and the same mod can be packaged in different ways.
* Use the human name instead.
* @see getHumanName()
* @deprecated
*/
const char* (CALLING_CONV *Mod_getFileName)(int skirmishAIId);
/**
* Returns the archive hash of the mod.
* Use this for reference to the mod, eg. in a cache-file, wherever human
* readability does not matter.
* This value will never be the same for two mods not having equal content.
* Tip: convert to 64 Hex chars for use in file names.
* @see getHumanName()
*/
int (CALLING_CONV *Mod_getHash)(int skirmishAIId);
/**
* Returns the human readable name of the mod, which includes the version.
* Use this for reference to the mod (including version), eg. in cache- or
* config-file names which are mod related, and wherever humans may come
* in contact with the reference.
* Be aware though, that this may contain special characters and spaces,
* and may not be used as a file name without checks and replaces.
* Alternatively, you may use the short name only, or the short name plus
* version. You should generally never use the file name.
* Tip: replace every char matching [^0-9a-zA-Z_-.] with '_'
* @see getHash()
* @see getShortName()
* @see getFileName()
* @see getVersion()
*/
const char* (CALLING_CONV *Mod_getHumanName)(int skirmishAIId);
/**
* Returns the short name of the mod, which does not include the version.
* Use this for reference to the mod in general, eg. as version independent
* reference.
* Be aware though, that this still contain special characters and spaces,
* and may not be used as a file name without checks and replaces.
* Tip: replace every char matching [^0-9a-zA-Z_-.] with '_'
* @see getVersion()
* @see getHumanName()
*/
const char* (CALLING_CONV *Mod_getShortName)(int skirmishAIId);
const char* (CALLING_CONV *Mod_getVersion)(int skirmishAIId);
const char* (CALLING_CONV *Mod_getMutator)(int skirmishAIId);
const char* (CALLING_CONV *Mod_getDescription)(int skirmishAIId);
bool (CALLING_CONV *Mod_getAllowTeamColors)(int skirmishAIId);
/**
* Should constructions without builders decay?
*/
bool (CALLING_CONV *Mod_getConstructionDecay)(int skirmishAIId);
/**
* How long until they start decaying?
*/
int (CALLING_CONV *Mod_getConstructionDecayTime)(int skirmishAIId);
/**
* How fast do they decay?
*/
float (CALLING_CONV *Mod_getConstructionDecaySpeed)(int skirmishAIId);
/**
* 0 = 1 reclaimer per feature max, otherwise unlimited
*/
int (CALLING_CONV *Mod_getMultiReclaim)(int skirmishAIId);
/**
* 0 = gradual reclaim, 1 = all reclaimed at end, otherwise reclaim in reclaimMethod chunks
*/
int (CALLING_CONV *Mod_getReclaimMethod)(int skirmishAIId);
/**
* 0 = Revert to wireframe, gradual reclaim, 1 = Subtract HP, give full metal at end, default 1
*/
int (CALLING_CONV *Mod_getReclaimUnitMethod)(int skirmishAIId);
/**
* How much energy should reclaiming a unit cost, default 0.0
*/
float (CALLING_CONV *Mod_getReclaimUnitEnergyCostFactor)(int skirmishAIId);
/**
* How much metal should reclaim return, default 1.0
*/
float (CALLING_CONV *Mod_getReclaimUnitEfficiency)(int skirmishAIId);
/**
* How much should energy should reclaiming a feature cost, default 0.0
*/
float (CALLING_CONV *Mod_getReclaimFeatureEnergyCostFactor)(int skirmishAIId);
/**
* Allow reclaiming enemies? default true
*/
bool (CALLING_CONV *Mod_getReclaimAllowEnemies)(int skirmishAIId);
/**
* Allow reclaiming allies? default true
*/
bool (CALLING_CONV *Mod_getReclaimAllowAllies)(int skirmishAIId);
/**
* How much should energy should repair cost, default 0.0
*/
float (CALLING_CONV *Mod_getRepairEnergyCostFactor)(int skirmishAIId);
/**
* How much should energy should resurrect cost, default 0.5
*/
float (CALLING_CONV *Mod_getResurrectEnergyCostFactor)(int skirmishAIId);
/**
* How much should energy should capture cost, default 0.0
*/
float (CALLING_CONV *Mod_getCaptureEnergyCostFactor)(int skirmishAIId);
/**
* 0 = all ground units cannot be transported,
* 1 = all ground units can be transported
* (mass and size restrictions still apply).
* Defaults to 1.
*/
int (CALLING_CONV *Mod_getTransportGround)(int skirmishAIId);
/**
* 0 = all hover units cannot be transported,
* 1 = all hover units can be transported
* (mass and size restrictions still apply).
* Defaults to 0.
*/
int (CALLING_CONV *Mod_getTransportHover)(int skirmishAIId);
/**
* 0 = all naval units cannot be transported,
* 1 = all naval units can be transported
* (mass and size restrictions still apply).
* Defaults to 0.
*/
int (CALLING_CONV *Mod_getTransportShip)(int skirmishAIId);
/**
* 0 = all air units cannot be transported,
* 1 = all air units can be transported
* (mass and size restrictions still apply).
* Defaults to 0.
*/
int (CALLING_CONV *Mod_getTransportAir)(int skirmishAIId);
/**
* 1 = units fire at enemies running Killed() script, 0 = units ignore such enemies
*/
int (CALLING_CONV *Mod_getFireAtKilled)(int skirmishAIId);
/**
* 1 = units fire at crashing aircrafts, 0 = units ignore crashing aircrafts
*/
int (CALLING_CONV *Mod_getFireAtCrashing)(int skirmishAIId);
/**
* 0=no flanking bonus; 1=global coords, mobile; 2=unit coords, mobile; 3=unit coords, locked
*/
int (CALLING_CONV *Mod_getFlankingBonusModeDefault)(int skirmishAIId);
/**
* miplevel for los
*/
int (CALLING_CONV *Mod_getLosMipLevel)(int skirmishAIId);
/**
* miplevel to use for airlos
*/
int (CALLING_CONV *Mod_getAirMipLevel)(int skirmishAIId);
/**
* units sightdistance will be multiplied with this, for testing purposes
*/
float (CALLING_CONV *Mod_getLosMul)(int skirmishAIId);
/**
* units airsightdistance will be multiplied with this, for testing purposes
*/
float (CALLING_CONV *Mod_getAirLosMul)(int skirmishAIId);
/**
* when underwater, units are not in LOS unless also in sonar
*/
bool (CALLING_CONV *Mod_getRequireSonarUnderWater)(int skirmishAIId);
// END OBJECT Mod
// BEGINN OBJECT Map
int (CALLING_CONV *Map_getChecksum)(int skirmishAIId);
void (CALLING_CONV *Map_getStartPos)(int skirmishAIId, float* return_posF3_out);
void (CALLING_CONV *Map_getMousePos)(int skirmishAIId, float* return_posF3_out);
bool (CALLING_CONV *Map_isPosInCamera)(int skirmishAIId, float* pos_posF3, float radius);
/**
* Returns the maps center heightmap width.
* @see getHeightMap()
*/
int (CALLING_CONV *Map_getWidth)(int skirmishAIId);
/**
* Returns the maps center heightmap height.
* @see getHeightMap()
*/
int (CALLING_CONV *Map_getHeight)(int skirmishAIId);
/**
* Returns the height for the center of the squares.
* This differs slightly from the drawn map, since
* that one uses the height at the corners.
* Note that the actual map is 8 times larger (in each dimension) and
* all other maps (slope, los, resources, etc.) are relative to the
* size of the heightmap.
*
* - do NOT modify or delete the height-map (native code relevant only)
* - index 0 is top left
* - each data position is 8*8 in size
* - the value for the full resolution position (x, z) is at index (z * width + x)
* - the last value, bottom right, is at index (width * height - 1)
*
* @see getCornersHeightMap()
*/
int (CALLING_CONV *Map_getHeightMap)(int skirmishAIId, float* heights, int heights_sizeMax); //$ ARRAY:heights
/**
* Returns the height for the corners of the squares.
* This is the same like the drawn map.
* It is one unit wider and one higher then the centers height map.
*
* - do NOT modify or delete the height-map (native code relevant only)
* - index 0 is top left
* - 4 points mark the edges of an area of 8*8 in size
* - the value for upper left corner of the full resolution position (x, z) is at index (z * width + x)
* - the last value, bottom right, is at index ((width+1) * (height+1) - 1)
*
* @see getHeightMap()
*/
int (CALLING_CONV *Map_getCornersHeightMap)(int skirmishAIId, float* cornerHeights, int cornerHeights_sizeMax); //$ ARRAY:cornerHeights
float (CALLING_CONV *Map_getMinHeight)(int skirmishAIId);
float (CALLING_CONV *Map_getMaxHeight)(int skirmishAIId);
/**
* @brief the slope map
* The values are 1 minus the y-component of the (average) facenormal of the square.
*
* - do NOT modify or delete the height-map (native code relevant only)
* - index 0 is top left
* - each data position is 2*2 in size
* - the value for the full resolution position (x, z) is at index ((z * width + x) / 2)
* - the last value, bottom right, is at index (width/2 * height/2 - 1)
*/
int (CALLING_CONV *Map_getSlopeMap)(int skirmishAIId, float* slopes, int slopes_sizeMax); //$ ARRAY:slopes
/**
* @brief the level of sight map
* gs->mapx >> losMipLevel
* A square with value zero means you do not have LOS coverage on it.
*Mod_getLosMipLevel
* - do NOT modify or delete the height-map (native code relevant only)
* - index 0 is top left
* - resolution factor (res) is min(1, 1 << Mod_getLosMipLevel())
* examples:
* + losMipLevel(0) -> res(1)
* + losMipLevel(1) -> res(2)
* + losMipLevel(2) -> res(4)
* + losMipLevel(3) -> res(8)
* - each data position is res*res in size
* - the value for the full resolution position (x, z) is at index ((z * width + x) / res)
* - the last value, bottom right, is at index (width/res * height/res - 1)
*/
int (CALLING_CONV *Map_getLosMap)(int skirmishAIId, int* losValues, int losValues_sizeMax); //$ ARRAY:losValues
/**
* @brief the radar map
* A square with value 0 means you do not have radar coverage on it.
*
* - do NOT modify or delete the height-map (native code relevant only)
* - index 0 is top left
* - each data position is 8*8 in size
* - the value for the full resolution position (x, z) is at index ((z * width + x) / 8)
* - the last value, bottom right, is at index (width/8 * height/8 - 1)
*/
int (CALLING_CONV *Map_getRadarMap)(int skirmishAIId, int* radarValues, int radarValues_sizeMax); //$ ARRAY:radarValues
/**
* @brief the radar jammer map
* A square with value 0 means you do not have radar jamming coverage.
*
* - do NOT modify or delete the height-map (native code relevant only)
* - index 0 is top left
* - each data position is 8*8 in size
* - the value for the full resolution position (x, z) is at index ((z * width + x) / 8)
* - the last value, bottom right, is at index (width/8 * height/8 - 1)
*/
int (CALLING_CONV *Map_getJammerMap)(int skirmishAIId, int* jammerValues, int jammerValues_sizeMax); //$ ARRAY:jammerValues
/**
* @brief resource maps
* This map shows the resource density on the map.
*
* - do NOT modify or delete the height-map (native code relevant only)
* - index 0 is top left
* - each data position is 2*2 in size
* - the value for the full resolution position (x, z) is at index ((z * width + x) / 2)
* - the last value, bottom right, is at index (width/2 * height/2 - 1)
*/
int (CALLING_CONV *Map_getResourceMapRaw)(int skirmishAIId, int resourceId, short* resources, int resources_sizeMax); //$ REF:resourceId->Resource ARRAY:resources
/**
* Returns positions indicating where to place resource extractors on the map.
* Only the x and z values give the location of the spots, while the y values
* represents the actual amount of resource an extractor placed there can make.
* You should only compare the y values to each other, and not try to estimate
* effective output from spots.
*/
int (CALLING_CONV *Map_getResourceMapSpotsPositions)(int skirmishAIId, int resourceId, float* spots_AposF3, int spots_AposF3_sizeMax); //$ REF:resourceId->Resource ARRAY:spots_AposF3
/**
* Returns the average resource income for an extractor on one of the evaluated positions.
*/
float (CALLING_CONV *Map_getResourceMapSpotsAverageIncome)(int skirmishAIId, int resourceId); //$ REF:resourceId->Resource
/**
* Returns the nearest resource extractor spot to a specified position out of the evaluated list.
*/
void (CALLING_CONV *Map_getResourceMapSpotsNearest)(int skirmishAIId, int resourceId, float* pos_posF3, float* return_posF3_out); //$ REF:resourceId->Resource
/**
* Returns the archive hash of the map.
* Use this for reference to the map, eg. in a cache-file, wherever human
* readability does not matter.
* This value will never be the same for two maps not having equal content.
* Tip: convert to 64 Hex chars for use in file names.
* @see getName()
*/
int (CALLING_CONV *Map_getHash)(int skirmishAIId);
/**
* Returns the name of the map.
* Use this for reference to the map, eg. in cache- or config-file names
* which are map related, wherever humans may come in contact with the reference.
* Be aware though, that this may contain special characters and spaces,
* and may not be used as a file name without checks and replaces.
* Tip: replace every char matching [^0-9a-zA-Z_-.] with '_'
* @see getHash()
* @see getHumanName()
*/
const char* (CALLING_CONV *Map_getName)(int skirmishAIId);
/**
* Returns the human readbale name of the map.
* @see getName()
*/
const char* (CALLING_CONV *Map_getHumanName)(int skirmishAIId);
/** Gets the elevation of the map at position (x, z) */
float (CALLING_CONV *Map_getElevationAt)(int skirmishAIId, float x, float z);
/** Returns what value 255 in the resource map is worth */
float (CALLING_CONV *Map_getMaxResource)(int skirmishAIId, int resourceId); //$ REF:resourceId->Resource
/** Returns extraction radius for resource extractors */
float (CALLING_CONV *Map_getExtractorRadius)(int skirmishAIId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *Map_getMinWind)(int skirmishAIId);
float (CALLING_CONV *Map_getMaxWind)(int skirmishAIId);
float (CALLING_CONV *Map_getCurWind)(int skirmishAIId);
float (CALLING_CONV *Map_getTidalStrength)(int skirmishAIId);
float (CALLING_CONV *Map_getGravity)(int skirmishAIId);
/**
* Returns all points drawn with this AIs team color,
* and additionally the ones drawn with allied team colors,
* if <code>includeAllies</code> is true.
*/
int (CALLING_CONV *Map_getPoints)(int skirmishAIId, bool includeAllies); //$ FETCHER:MULTI:NUM:Point
void (CALLING_CONV *Map_Point_getPosition)(int skirmishAIId, int pointId, float* return_posF3_out);
void (CALLING_CONV *Map_Point_getColor)(int skirmishAIId, int pointId, short* return_colorS3_out);
const char* (CALLING_CONV *Map_Point_getLabel)(int skirmishAIId, int pointId);
/**
* Returns all lines drawn with this AIs team color,
* and additionally the ones drawn with allied team colors,
* if <code>includeAllies</code> is true.
*/
int (CALLING_CONV *Map_getLines)(int skirmishAIId, bool includeAllies); //$ FETCHER:MULTI:NUM:Line
void (CALLING_CONV *Map_Line_getFirstPosition)(int skirmishAIId, int lineId, float* return_posF3_out);
void (CALLING_CONV *Map_Line_getSecondPosition)(int skirmishAIId, int lineId, float* return_posF3_out);
void (CALLING_CONV *Map_Line_getColor)(int skirmishAIId, int lineId, short* return_colorS3_out);
bool (CALLING_CONV *Map_isPossibleToBuildAt)(int skirmishAIId, int unitDefId, float* pos_posF3, int facing); //$ REF:unitDefId->UnitDef
/**
* Returns the closest position from a given position that a building can be
* built at.
* @param minDist the distance in 1/(SQUARE_SIZE * 2) = 1/16 of full map
* resolution, that the building must keep to other
* buildings; this makes it easier to keep free paths through
* a base
* @return actual map position with x, y and z all beeing positive,
* or float[3]{-1, 0, 0} if no suitable position is found.
*/
void (CALLING_CONV *Map_findClosestBuildSite)(int skirmishAIId, int unitDefId, float* pos_posF3, float searchRadius, int minDist, int facing, float* return_posF3_out); //$ REF:unitDefId->UnitDef
// BEGINN OBJECT Map
// BEGINN OBJECT FeatureDef
int (CALLING_CONV *getFeatureDefs)(int skirmishAIId, int* featureDefIds, int featureDefIds_sizeMax); //$ FETCHER:MULTI:IDs:FeatureDef:featureDefIds
// int (CALLING_CONV *FeatureDef_getId)(int skirmishAIId, int featureDefId);
const char* (CALLING_CONV *FeatureDef_getName)(int skirmishAIId, int featureDefId);
const char* (CALLING_CONV *FeatureDef_getDescription)(int skirmishAIId, int featureDefId);
const char* (CALLING_CONV *FeatureDef_getFileName)(int skirmishAIId, int featureDefId);
float (CALLING_CONV *FeatureDef_getContainedResource)(int skirmishAIId, int featureDefId, int resourceId); //$ REF:resourceId->Resource
float (CALLING_CONV *FeatureDef_getMaxHealth)(int skirmishAIId, int featureDefId);
float (CALLING_CONV *FeatureDef_getReclaimTime)(int skirmishAIId, int featureDefId);
/** Used to see if the object can be overrun by units of a certain heavyness */
float (CALLING_CONV *FeatureDef_getMass)(int skirmishAIId, int featureDefId);
bool (CALLING_CONV *FeatureDef_isUpright)(int skirmishAIId, int featureDefId);
int (CALLING_CONV *FeatureDef_getDrawType)(int skirmishAIId, int featureDefId);
const char* (CALLING_CONV *FeatureDef_getModelName)(int skirmishAIId, int featureDefId);
/**
* Used to determine whether the feature is resurrectable.
*
* @return -1: (default) only if it is the 1st wreckage of
* the UnitDef it originates from
* 0: no, never
* 1: yes, always
*/
int (CALLING_CONV *FeatureDef_getResurrectable)(int skirmishAIId, int featureDefId);
int (CALLING_CONV *FeatureDef_getSmokeTime)(int skirmishAIId, int featureDefId);
bool (CALLING_CONV *FeatureDef_isDestructable)(int skirmishAIId, int featureDefId);
bool (CALLING_CONV *FeatureDef_isReclaimable)(int skirmishAIId, int featureDefId);
bool (CALLING_CONV *FeatureDef_isBlocking)(int skirmishAIId, int featureDefId);
bool (CALLING_CONV *FeatureDef_isBurnable)(int skirmishAIId, int featureDefId);
bool (CALLING_CONV *FeatureDef_isFloating)(int skirmishAIId, int featureDefId);
bool (CALLING_CONV *FeatureDef_isNoSelect)(int skirmishAIId, int featureDefId);
bool (CALLING_CONV *FeatureDef_isGeoThermal)(int skirmishAIId, int featureDefId);
/** Name of the FeatureDef that this turns into when killed (not reclaimed). */
const char* (CALLING_CONV *FeatureDef_getDeathFeature)(int skirmishAIId, int featureDefId);
/**
* Size of the feature along the X axis - in other words: height.
* each size is 8 units
*/
int (CALLING_CONV *FeatureDef_getXSize)(int skirmishAIId, int featureDefId);
/**
* Size of the feature along the Z axis - in other words: width.
* each size is 8 units
*/
int (CALLING_CONV *FeatureDef_getZSize)(int skirmishAIId, int featureDefId);
int (CALLING_CONV *FeatureDef_getCustomParams)(int skirmishAIId, int featureDefId, const char** keys, const char** values); //$ MAP
// END OBJECT FeatureDef
// BEGINN OBJECT Feature
/**
* Returns all features currently in LOS, or all features on the map
* if cheating is enabled.
*/
int (CALLING_CONV *getFeatures)(int skirmishAIId, int* featureIds, int featureIds_sizeMax); //$ REF:MULTI:featureIds->Feature
/**
* Returns all features in a specified area that are currently in LOS,
* or all features in this area if cheating is enabled.
*/
int (CALLING_CONV *getFeaturesIn)(int skirmishAIId, float* pos_posF3, float radius, int* featureIds, int featureIds_sizeMax); //$ REF:MULTI:featureIds->Feature
int (CALLING_CONV *Feature_getDef)(int skirmishAIId, int featureId); //$ REF:RETURN->FeatureDef
float (CALLING_CONV *Feature_getHealth)(int skirmishAIId, int featureId);
float (CALLING_CONV *Feature_getReclaimLeft)(int skirmishAIId, int featureId);
void (CALLING_CONV *Feature_getPosition)(int skirmishAIId, int featureId, float* return_posF3_out);
// END OBJECT Feature
// BEGINN OBJECT WeaponDef
int (CALLING_CONV *getWeaponDefs)(int skirmishAIId); //$ FETCHER:MULTI:NUM:WeaponDef
int (CALLING_CONV *getWeaponDefByName)(int skirmishAIId, const char* weaponDefName); //$ REF:RETURN->WeaponDef
const char* (CALLING_CONV *WeaponDef_getName)(int skirmishAIId, int weaponDefId);
const char* (CALLING_CONV *WeaponDef_getType)(int skirmishAIId, int weaponDefId);
const char* (CALLING_CONV *WeaponDef_getDescription)(int skirmishAIId, int weaponDefId);
const char* (CALLING_CONV *WeaponDef_getFileName)(int skirmishAIId, int weaponDefId);
const char* (CALLING_CONV *WeaponDef_getCegTag)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getRange)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getHeightMod)(int skirmishAIId, int weaponDefId);
/** Inaccuracy of whole burst */
float (CALLING_CONV *WeaponDef_getAccuracy)(int skirmishAIId, int weaponDefId);
/** Inaccuracy of individual shots inside burst */
float (CALLING_CONV *WeaponDef_getSprayAngle)(int skirmishAIId, int weaponDefId);
/** Inaccuracy while owner moving */
float (CALLING_CONV *WeaponDef_getMovingAccuracy)(int skirmishAIId, int weaponDefId);
/** Fraction of targets move speed that is used as error offset */
float (CALLING_CONV *WeaponDef_getTargetMoveError)(int skirmishAIId, int weaponDefId);
/** Maximum distance the weapon will lead the target */
float (CALLING_CONV *WeaponDef_getLeadLimit)(int skirmishAIId, int weaponDefId);
/** Factor for increasing the leadLimit with experience */
float (CALLING_CONV *WeaponDef_getLeadBonus)(int skirmishAIId, int weaponDefId);
/** Replaces hardcoded behaviour for burnblow cannons */
float (CALLING_CONV *WeaponDef_getPredictBoost)(int skirmishAIId, int weaponDefId);
// TODO: Deprecate the following function, if no longer needed by legacy Cpp AIs
int (CALLING_CONV *WeaponDef_getNumDamageTypes)(int skirmishAIId); //$ STATIC
// DamageArray (CALLING_CONV *WeaponDef_getDamages)(int skirmishAIId, int weaponDefId);
int (CALLING_CONV *WeaponDef_Damage_getParalyzeDamageTime)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_Damage_getImpulseFactor)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_Damage_getImpulseBoost)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_Damage_getCraterMult)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_Damage_getCraterBoost)(int skirmishAIId, int weaponDefId);
// float (CALLING_CONV *WeaponDef_Damage_getType)(int skirmishAIId, int weaponDefId, int typeId);
int (CALLING_CONV *WeaponDef_Damage_getTypes)(int skirmishAIId, int weaponDefId, float* types, int types_sizeMax); //$ ARRAY:types
// int (CALLING_CONV *WeaponDef_getId)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getAreaOfEffect)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isNoSelfDamage)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getFireStarter)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getEdgeEffectiveness)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getSize)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getSizeGrowth)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getCollisionSize)(int skirmishAIId, int weaponDefId);
int (CALLING_CONV *WeaponDef_getSalvoSize)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getSalvoDelay)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getReload)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getBeamTime)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isBeamBurst)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isWaterBounce)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isGroundBounce)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getBounceRebound)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getBounceSlip)(int skirmishAIId, int weaponDefId);
int (CALLING_CONV *WeaponDef_getNumBounce)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getMaxAngle)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getUpTime)(int skirmishAIId, int weaponDefId);
int (CALLING_CONV *WeaponDef_getFlightTime)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getCost)(int skirmishAIId, int weaponDefId, int resourceId); //$ REF:resourceId->Resource
int (CALLING_CONV *WeaponDef_getProjectilesPerShot)(int skirmishAIId, int weaponDefId);
// /** The "id=" tag in the TDF */
// int (CALLING_CONV *WeaponDef_getTdfId)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isTurret)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isOnlyForward)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isFixedLauncher)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isWaterWeapon)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isFireSubmersed)(int skirmishAIId, int weaponDefId);
/** Lets a torpedo travel above water like it does below water */
bool (CALLING_CONV *WeaponDef_isSubMissile)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isTracks)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isDropped)(int skirmishAIId, int weaponDefId);
/** The weapon will only paralyze, not do real damage. */
bool (CALLING_CONV *WeaponDef_isParalyzer)(int skirmishAIId, int weaponDefId);
/** The weapon damages by impacting, not by exploding. */
bool (CALLING_CONV *WeaponDef_isImpactOnly)(int skirmishAIId, int weaponDefId);
/** Can not target anything (for example: anti-nuke, D-Gun) */
bool (CALLING_CONV *WeaponDef_isNoAutoTarget)(int skirmishAIId, int weaponDefId);
/** Has to be fired manually (by the player or an AI, example: D-Gun) */
bool (CALLING_CONV *WeaponDef_isManualFire)(int skirmishAIId, int weaponDefId);
/**
* Can intercept targetable weapons shots.
*
* example: anti-nuke
*
* @see getTargetable()
*/
int (CALLING_CONV *WeaponDef_getInterceptor)(int skirmishAIId, int weaponDefId);
/**
* Shoots interceptable projectiles.
* Shots can be intercepted by interceptors.
*
* example: nuke
*
* @see getInterceptor()
*/
int (CALLING_CONV *WeaponDef_getTargetable)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isStockpileable)(int skirmishAIId, int weaponDefId);
/**
* Range of interceptors.
*
* example: anti-nuke
*
* @see getInterceptor()
*/
float (CALLING_CONV *WeaponDef_getCoverageRange)(int skirmishAIId, int weaponDefId);
/** Build time of a missile */
float (CALLING_CONV *WeaponDef_getStockpileTime)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getIntensity)(int skirmishAIId, int weaponDefId);
/** @deprecated only relevant for visualization */
float (CALLING_CONV *WeaponDef_getThickness)(int skirmishAIId, int weaponDefId);
/** @deprecated only relevant for visualization */
float (CALLING_CONV *WeaponDef_getLaserFlareSize)(int skirmishAIId, int weaponDefId);
/** @deprecated only relevant for visualization */
float (CALLING_CONV *WeaponDef_getCoreThickness)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getDuration)(int skirmishAIId, int weaponDefId);
/** @deprecated only relevant for visualization */
int (CALLING_CONV *WeaponDef_getLodDistance)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getFalloffRate)(int skirmishAIId, int weaponDefId);
/** @deprecated only relevant for visualization */
int (CALLING_CONV *WeaponDef_getGraphicsType)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isSoundTrigger)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isSelfExplode)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isGravityAffected)(int skirmishAIId, int weaponDefId);
/**
* Per weapon high trajectory setting.
* UnitDef also has this property.
*
* @return 0: low
* 1: high
* 2: unit
*/
int (CALLING_CONV *WeaponDef_getHighTrajectory)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getMyGravity)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isNoExplode)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getStartVelocity)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getWeaponAcceleration)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getTurnRate)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getMaxVelocity)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getProjectileSpeed)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getExplosionSpeed)(int skirmishAIId, int weaponDefId);
/**
* Returns the bit field value denoting the categories this weapon should
* target, excluding all others.
* @see Game#getCategoryFlag
* @see Game#getCategoryName
*/
int (CALLING_CONV *WeaponDef_getOnlyTargetCategory)(int skirmishAIId, int weaponDefId);
/** How much the missile will wobble around its course. */
float (CALLING_CONV *WeaponDef_getWobble)(int skirmishAIId, int weaponDefId);
/** How much the missile will dance. */
float (CALLING_CONV *WeaponDef_getDance)(int skirmishAIId, int weaponDefId);
/** How high trajectory missiles will try to fly in. */
float (CALLING_CONV *WeaponDef_getTrajectoryHeight)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isLargeBeamLaser)(int skirmishAIId, int weaponDefId);
/** If the weapon is a shield rather than a weapon. */
bool (CALLING_CONV *WeaponDef_isShield)(int skirmishAIId, int weaponDefId);
/** If the weapon should be repulsed or absorbed. */
bool (CALLING_CONV *WeaponDef_isShieldRepulser)(int skirmishAIId, int weaponDefId);
/** If the shield only affects enemy projectiles. */
bool (CALLING_CONV *WeaponDef_isSmartShield)(int skirmishAIId, int weaponDefId);
/** If the shield only affects stuff coming from outside shield radius. */
bool (CALLING_CONV *WeaponDef_isExteriorShield)(int skirmishAIId, int weaponDefId);
/** If the shield should be graphically shown. */
bool (CALLING_CONV *WeaponDef_isVisibleShield)(int skirmishAIId, int weaponDefId);
/** If a small graphic should be shown at each repulse. */
bool (CALLING_CONV *WeaponDef_isVisibleShieldRepulse)(int skirmishAIId, int weaponDefId);
/** The number of frames to draw the shield after it has been hit. */
int (CALLING_CONV *WeaponDef_getVisibleShieldHitFrames)(int skirmishAIId, int weaponDefId);
/**
* Amount of the resource used per shot or per second,
* depending on the type of projectile.
*/
float (CALLING_CONV *WeaponDef_Shield_getResourceUse)(int skirmishAIId, int weaponDefId, int resourceId); //$ REF:resourceId->Resource
/** Size of shield covered area */
float (CALLING_CONV *WeaponDef_Shield_getRadius)(int skirmishAIId, int weaponDefId);
/**
* Shield acceleration on plasma stuff.
* How much will plasma be accelerated into the other direction
* when it hits the shield.
*/
float (CALLING_CONV *WeaponDef_Shield_getForce)(int skirmishAIId, int weaponDefId);
/** Maximum speed to which the shield can repulse plasma. */
float (CALLING_CONV *WeaponDef_Shield_getMaxSpeed)(int skirmishAIId, int weaponDefId);
/** Amount of damage the shield can reflect. (0=infinite) */
float (CALLING_CONV *WeaponDef_Shield_getPower)(int skirmishAIId, int weaponDefId);
/** Amount of power that is regenerated per second. */
float (CALLING_CONV *WeaponDef_Shield_getPowerRegen)(int skirmishAIId, int weaponDefId);
/**
* How much of a given resource is needed to regenerate power
* with max speed per second.
*/
float (CALLING_CONV *WeaponDef_Shield_getPowerRegenResource)(int skirmishAIId, int weaponDefId, int resourceId); //$ REF:resourceId->Resource
/** How much power the shield has when it is created. */
float (CALLING_CONV *WeaponDef_Shield_getStartingPower)(int skirmishAIId, int weaponDefId);
/** Number of frames to delay recharging by after each hit. */
int (CALLING_CONV *WeaponDef_Shield_getRechargeDelay)(int skirmishAIId, int weaponDefId);
/** The color of the shield when it is at full power. */
void (CALLING_CONV *WeaponDef_Shield_getGoodColor)(int skirmishAIId, int weaponDefId, short* return_colorS3_out);
/** The color of the shield when it is empty. */
void (CALLING_CONV *WeaponDef_Shield_getBadColor)(int skirmishAIId, int weaponDefId, short* return_colorS3_out);
/** The shields alpha value. */
short (CALLING_CONV *WeaponDef_Shield_getAlpha)(int skirmishAIId, int weaponDefId);
/**
* The type of the shield (bitfield).
* Defines what weapons can be intercepted by the shield.
*
* @see getInterceptedByShieldType()
*/
int (CALLING_CONV *WeaponDef_Shield_getInterceptType)(int skirmishAIId, int weaponDefId);
/**
* The type of shields that can intercept this weapon (bitfield).
* The weapon can be affected by shields if:
* (shield.getInterceptType() & weapon.getInterceptedByShieldType()) != 0
*
* @see getInterceptType()
*/
int (CALLING_CONV *WeaponDef_getInterceptedByShieldType)(int skirmishAIId, int weaponDefId);
/** Tries to avoid friendly units while aiming? */
bool (CALLING_CONV *WeaponDef_isAvoidFriendly)(int skirmishAIId, int weaponDefId);
/** Tries to avoid features while aiming? */
bool (CALLING_CONV *WeaponDef_isAvoidFeature)(int skirmishAIId, int weaponDefId);
/** Tries to avoid neutral units while aiming? */
bool (CALLING_CONV *WeaponDef_isAvoidNeutral)(int skirmishAIId, int weaponDefId);
/**
* If nonzero, targetting units will TryTarget at the edge of collision sphere
* (radius*tag value, [-1;1]) instead of its centre.
*/
float (CALLING_CONV *WeaponDef_getTargetBorder)(int skirmishAIId, int weaponDefId);
/**
* If greater than 0, the range will be checked in a cylinder
* (height=range*cylinderTargetting) instead of a sphere.
*/
float (CALLING_CONV *WeaponDef_getCylinderTargetting)(int skirmishAIId, int weaponDefId);
/**
* For beam-lasers only - always hit with some minimum intensity
* (a damage coeffcient normally dependent on distance).
* Do not confuse this with the intensity tag, it i completely unrelated.
*/
float (CALLING_CONV *WeaponDef_getMinIntensity)(int skirmishAIId, int weaponDefId);
/**
* Controls cannon range height boost.
*
* default: -1: automatically calculate a more or less sane value
*/
float (CALLING_CONV *WeaponDef_getHeightBoostFactor)(int skirmishAIId, int weaponDefId);
/** Multiplier for the distance to the target for priority calculations. */
float (CALLING_CONV *WeaponDef_getProximityPriority)(int skirmishAIId, int weaponDefId);
int (CALLING_CONV *WeaponDef_getCollisionFlags)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isSweepFire)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isAbleToAttackGround)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getCameraShake)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getDynDamageExp)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getDynDamageMin)(int skirmishAIId, int weaponDefId);
float (CALLING_CONV *WeaponDef_getDynDamageRange)(int skirmishAIId, int weaponDefId);
bool (CALLING_CONV *WeaponDef_isDynDamageInverted)(int skirmishAIId, int weaponDefId);
int (CALLING_CONV *WeaponDef_getCustomParams)(int skirmishAIId, int weaponDefId, const char** keys, const char** values); //$ MAP
// END OBJECT WeaponDef
bool (CALLING_CONV *Debug_GraphDrawer_isEnabled)(int skirmishAIId);
};
#if defined(__cplusplus)
} // extern "C"
#endif
#endif // S_SKIRMISH_AI_CALLBACK_H
|