diff --git a/.gitattributes b/.gitattributes index 412eeda..dfe0770 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,22 +1,2 @@ # Auto detect text files and perform LF normalization * text=auto - -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index a002c3b..273534c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,238 +1,29 @@ -.idea/** -javadoc/** -*.pdb -*.zip - -################# -## Eclipse -################# - -*.pydevproject -.project -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results - -[Dd]ebug/ -[Rr]elease/ -x64/ -build/ -[Bb]in/ -[Oo]bj/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.log -*.scc - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -.*crunch*.local.xml - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.Publish.xml -*.pubxml - -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ - -# Windows Azure Build Output -csx -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.[Pp]ublish.xml -*.pfx -*.publishsettings - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - -############# -## Windows detritus -############# - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Mac crap .DS_Store - - -############# -## Python -############# - -*.py[co] - -# Packages -*.egg -*.egg-info -dist/ build/ -eggs/ -parts/ -var/ -sdist/ -develop-eggs/ -.installed.cfg - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox - -#Translations -*.mo - -#Mr Developer -.mr.developer.cfg -*.log -*.lib -*.exp -x86/** -out/** - -META-INF/** -bwapi-master/ -bwta-c/ -c/ -compiled/ -compiled4/ -concat_header.h -concat_header4.h -generated/ -headers/ -headers4/ - +out/ +target/ +.idea/ +.settings/ +/output +/bwapi_bridge/Debug/ +/bwapi_bridge/Release/ +/bwmirror/*.dll +/bwmirror/bwapi-data/ +/bwmirror/src/main/java/bwapi +/bwmirror/src/main/java/bwta +/bwmirror/src/main/resources/bwapi_bridge*.dll +.project +.classpath +*.iml +*.eml +*.ipr +*.iws +*.class +*.jar +*.sdf +*.opensdf +*.user +*.suo +*.idb +*.ilk +*.pdb diff --git a/InvokeGenerator.iml b/InvokeGenerator.iml deleted file mode 100644 index c9fa829..0000000 --- a/InvokeGenerator.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..02bbb60 --- /dev/null +++ b/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 7244cfa..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,167 +0,0 @@ - - -
GNU Lesser General Public License
-=================================
-
-Version 3, 29 June 2007
-
-Copyright &copy; 2007 Free Software Foundation, Inc. &lt;<http://fsf.org/>&gt;
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-
-
-This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-### 0. Additional Definitions.
-
-As used herein, &ldquo;this License&rdquo; refers to version 3 of the GNU Lesser
-General Public License, and the &ldquo;GNU GPL&rdquo; refers to version 3 of the GNU
-General Public License.
-
-&ldquo;The Library&rdquo; refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
-An &ldquo;Application&rdquo; is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
-A &ldquo;Combined Work&rdquo; is a work produced by combining or linking an
-Application with the Library.  The particular version of the Library
-with which the Combined Work was made is also called the &ldquo;Linked
-Version&rdquo;.
-
-The &ldquo;Minimal Corresponding Source&rdquo; for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
-The &ldquo;Corresponding Application Code&rdquo; for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-### 1. Exception to Section 3 of the GNU GPL.
-
-You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-### 2. Conveying Modified Versions.
-
-If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
-* a) under this License, provided that you make a good faith effort to
-ensure that, in the event an Application does not supply the
-function or data, the facility still operates, and performs
-whatever part of its purpose remains meaningful, or
-
-* b) under the GNU GPL, with none of the additional permissions of
-this License applicable to that copy.
-
-### 3. Object Code Incorporating Material from Library Header Files.
-
-The object code form of an Application may incorporate material from
-a header file that is part of the Library.  You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
-* a) Give prominent notice with each copy of the object code that the
-Library is used in it and that the Library and its use are
-covered by this License.
-* b) Accompany the object code with a copy of the GNU GPL and this license
-document.
-
-### 4. Combined Works.
-
-You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
-* a) Give prominent notice with each copy of the Combined Work that
-the Library is used in it and that the Library and its use are
-covered by this License.
-
-* b) Accompany the Combined Work with a copy of the GNU GPL and this license
-document.
-
-* c) For a Combined Work that displays copyright notices during
-execution, include the copyright notice for the Library among
-these notices, as well as a reference directing the user to the
-copies of the GNU GPL and this license document.
-
-* d) Do one of the following:
-    - 0) Convey the Minimal Corresponding Source under the terms of this
-License, and the Corresponding Application Code in a form
-suitable for, and under terms that permit, the user to
-recombine or relink the Application with a modified version of
-the Linked Version to produce a modified Combined Work, in the
-manner specified by section 6 of the GNU GPL for conveying
-Corresponding Source.
-    - 1) Use a suitable shared library mechanism for linking with the
-Library.  A suitable mechanism is one that (a) uses at run time
-a copy of the Library already present on the user's computer
-system, and (b) will operate properly with a modified version
-of the Library that is interface-compatible with the Linked
-Version.
-
-* e) Provide Installation Information, but only if you would otherwise
-be required to provide such information under section 6 of the
-GNU GPL, and only to the extent that such information is
-necessary to install and execute a modified version of the
-Combined Work produced by recombining or relinking the
-Application with a modified version of the Linked Version. (If
-you use option 4d0, the Installation Information must accompany
-the Minimal Corresponding Source and Corresponding Application
-Code. If you use option 4d1, you must provide the Installation
-Information in the manner specified by section 6 of the GNU GPL
-for conveying Corresponding Source.)
-
-### 5. Combined Libraries.
-
-You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
-* a) Accompany the combined library with a copy of the same work based
-on the Library, uncombined with any other library facilities,
-conveyed under the terms of this License.
-* b) Give prominent notice with the combined library that part of it
-is a work based on the Library, and explaining where to find the
-accompanying uncombined form of the same work.
-
-### 6. Revised Versions of the GNU Lesser General Public License.
-
-The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License &ldquo;or any later version&rdquo;
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
-If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
-
\ No newline at end of file diff --git a/bwapi4-includes/BWAPI.h b/bwapi4-includes/BWAPI.h deleted file mode 100644 index 71be5e0..0000000 --- a/bwapi4-includes/BWAPI.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once -#ifndef __BWAPI_H__ -#define __BWAPI_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/// The primary namespace for the BWAPI interface. Everything that is BWAPI is -/// contained within it. -namespace BWAPI -{ - /// Retrieves the revision of the BWAPILIB module currently being used. - /// - /// @returns - /// An integer representing the revision number of the library. - /// - /// @threadsafe - int BWAPI_getRevision(); - - /// Checks if the BWAPILIB module was compiled in DEBUG mode. - /// - /// @retval true if this is a DEBUG build - /// @retval false if this is a RELEASE build - /// - /// @threadsafe - bool BWAPI_isDebug(); -} - -#endif diff --git a/bwapi4-includes/BWAPI/AIModule.h b/bwapi4-includes/BWAPI/AIModule.h deleted file mode 100644 index b906b9f..0000000 --- a/bwapi4-includes/BWAPI/AIModule.h +++ /dev/null @@ -1,252 +0,0 @@ -#pragma once -#include -#include -#include -#include - -namespace BWAPI -{ - // Forward declarations - class PlayerInterface; - typedef PlayerInterface *Player; - class Color; - - /// AIModule is a virtual class that is intended to be implemented or inherited by a - /// custom AI class. The Broodwar interface is guaranteed to be initialized if any of - /// these predefined interface functions are invoked by BWAPI. - /// - /// @warning - /// Using BWAPI in any thread other than the thread that invokes these functions can produce - /// unexpected behaviour and possibly crash your bot. Multi-threaded AIs are possible so - /// long as all BWAPI interaction is limited to the calling thread. - /// - /// @note - /// Replays are considered games and call all of the same callbacks as a standard game would. - /// - /// @ingroup Interface - class AIModule - { - public: - AIModule(); - virtual ~AIModule(); - - /// Called only once at the beginning of a game. It is intended that the - /// AI module do any data initialization in this function. - /// - /// @warning - /// Using the Broodwar interface before this function is called can produce undefined - /// behaviour and crash your bot. (During static initialization of a class for example) - virtual void onStart(); - - /// Called once at the end of a game. - /// - /// - /// A boolean value to determine if the current player has won the match. This value will - /// be true if the current player has won, and false if either the player has lost or the - /// game is actually a replay. - /// - virtual void onEnd(bool isWinner); - - /// Called once for every execution of a logical frame in Broodwar. - /// Users will generally put most of their code in this function. - virtual void onFrame(); - - /// Called when the user attempts to send a text message. This function - /// can be used to make the bot execute text commands entered by the user for debugging - /// purposes. - /// - /// - /// A string containing the exact text message that was sent by the user. - /// - /// - /// @note - /// If Flag::UserInput is disabled, then this function is not called. - virtual void onSendText(std::string text); - - /// Called when the client receives a message from another Player. This - /// function can be used to retrieve information from allies in team games, or just to - /// respond to other players. - /// - /// - /// The Player interface object representing the owner of the text message. - /// - /// - /// The text message that the \p player sent. - /// - /// - /// @note - /// Messages sent by the current player will never invoke this function. - virtual void onReceiveText(Player player, std::string text); - - /// Called when a Player leaves the game. All of their units are - /// automatically given to the neutral player with their colour and alliance parameters - /// preserved. - /// - /// - /// The Player interface object representing the player that left the game. - /// - virtual void onPlayerLeft(Player player); - - /// Called when a @Nuke has been launched somewhere on the map. - /// - /// - /// A Position object containing the target location of the @Nuke. If the target location - /// is not visible and Flag::CompleteMapInformation is disabled, then target will be - /// Positions::Unknown. - /// - virtual void onNukeDetect(Position target); - - /// Called when a Unit becomes accessible. - /// - /// - /// The Unit interface object representing the unit that has just become accessible. - /// - /// - /// @note - /// This function INCLUDES the state of Flag::CompleteMapInformation. - /// - /// @see onUnitShow - virtual void onUnitDiscover(Unit unit); - - /// Called when a Unit becomes inaccessible. - /// - /// - /// The Unit interface object representing the unit that has just become inaccessible. - /// - /// - /// @note - /// This function INCLUDES the state of Flag::CompleteMapInformation. - /// - /// @see onUnitHide - virtual void onUnitEvade(Unit unit); - - /// Called when a previously invisible unit becomes visible. - /// - /// - /// The Unit interface object representing the unit that has just become visible. - /// - /// - /// @note - /// This function EXCLUDES the state of Flag::CompleteMapInformation. - /// - /// @see onUnitDiscover - virtual void onUnitShow(Unit unit); - - /// Called just as a visible unit is becoming invisible. - /// - /// - /// The Unit interface object representing the unit that is about to go out of scope. - /// - /// - /// @note - /// This function EXCLUDES the state of Flag::CompleteMapInformation. - /// - /// @see onUnitEvade - virtual void onUnitHide(Unit unit); - - /// Called when any unit is created. - /// - /// - /// The Unit interface object representing the unit that has just been created. - /// - /// - /// @note - /// Due to the internal workings of Broodwar, this function excludes Zerg morphing and - /// the construction of structures over a @Geyser . - /// - /// @see onUnitMorph - virtual void onUnitCreate(Unit unit); - - /// Called when a unit is removed from the game either through death or other means. - /// - /// - /// Unit object representing the unit that has just been destroyed or otherwise completely - /// removed from the game. - /// - /// - /// @note - /// When a @Drone morphs into an @Extractor, the @Drone is removed from the game and the - /// @Geyser morphs into an @Extractor. - /// - /// @note - /// If a unit is visible and destroyed, then onUnitHide is called just before this. - virtual void onUnitDestroy(Unit unit); - - /// Called when a unit changes its UnitType. For example, when a @Drone - /// transforms into a @Hatchery, a @SiegeTank uses @SiegeMode, or a @Geyser receives a - /// @Refinery. - /// - /// - /// Unit object representing the unit that had its UnitType change. - /// - /// - /// @note - /// This is NOT called if the unit type changes to or from UnitTypes::Unknown. - virtual void onUnitMorph(Unit unit); - - /// Called when a unit changes ownership. This occurs when the @Protoss - /// ability @MindControl is used, or if a unit changes ownership in @UseMapSettings . - /// - /// - /// Unit interface object pertaining to the unit that has just changed ownership. - /// - virtual void onUnitRenegade(Unit unit); - - /// Called when the state of the Broodwar game is saved to file. - /// - /// - /// A String object containing the file name that the game was saved as. - /// - virtual void onSaveGame(std::string gameName); - - /// Called when the state of a unit changes from incomplete to complete. - /// - /// - /// The Unit object representing the Unit that has just finished training or constructing. - /// - virtual void onUnitComplete(Unit unit); - }; - - /// TournamentModule is a virtual class that is intended to be implemented or inherited - /// by a custom Tournament class. Like AIModule, the Broodwar interface is guaranteed - /// to be initialized if any of these predefined interface functions are invoked by BWAPI. - /// - /// @note - /// The TournamentModule is to be implemented by Tournament Modules ONLY. A standard AI module - /// should never implement it. The Tournament Module is invoked only if it is explicitly - /// defined in the configuration file. Tournament Modules also contain an AI Module interface - /// so that it can monitor the time an AI module spent during its calls using - /// Game::getLastEventTime. - /// - /// @ingroup Interface - class TournamentModule - { - public: - TournamentModule(); - virtual ~TournamentModule(); - - /// This function regulates the functions involving game settings that an AI module - /// is allowed to execute. For example, if the tournament forbids the enabling of - /// Flag::CompleteMapInformation, then this function can deny the request. - /// - /// - /// An ActionID containing the action that the AI module is requesting. - /// - /// - /// - /// An optional parameter that pertains to certain action requests. For example, if - /// \p actionType is Tournament::ActionID::SendText, then \p parameter is a pointer to a - /// null-terminated character array containing the message. If \p actionType is - /// Tournament::ActionID::SetLocalSpeed, then parameter is a pointer to an integer. - /// - /// - /// @see BWAPI::Tournament::ActionID - virtual bool onAction(BWAPI::Tournament::ActionID actionType, void *parameter = nullptr); - - /// This function is called if the current player is chosen to advertise the BWAPI - /// revision. When tournament mode is enabled, to reduce spam, only one bot sends - /// the revision message. The bot that is chosen depends on its player ID. Only one of the - /// bots can call this function during a tournament game. - virtual void onFirstAdvertisement(); - }; -} diff --git a/bwapi4-includes/BWAPI/BestFilter.h b/bwapi4-includes/BWAPI/BestFilter.h deleted file mode 100644 index b32a244..0000000 --- a/bwapi4-includes/BWAPI/BestFilter.h +++ /dev/null @@ -1,58 +0,0 @@ -#pragma once -#include -#include "ComparisonFilter.h" - -namespace BWAPI -{ - /// The BestFilter is used to compare two objects with each other. Each - /// function object compares two of the same object and returns the most desirable one. - /// - /// @note: A function object should return one of the two given parameters, never nullptr. Both - /// parameters being given should never be nullptr. - template - class BestFilter - { - private: - std::function<_PARAM(_PARAM,_PARAM)> pred; - public: - // Constructor - template - BestFilter(const _T &predicate) : pred(predicate) - {}; - - // Assignment - template - BestFilter<_PARAM> &operator =(const _T &other) - { - this->pred = other; - return *this; - }; - - // Bitwise operators - template - inline BestFilter<_PARAM> operator &&(const _T &other) const - { - return [=](_PARAM p1, _PARAM p2)->_PARAM{ return other( (*this)(p1, p2) ); }; - }; - - // call - inline _PARAM operator()(const _PARAM &p1, const _PARAM &p2) const - { - return this->pred(p1, p2); - }; - - }; - - template - BestFilter<_PARAM> Lowest(const CompareFilter<_PARAM,int> &filter) - { - return [=](_PARAM p1, _PARAM p2)->_PARAM{ return filter(p2) < filter(p1) ? p2 : p1; }; - }; - template - BestFilter<_PARAM> Highest(const CompareFilter<_PARAM,int> &filter) - { - return [=](_PARAM p1, _PARAM p2)->_PARAM{ return filter(p2) > filter(p1) ? p2 : p1; }; - }; - -} - diff --git a/bwapi4-includes/BWAPI/Bullet.h b/bwapi4-includes/BWAPI/Bullet.h deleted file mode 100644 index 6bf3d68..0000000 --- a/bwapi4-includes/BWAPI/Bullet.h +++ /dev/null @@ -1,169 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - // Forward declarations - class PlayerInterface; - typedef PlayerInterface *Player; - class BulletType; - - class BulletInterface; - typedef BulletInterface *Bullet; - - /// An interface object representing a bullet or missile spawned from an attack. - /// - /// The Bullet interface allows you to detect bullets, missiles, and other types - /// of non-melee attacks or special abilities that would normally be visible through - /// human eyes (A lurker spike or a Queen's flying parasite), allowing quicker reaction - /// to unavoidable consequences. - /// - /// For example, ordering medics to restore units that are about to receive a lockdown - /// to compensate for latency and minimize its effects. You can't know entirely which unit - /// will be receiving a lockdown unless you can detect the lockdown missile using the - /// Bullet class. - /// - /// Bullet objects are re-used after they are destroyed, however their ID is updated when it - /// represents a new Bullet. - /// - /// If Flag::CompleteMapInformation is disabled, then a Bullet is accessible if and only if - /// it is visible. Otherwise if Flag::CompleteMapInformation is enabled, then all Bullets - /// in the game are accessible. - /// @see Game::getBullets, BulletInterface::exists - /// @ingroup Interface - class BulletInterface : public Interface - { - protected: - virtual ~BulletInterface() {}; - public: - /// Retrieves a unique identifier for the current Bullet. - /// - /// @returns - /// An integer value containing the identifier. - virtual int getID() const = 0; - - /// Checks if the Bullet exists in the view of the BWAPI player. - /// - /// @retval true If the bullet exists or is visible. - /// @retval false If the bullet was destroyed or has gone out of scope. - /// - /// If Flag::CompleteMapInformation is disabled, and a Bullet is not visible, then the - /// return value will be false regardless of the Bullet's true existence. This is because - /// absolutely no state information on invisible enemy bullets is made available to the AI. - /// - /// If Flag::CompleteMapInformation is enabled, then this function is accurate for all - /// Bullet information. - /// @see isVisible, UnitInterface::exists - virtual bool exists() const = 0; - - /// Retrieves the Player interface that owns the Bullet. - /// - /// @retval nullptr If the Player object for this Bullet is inaccessible. - /// - /// @returns - /// The owning Player interface object. - virtual Player getPlayer() const = 0; - - /// Retrieves the type of this Bullet. - /// - /// @retval BulletTypes::Unknown if the Bullet is inaccessible. - /// - /// @returns - /// A BulletType representing the Bullet's type. - virtual BulletType getType() const = 0; - - /// Retrieves the Unit interface that the Bullet spawned from. - /// - /// @retval nullptr If the source can not be identified or is inaccessible. - /// - /// @returns - /// The owning Unit interface object. - /// @see getTarget - virtual Unit getSource() const = 0; - - /// Retrieves the Bullet's current position. - /// - /// @retval Positions::Unknown If the Bullet is inaccessible. - /// - /// @returns - /// A Position containing the Bullet's current coordinates. - /// @see getTargetPosition - virtual Position getPosition() const = 0; - - /// Retrieve's the direction the Bullet is facing. If the angle is 0, then - /// the Bullet is facing right. - /// - /// @retval 0.0 If the bullet is inaccessible. - /// - /// @returns - /// A double representing the direction the Bullet is facing. - virtual double getAngle() const = 0; - - /// Retrieves the X component of the Bullet's velocity, measured in pixels per frame. - /// - /// @retval 0.0 if the Bullet is inaccessible. - /// - /// @returns - /// A double representing the number of pixels moved on the X axis per frame. - /// - /// @see getVelocityY, getAngle - virtual double getVelocityX() const = 0; - - /// Retrieves the Y component of the Bullet's velocity, measured in pixels per frame. - /// - /// @retval 0.0 if the Bullet is inaccessible. - /// - /// @returns - /// A double representing the number of pixels moved on the Y axis per frame. - /// - /// @see getVelocityX, getAngle - virtual double getVelocityY() const = 0; - - /// Retrieves the Unit interface that the Bullet is heading to. - /// - /// @retval nullptr If the Bullet's target Unit is inaccessible, the Bullet is targetting the - /// ground, or if the Bullet itself is inaccessible. - /// - /// @returns - /// The target Unit interface object, if one exists. - /// @see getTargetPosition, getSource - virtual Unit getTarget() const = 0; - - /// Retrieves the target position that the Bullet is heading to. - /// - /// @retval Positions::Unknown If the bullet is inaccessible. - /// - /// @returns - /// A Position indicating where the Bullet is headed. - /// @see getTarget, getPosition - virtual Position getTargetPosition() const = 0; - - /// Retrieves the timer that indicates the Bullet's life span. - /// - /// Bullets are not permanent objects, so they will often have a limited life span. - /// This life span is measured in frames. Normally a Bullet will reach its target - /// before being removed. - /// - /// @retval 0 If the Bullet is inaccessible. - /// - /// @returns - /// An integer representing the remaining number of frames until the Bullet self-destructs. - virtual int getRemoveTimer() const = 0; - - /// Retrieves the visibility state of the Bullet. - /// - /// (optional) - /// If this parameter is specified, then the Bullet's visibility to the given player is - /// checked. If this parameter is omitted, then a default value of nullptr is used, which - /// will check if the BWAPI player has vision of the Bullet. - /// - /// - /// @note If \c player is nullptr and Broodwar->self() is also nullptr, then the visibility of - /// the Bullet is determined by checking if at least one other player has vision of the - /// Bullet. - /// - /// @retval true If the Bullet is visible to the specified player. - /// @retval false If the Bullet is not visible to the specified player. - virtual bool isVisible(Player player = nullptr) const = 0; - }; -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/BulletType.h b/bwapi4-includes/BWAPI/BulletType.h deleted file mode 100644 index 236b742..0000000 --- a/bwapi4-includes/BWAPI/BulletType.h +++ /dev/null @@ -1,127 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// Namespace containing bullet types. - /// @see BulletType - namespace BulletTypes - { - /// Enumeration of bullet types. - /// @see BulletType - namespace Enum - { - /// Enumeration of bullet types. - /// @see BulletType - enum Enum - { - Melee = 0, - - Fusion_Cutter_Hit = 141, - Gauss_Rifle_Hit, - C_10_Canister_Rifle_Hit, - Gemini_Missiles, - Fragmentation_Grenade, - Longbolt_Missile, - Unused_Lockdown, - ATS_ATA_Laser_Battery, - Burst_Lasers, - Arclite_Shock_Cannon_Hit, - EMP_Missile, - Dual_Photon_Blasters_Hit, - Particle_Beam_Hit, - Anti_Matter_Missile, - Pulse_Cannon, - Psionic_Shockwave_Hit, - Psionic_Storm, - Yamato_Gun, - Phase_Disruptor, - STA_STS_Cannon_Overlay, - Sunken_Colony_Tentacle, - Venom_Unused, - Acid_Spore, - Plasma_Drip_Unused, - Glave_Wurm, - Seeker_Spores, - Queen_Spell_Carrier, - Plague_Cloud, - Consume, - Ensnare, - Needle_Spine_Hit, - Invisible, - - Optical_Flare_Grenade = 201, - Halo_Rockets, - Subterranean_Spines, - Corrosive_Acid_Shot, - Corrosive_Acid_Hit, - Neutron_Flare, - - None = 209, - Unknown, - MAX - }; - } - } - /// This class represents a type of bullet. - /// - /// @note Internally, these are the same IDs as flingy types in Broodwar. - /// - /// @see BulletTypes - /// @ingroup TypeClasses - class BulletType : public Type - { - public: - /// @copydoc Type::Type(int) - BulletType(int id = BulletTypes::Enum::None); - }; - - /// @ingroup Types - namespace BulletTypes - { - /// Retrieves the set of all the BulletTypes. - /// - /// @returns Set of BulletTypes. - const BulletType::set& allBulletTypes(); - - extern const BulletType Melee; - extern const BulletType Fusion_Cutter_Hit; - extern const BulletType Gauss_Rifle_Hit; - extern const BulletType C_10_Canister_Rifle_Hit; - extern const BulletType Gemini_Missiles; - extern const BulletType Fragmentation_Grenade; - extern const BulletType Longbolt_Missile; - extern const BulletType ATS_ATA_Laser_Battery; - extern const BulletType Burst_Lasers; - extern const BulletType Arclite_Shock_Cannon_Hit; - extern const BulletType EMP_Missile; - extern const BulletType Dual_Photon_Blasters_Hit; - extern const BulletType Particle_Beam_Hit; - extern const BulletType Anti_Matter_Missile; - extern const BulletType Pulse_Cannon; - extern const BulletType Psionic_Shockwave_Hit; - extern const BulletType Psionic_Storm; - extern const BulletType Yamato_Gun; - extern const BulletType Phase_Disruptor; - extern const BulletType STA_STS_Cannon_Overlay; - extern const BulletType Sunken_Colony_Tentacle; - extern const BulletType Acid_Spore; - extern const BulletType Glave_Wurm; - extern const BulletType Seeker_Spores; - extern const BulletType Queen_Spell_Carrier; - extern const BulletType Plague_Cloud; - extern const BulletType Consume; - extern const BulletType Ensnare; - extern const BulletType Needle_Spine_Hit; - extern const BulletType Invisible; - extern const BulletType Optical_Flare_Grenade; - extern const BulletType Halo_Rockets; - extern const BulletType Subterranean_Spines; - extern const BulletType Corrosive_Acid_Shot; - extern const BulletType Neutron_Flare; - extern const BulletType None; - extern const BulletType Unknown; - }; - - static_assert(sizeof(BulletType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/Bulletset.h b/bwapi4-includes/BWAPI/Bulletset.h deleted file mode 100644 index 2f0566e..0000000 --- a/bwapi4-includes/BWAPI/Bulletset.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once -#include "SetContainer.h" - -namespace BWAPI -{ - // Forward Declarations - class BulletInterface; - typedef BulletInterface *Bullet; - - /// A container for a set of Bullet objects. - class Bulletset : public SetContainer> - { - public: - }; -} - diff --git a/bwapi4-includes/BWAPI/Client.h b/bwapi4-includes/BWAPI/Client.h deleted file mode 100644 index a55dd7a..0000000 --- a/bwapi4-includes/BWAPI/Client.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/bwapi4-includes/BWAPI/Client/BulletData.h b/bwapi4-includes/BWAPI/Client/BulletData.h deleted file mode 100644 index 25e41e3..0000000 --- a/bwapi4-includes/BWAPI/Client/BulletData.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -namespace BWAPI -{ - struct BulletData - { - int id; - int player; - int type; - int source; - int positionX; - int positionY; - double angle; - double velocityX; - double velocityY; - int target; - int targetPositionX; - int targetPositionY; - int removeTimer; - bool exists; - bool isVisible[9]; - }; -} diff --git a/bwapi4-includes/BWAPI/Client/BulletImpl.h b/bwapi4-includes/BWAPI/Client/BulletImpl.h deleted file mode 100644 index 48ca297..0000000 --- a/bwapi4-includes/BWAPI/Client/BulletImpl.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once -#include -#include "BulletData.h" -#include - -namespace BWAPI -{ - class PlayerInterface; - typedef PlayerInterface *Player; - - class BulletImpl : public BulletInterface - { - private: - const BulletData* self; - int index; - public: - - BulletImpl(int index); - virtual int getID() const override; - virtual bool exists() const override; - virtual Player getPlayer() const override; - virtual BulletType getType() const override; - virtual Unit getSource() const override; - virtual Position getPosition() const override; - virtual double getAngle() const override; - virtual double getVelocityX() const override; - virtual double getVelocityY() const override; - virtual Unit getTarget() const override; - virtual Position getTargetPosition() const override; - virtual int getRemoveTimer() const override; - virtual bool isVisible(Player player = nullptr) const override; - }; -} diff --git a/bwapi4-includes/BWAPI/Client/Client.h b/bwapi4-includes/BWAPI/Client/Client.h deleted file mode 100644 index 2de8ba2..0000000 --- a/bwapi4-includes/BWAPI/Client/Client.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once -#include "GameData.h" -#include "GameImpl.h" -#include "ForceImpl.h" -#include "PlayerImpl.h" -#include "UnitImpl.h" -#include "GameTable.h" - -#include "../WindowsTypes.h" - - -namespace BWAPI -{ - class Client - { - public: - Client(); - ~Client(); - - bool isConnected() const; - bool connect(); - void disconnect(); - void update(); - - GameData* data = nullptr; - private: - HANDLE pipeObjectHandle; - HANDLE mapFileHandle; - HANDLE gameTableFileHandle; - GameTable* gameTable = nullptr; - - bool connected = false; - }; - extern Client BWAPIClient; -} diff --git a/bwapi4-includes/BWAPI/Client/Command.h b/bwapi4-includes/BWAPI/Client/Command.h deleted file mode 100644 index e0d0f88..0000000 --- a/bwapi4-includes/BWAPI/Client/Command.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include "CommandType.h" - -namespace BWAPIC -{ - struct Command - { - Command() - : type( CommandType::None ) - , value1( 0 ) - , value2( 0 ) - { } - Command(CommandType::Enum _commandType, int _value1=0, int _value2=0) - : type( _commandType ) - , value1( _value1 ) - , value2( _value2 ) - { } - - CommandType::Enum type; - int value1; - int value2; - }; -} diff --git a/bwapi4-includes/BWAPI/Client/CommandType.h b/bwapi4-includes/BWAPI/Client/CommandType.h deleted file mode 100644 index 25a33e9..0000000 --- a/bwapi4-includes/BWAPI/Client/CommandType.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once -/** - * Used in UnitCommand - */ - -namespace BWAPIC -{ - namespace CommandType - { - enum Enum - { - None, - SetScreenPosition, - PingMinimap, - EnableFlag, - Printf, - SendText, - PauseGame, - ResumeGame, - LeaveGame, - RestartGame, - SetLocalSpeed, - SetLatCom, - SetGui, - SetFrameSkip, - SetMap, - SetAllies, - SetVision, - SetCommandOptimizerLevel, - SetRevealAll - }; - } -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/Client/Event.h b/bwapi4-includes/BWAPI/Client/Event.h deleted file mode 100644 index 7abfccc..0000000 --- a/bwapi4-includes/BWAPI/Client/Event.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include - -namespace BWAPIC -{ - struct Event - { - BWAPI::EventType::Enum type; - int v1; - int v2; - }; -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/Client/ForceData.h b/bwapi4-includes/BWAPI/Client/ForceData.h deleted file mode 100644 index 6480914..0000000 --- a/bwapi4-includes/BWAPI/Client/ForceData.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -namespace BWAPI -{ - struct ForceData - { - char name[32]; - }; -} diff --git a/bwapi4-includes/BWAPI/Client/ForceImpl.h b/bwapi4-includes/BWAPI/Client/ForceImpl.h deleted file mode 100644 index 640107a..0000000 --- a/bwapi4-includes/BWAPI/Client/ForceImpl.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include -#include "ForceData.h" -#include - -namespace BWAPI -{ - class ForceImpl : public ForceInterface - { - private: - const ForceData* self; - int id; - public: - ForceImpl(int id); - virtual int getID() const override; - virtual std::string getName() const override; - virtual Playerset getPlayers() const override; - }; -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/Client/GameData.h b/bwapi4-includes/BWAPI/Client/GameData.h deleted file mode 100644 index 5b2745b..0000000 --- a/bwapi4-includes/BWAPI/Client/GameData.h +++ /dev/null @@ -1,163 +0,0 @@ -#pragma once - -#include "UnitCommand.h" -#include "ForceData.h" -#include "PlayerData.h" -#include "RegionData.h" -#include "UnitData.h" -#include "BulletData.h" -#include "Event.h" -#include "Command.h" -#include "Shape.h" -namespace BWAPIC -{ - struct Position - { - Position() {x=0;y=0;} - int x; - int y; - }; -} -namespace BWAPI -{ - struct unitFinder - { - int unitIndex; - int searchValue; - }; - struct GameData - { - //revision and debug will stay at the top of struct so they don't move in memory from revision to revision. - int revision; - bool isDebug; - - int instanceID; - int botAPM_noselects; - int botAPM_selects; - - //forces - int forceCount; - ForceData forces[5]; - - //players - int playerCount; - PlayerData players[12]; - - //units - int initialUnitCount; - UnitData units[10000]; - - //unit table - int unitArray[1700]; - - //bullets - BulletData bullets[100]; - - // nuke dots - int nukeDotCount; - BWAPIC::Position nukeDots[200]; - - int gameType; - int latency; - int latencyFrames; - int latencyTime; - int remainingLatencyFrames; - int remainingLatencyTime; - bool hasLatCom; - bool hasGUI; - int replayFrameCount; - int frameCount; - int elapsedTime; - int countdownTimer; - int fps; - double averageFPS; - - // user input - int mouseX; - int mouseY; - bool mouseState[M_MAX]; - bool keyState[K_MAX]; - int screenX; - int screenY; - - bool flags[BWAPI::Flag::Max]; - - // map - int mapWidth; - int mapHeight; - char mapFileName[261]; //size based on broodwar memory - char mapPathName[261]; //size based on broodwar memory - char mapName[33]; //size based on broodwar memory - char mapHash[41]; - - //tile data - int getGroundHeight[256][256]; - bool isWalkable[1024][1024]; - bool isBuildable[256][256]; - bool isVisible[256][256]; - bool isExplored[256][256]; - bool hasCreep[256][256]; - bool isOccupied[256][256]; - - unsigned short mapTileRegionId[256][256]; - unsigned short mapSplitTilesMiniTileMask[5000]; - unsigned short mapSplitTilesRegion1[5000]; - unsigned short mapSplitTilesRegion2[5000]; - - int regionCount; - RegionData regions[5000]; - - // start locations - int startLocationCount; - BWAPIC::Position startLocations[8]; - - // match mode - bool isInGame; - bool isMultiplayer; - bool isBattleNet; - bool isPaused; - bool isReplay; - - //selected units - int selectedUnitCount; - int selectedUnits[12]; - - // players - int self; - int enemy; - int neutral; - - static const int MAX_EVENTS = 10000; - static const int MAX_EVENT_STRINGS = 1000; - static const int MAX_STRINGS = 20000; - static const int MAX_SHAPES = 20000; - static const int MAX_COMMANDS = 20000; - static const int MAX_UNIT_COMMANDS = 20000; - - //events from server to client - int eventCount; - BWAPIC::Event events[MAX_EVENTS]; - - //strings used in events - int eventStringCount; - char eventStrings[MAX_EVENT_STRINGS][256]; - - //strings (used in shapes and commands) - int stringCount; - char strings[MAX_STRINGS][1024]; - - //shapes, commands, unitCommands, from client to server - int shapeCount; - BWAPIC::Shape shapes[MAX_SHAPES]; - - int commandCount; - BWAPIC::Command commands[MAX_COMMANDS]; - - int unitCommandCount; - BWAPIC::UnitCommand unitCommands[MAX_UNIT_COMMANDS]; - - int unitSearchSize; - unitFinder xUnitSearch[1700*2]; - unitFinder yUnitSearch[1700*2]; - }; -} diff --git a/bwapi4-includes/BWAPI/Client/GameImpl.h b/bwapi4-includes/BWAPI/Client/GameImpl.h deleted file mode 100644 index 87a4440..0000000 --- a/bwapi4-includes/BWAPI/Client/GameImpl.h +++ /dev/null @@ -1,200 +0,0 @@ -#pragma once -#include - -#include "GameData.h" -#include "Client.h" -#include "Shape.h" -#include "Command.h" -#include "UnitCommand.h" -#include "ForceImpl.h" -#include "PlayerImpl.h" -#include "RegionImpl.h" -#include "UnitImpl.h" -#include "BulletImpl.h" - -#include -#include -#include - -namespace BWAPI -{ - class ForceInterface; - typedef ForceInterface *Force; - class PlayerInterface; - typedef PlayerInterface *Player; - - class GameImpl : public Game - { - private : - int addShape(const BWAPIC::Shape &s); - int addString(const char* text); - int addText(BWAPIC::Shape &s, const char* text); - int addCommand(const BWAPIC::Command &c); - void processInterfaceEvents(); - void clearAll(); - - GameData* data; - std::vector forceVector; - std::vector playerVector; - std::vector unitVector; - std::vector bulletVector; - std::array regionArray; - - Forceset forces; - Playerset playerSet; - Unitset accessibleUnits;//all units that are accessible (and definitely alive) - //notDestroyedUnits - accessibleUnits = all units that may or may not be alive (status unknown) - Unitset minerals; - Unitset geysers; - Unitset neutralUnits; - Unitset staticMinerals; - Unitset staticGeysers; - Unitset staticNeutralUnits; - Bulletset bullets; - Position::list nukeDots; - Unitset selectedUnits; - Unitset pylons; - Regionset regionsList; - - TilePosition::list startLocations; - std::list< Event > events; - Player thePlayer; - Player theEnemy; - Player theNeutral; - Playerset _allies; - Playerset _enemies; - Playerset _observers; - mutable Error lastError; - Text::Size::Enum textSize; - - public : - Event makeEvent(BWAPIC::Event e); - int addUnitCommand(BWAPIC::UnitCommand& c); - bool inGame; - GameImpl(GameData* data); - void onMatchStart(); - void onMatchEnd(); - void onMatchFrame(); - const GameData* getGameData() const; - Unit _unitFromIndex(int index); - - virtual const Forceset& getForces() const override; - virtual const Playerset& getPlayers() const override; - virtual const Unitset& getAllUnits() const override; - virtual const Unitset& getMinerals() const override; - virtual const Unitset& getGeysers() const override; - virtual const Unitset& getNeutralUnits() const override; - - virtual const Unitset& getStaticMinerals() const override; - virtual const Unitset& getStaticGeysers() const override; - virtual const Unitset& getStaticNeutralUnits() const override; - - virtual const Bulletset& getBullets() const override; - virtual const Position::list& getNukeDots() const override; - virtual const std::list< Event>& getEvents() const override; - - virtual Force getForce(int forceID) const override; - virtual Player getPlayer(int playerID) const override; - virtual Unit getUnit(int unitID) const override; - virtual Unit indexToUnit(int unitIndex) const override; - virtual Region getRegion(int regionID) const override; - - virtual GameType getGameType() const override; - virtual int getLatency() const override; - virtual int getFrameCount() const override; - virtual int getReplayFrameCount() const override; - virtual int getFPS() const override; - virtual double getAverageFPS() const override; - virtual BWAPI::Position getMousePosition() const override; - virtual bool getMouseState(MouseButton button) const override; - virtual bool getKeyState(Key key) const override; - virtual BWAPI::Position getScreenPosition() const override; - virtual void setScreenPosition(int x, int y) override; - virtual void pingMinimap(int x, int y) override; - - virtual bool isFlagEnabled(int flag) const override; - virtual void enableFlag(int flag) override; - virtual Unitset getUnitsInRectangle(int left, int top, int right, int bottom, const UnitFilter &pred = nullptr) const override; - virtual Unit getClosestUnitInRectangle(Position center, const UnitFilter &pred = nullptr, int left = 0, int top = 0, int right = 999999, int bottom = 999999) const override; - virtual Unit getBestUnit(const BestUnitFilter &best, const UnitFilter &pred, Position center = Positions::None, int radius = 999999) const override; - virtual Error getLastError() const override; - virtual bool setLastError(BWAPI::Error e = Errors::None) const override; - - virtual int mapWidth() const override; - virtual int mapHeight() const override; - virtual std::string mapFileName() const override; - virtual std::string mapPathName() const override; - virtual std::string mapName() const override; - virtual std::string mapHash() const override; - - virtual bool isWalkable(int x, int y) const override; - virtual int getGroundHeight(int x, int y) const override; - virtual bool isBuildable(int x, int y, bool includeBuildings = false) const override; - virtual bool isVisible(int x, int y) const override; - virtual bool isExplored(int x, int y) const override; - virtual bool hasCreep(int x, int y) const override; - virtual bool hasPowerPrecise(int x, int y, UnitType unitType = UnitTypes::None ) const override; - - virtual bool canBuildHere(TilePosition position, UnitType type, Unit builder = nullptr, bool checkExplored = false) override; - virtual bool canMake(UnitType type, Unit builder = nullptr) const override; - virtual bool canResearch(TechType type, Unit unit = nullptr, bool checkCanIssueCommandType = true) override; - virtual bool canUpgrade(UpgradeType type, Unit unit = nullptr, bool checkCanIssueCommandType = true) override; - virtual const TilePosition::list& getStartLocations() const override; - - virtual void vPrintf(const char* format, va_list arg) override; - virtual void vSendTextEx(bool toAllies, const char *format, va_list arg) override; - - virtual bool isInGame() const override; - virtual bool isMultiplayer() const override; - virtual bool isBattleNet() const override; - virtual bool isPaused() const override; - virtual bool isReplay() const override; - - virtual void pauseGame() override; - virtual void resumeGame() override; - virtual void leaveGame() override; - virtual void restartGame() override; - virtual void setLocalSpeed(int speed = -1) override; - virtual bool issueCommand(const Unitset& units, UnitCommand command) override; - virtual const Unitset& getSelectedUnits() const override; - virtual Player self() const override; - virtual Player enemy() const override; - virtual Player neutral() const override; - virtual Playerset& allies() override; - virtual Playerset& enemies() override; - virtual Playerset& observers() override; - - virtual void setTextSize(Text::Size::Enum size = Text::Size::Default) override; - virtual void vDrawText(CoordinateType::Enum ctype, int x, int y, const char *format, va_list arg) override; - virtual void drawBox(CoordinateType::Enum ctype, int left, int top, int right, int bottom, Color color, bool isSolid = false) override; - virtual void drawTriangle(CoordinateType::Enum ctype, int ax, int ay, int bx, int by, int cx, int cy, Color color, bool isSolid = false) override; - virtual void drawCircle(CoordinateType::Enum ctype, int x, int y, int radius, Color color, bool isSolid = false) override; - virtual void drawEllipse(CoordinateType::Enum ctype, int x, int y, int xrad, int yrad, Color color, bool isSolid = false) override; - virtual void drawDot(CoordinateType::Enum ctype, int x, int y, Color color) override; - virtual void drawLine(CoordinateType::Enum ctype, int x1, int y1, int x2, int y2, Color color) override; - - virtual int getLatencyFrames() const override; - virtual int getLatencyTime() const override; - virtual int getRemainingLatencyFrames() const override; - virtual int getRemainingLatencyTime() const override; - virtual int getRevision() const override; - virtual bool isDebug() const override; - virtual bool isLatComEnabled() const override; - virtual void setLatCom(bool isEnabled) override; - virtual bool isGUIEnabled() const override; - virtual void setGUI(bool enabled) override; - virtual int getInstanceNumber() const override; - virtual int getAPM(bool includeSelects = false) const override; - virtual bool setMap(const char *mapFileName) override; - virtual void setFrameSkip(int frameSkip) override; - virtual bool setAlliance(BWAPI::Player player, bool allied = true, bool alliedVictory = true) override; - virtual bool setVision(BWAPI::Player player, bool enabled = true) override; - virtual int elapsedTime() const override; - virtual void setCommandOptimizationLevel(int level) override; - virtual int countdownTimer() const override; - virtual const Regionset &getAllRegions() const override; - virtual BWAPI::Region getRegionAt(int x, int y) const override; - virtual int getLastEventTime() const override; - virtual bool setRevealAll(bool reveal = true) override; - }; -} diff --git a/bwapi4-includes/BWAPI/Client/GameTable.h b/bwapi4-includes/BWAPI/Client/GameTable.h deleted file mode 100644 index 14a0863..0000000 --- a/bwapi4-includes/BWAPI/Client/GameTable.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -namespace BWAPI -{ - struct GameInstance - { - GameInstance() - : serverProcessID(0) - , isConnected(false) - , lastKeepAliveTime(0) - {}; - GameInstance(unsigned int servID, bool connected, unsigned int lastAliveTime) - : serverProcessID(servID) - , isConnected(connected) - , lastKeepAliveTime(lastAliveTime) - {}; - - unsigned int serverProcessID; - bool isConnected; - //time_t lastKeepAliveTime; - unsigned int lastKeepAliveTime; - }; - struct GameTable - { - GameTable() - {} - static const int MAX_GAME_INSTANCES = 8; - GameInstance gameInstances[MAX_GAME_INSTANCES]; - }; -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/Client/PlayerData.h b/bwapi4-includes/BWAPI/Client/PlayerData.h deleted file mode 100644 index 073d991..0000000 --- a/bwapi4-includes/BWAPI/Client/PlayerData.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace BWAPI -{ - struct PlayerData - { - char name[25]; - int race; - int type; - int force; - bool isAlly[12]; - bool isEnemy[12]; - bool isNeutral; - int startLocationX; - int startLocationY; - bool isVictorious; - bool isDefeated; - bool leftGame; - bool isParticipating; - - int minerals; - int gas; - int gatheredMinerals; - int gatheredGas; - int repairedMinerals; - int repairedGas; - int refundedMinerals; - int refundedGas; - int supplyTotal[3]; - int supplyUsed[3]; - - int allUnitCount[UnitTypes::Enum::MAX]; - int visibleUnitCount[UnitTypes::Enum::MAX]; - int completedUnitCount[UnitTypes::Enum::MAX]; - int deadUnitCount[UnitTypes::Enum::MAX]; - int killedUnitCount[UnitTypes::Enum::MAX]; - - int upgradeLevel[UpgradeTypes::Enum::MAX]; - bool hasResearched[TechTypes::Enum::MAX]; - bool isResearching[TechTypes::Enum::MAX]; - bool isUpgrading[UpgradeTypes::Enum::MAX]; - - int color; - - int totalUnitScore; - int totalKillScore; - int totalBuildingScore; - int totalRazingScore; - int customScore; - - int maxUpgradeLevel[UpgradeTypes::Enum::MAX]; - bool isResearchAvailable[TechTypes::Enum::MAX]; - bool isUnitAvailable[UnitTypes::Enum::MAX]; - }; -} diff --git a/bwapi4-includes/BWAPI/Client/PlayerImpl.h b/bwapi4-includes/BWAPI/Client/PlayerImpl.h deleted file mode 100644 index c4b7e20..0000000 --- a/bwapi4-includes/BWAPI/Client/PlayerImpl.h +++ /dev/null @@ -1,75 +0,0 @@ -#pragma once -#include -#include "PlayerData.h" -#include - -#include - -namespace BWAPI -{ - class ForceInterface; - typedef ForceInterface *Force; - - class PlayerImpl : public PlayerInterface - { - private: - int id; - public: - PlayerData* self; - Unitset units; - void clear(); - PlayerImpl(int id); - virtual int getID() const override; - virtual std::string getName() const override; - virtual const Unitset &getUnits() const override; - virtual Race getRace() const override; - virtual PlayerType getType() const override; - virtual Force getForce() const override; - virtual bool isAlly(const Player player) const override; - virtual bool isEnemy(const Player player) const override; - virtual bool isNeutral() const override; - virtual TilePosition getStartLocation() const override; - virtual bool isVictorious() const override; - virtual bool isDefeated() const override; - virtual bool leftGame() const override; - - virtual int minerals() const override; - virtual int gas() const override; - virtual int gatheredMinerals() const override; - virtual int gatheredGas() const override; - virtual int repairedMinerals() const override; - virtual int repairedGas() const override; - virtual int refundedMinerals() const override; - virtual int refundedGas() const override; - virtual int spentMinerals() const override; - virtual int spentGas() const override; - - virtual int supplyTotal(Race race = Races::None) const override; - virtual int supplyUsed(Race race = Races::None) const override; - - virtual int allUnitCount(UnitType unit) const override; - virtual int visibleUnitCount(UnitType unit) const override; - virtual int completedUnitCount(UnitType unit) const override; - virtual int deadUnitCount(UnitType unit) const override; - virtual int killedUnitCount(UnitType unit) const override; - - virtual int getUpgradeLevel(UpgradeType upgrade) const override; - virtual bool hasResearched(TechType tech) const override; - virtual bool isResearching(TechType tech) const override; - virtual bool isUpgrading(UpgradeType upgrade) const override; - - virtual BWAPI::Color getColor() const override; - - virtual int getUnitScore() const override; - virtual int getKillScore() const override; - virtual int getBuildingScore() const override; - virtual int getRazingScore() const override; - virtual int getCustomScore() const override; - - virtual bool isObserver() const override; - - virtual int getMaxUpgradeLevel(UpgradeType upgrade) const override; - virtual bool isResearchAvailable(TechType tech) const override; - virtual bool isUnitAvailable(UnitType unit) const override; - }; -}; diff --git a/bwapi4-includes/BWAPI/Client/RegionData.h b/bwapi4-includes/BWAPI/Client/RegionData.h deleted file mode 100644 index 4cbc8b4..0000000 --- a/bwapi4-includes/BWAPI/Client/RegionData.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -namespace BWAPI -{ - struct RegionData - { - int id; - int islandID; - int center_x; - int center_y; - int priority; - - // region boundary - int leftMost; - int rightMost; - int topMost; - int bottomMost; - - int neighborCount; - int neighbors[256]; - - bool isAccessible; - bool isHigherGround; - }; -}; diff --git a/bwapi4-includes/BWAPI/Client/RegionImpl.h b/bwapi4-includes/BWAPI/Client/RegionImpl.h deleted file mode 100644 index 8a37817..0000000 --- a/bwapi4-includes/BWAPI/Client/RegionImpl.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once -#include -#include -#include - -#include - -namespace BWAPI -{ - class RegionImpl : public RegionInterface - { - private: - RegionData* self; - Regionset neighbors; - BWAPI::Region closestAccessibleRgn = nullptr; - BWAPI::Region closestInaccessibleRgn = nullptr; - public: - RegionImpl(int index); - void setNeighbors(); - virtual int getID() const override; - virtual int getRegionGroupID() const override; - virtual BWAPI::Position getCenter() const override; - virtual bool isHigherGround() const override; - virtual int getDefensePriority() const override; - virtual bool isAccessible() const override; - - virtual const Regionset &getNeighbors() const override; - - virtual int getBoundsLeft() const override; - virtual int getBoundsTop() const override; - virtual int getBoundsRight() const override; - virtual int getBoundsBottom() const override; - - virtual BWAPI::Region getClosestAccessibleRegion() const override; - virtual BWAPI::Region getClosestInaccessibleRegion() const override; - }; - -}; - diff --git a/bwapi4-includes/BWAPI/Client/Shape.h b/bwapi4-includes/BWAPI/Client/Shape.h deleted file mode 100644 index 6007fb5..0000000 --- a/bwapi4-includes/BWAPI/Client/Shape.h +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once -#include "ShapeType.h" -#include - -namespace BWAPIC -{ - struct Shape - { - Shape() - :type(ShapeType::None) - ,ctype(BWAPI::CoordinateType::None) - ,x1(0) - ,y1(0) - ,x2(0) - ,y2(0) - ,extra1(0) - ,extra2(0) - ,color(0) - ,isSolid(false) - { - } - - Shape(ShapeType::Enum _shapeType, BWAPI::CoordinateType::Enum _ctype, int _x1, int _y1, int _x2, int _y2, int _extra1, int _extra2, int _color, bool _isSolid) - :type(_shapeType) - ,ctype(_ctype) - ,x1(_x1) - ,y1(_y1) - ,x2(_x2) - ,y2(_y2) - ,extra1(_extra1) - ,extra2(_extra2) - ,color(_color) - ,isSolid(_isSolid) - { - } - - ShapeType::Enum type; - BWAPI::CoordinateType::Enum ctype; - int x1; - int y1; - int x2; - int y2; - int extra1; - int extra2; - int color; - bool isSolid; - }; -} diff --git a/bwapi4-includes/BWAPI/Client/ShapeType.h b/bwapi4-includes/BWAPI/Client/ShapeType.h deleted file mode 100644 index f5709e7..0000000 --- a/bwapi4-includes/BWAPI/Client/ShapeType.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -/** - * Used in UnitCommand - */ - -namespace BWAPIC -{ - namespace ShapeType - { - enum Enum - { - None, - Text, - Box, - Triangle, - Circle, - Ellipse, - Dot, - Line - }; - } -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/Client/UnitCommand.h b/bwapi4-includes/BWAPI/Client/UnitCommand.h deleted file mode 100644 index d62eb92..0000000 --- a/bwapi4-includes/BWAPI/Client/UnitCommand.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include - -/** - * UnitOrder contains a single whole order - */ - -namespace BWAPIC -{ - struct UnitCommand - { - BWAPI::UnitCommandType type; - int unitIndex; - int targetIndex; - int x; - int y; - int extra; - }; -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/Client/UnitData.h b/bwapi4-includes/BWAPI/Client/UnitData.h deleted file mode 100644 index 6df7fd4..0000000 --- a/bwapi4-includes/BWAPI/Client/UnitData.h +++ /dev/null @@ -1,111 +0,0 @@ -#pragma once - -namespace BWAPI -{ - struct UnitData - { - int clearanceLevel; - int id; - int player; - int type; - int positionX; - int positionY; - double angle; - double velocityX; - double velocityY; - int hitPoints; - int lastHitPoints; - int shields; - int energy; - int resources; - int resourceGroup; - - int killCount; - int acidSporeCount; - int scarabCount; - int spiderMineCount; - int groundWeaponCooldown; - int airWeaponCooldown; - int spellCooldown; - int defenseMatrixPoints; - - int defenseMatrixTimer; - int ensnareTimer; - int irradiateTimer; - int lockdownTimer; - int maelstromTimer; - int orderTimer; - int plagueTimer; - int removeTimer; - int stasisTimer; - int stimTimer; - - int buildType; - int trainingQueueCount; - int trainingQueue[5]; - int tech; - int upgrade; - int remainingBuildTime; - int remainingTrainTime; - int remainingResearchTime; - int remainingUpgradeTime; - int buildUnit; - - int target; - int targetPositionX; - int targetPositionY; - int order; - int orderTarget; - int orderTargetPositionX; - int orderTargetPositionY; - int secondaryOrder; - int rallyPositionX; - int rallyPositionY; - int rallyUnit; - int addon; - int nydusExit; - int powerUp; - - int transport; - int carrier; - int hatchery; - - bool exists; - bool hasNuke; - bool isAccelerating; - bool isAttacking; - bool isAttackFrame; - bool isBeingGathered; - bool isBlind; - bool isBraking; - bool isBurrowed; - int carryResourceType; - bool isCloaked; - bool isCompleted; - bool isConstructing; - bool isDetected; - bool isGathering; - bool isHallucination; - bool isIdle; - bool isInterruptible; - bool isInvincible; - bool isLifted; - bool isMorphing; - bool isMoving; - bool isParasited; - bool isSelected; - bool isStartingAttack; - bool isStuck; - bool isTraining; - bool isUnderStorm; - bool isUnderDarkSwarm; - bool isUnderDWeb; - bool isPowered; - bool isVisible[9]; - int buttonset; - - int lastAttackerPlayer; - bool recentlyAttacked; - int replayID; - }; -} diff --git a/bwapi4-includes/BWAPI/Client/UnitImpl.h b/bwapi4-includes/BWAPI/Client/UnitImpl.h deleted file mode 100644 index bf39806..0000000 --- a/bwapi4-includes/BWAPI/Client/UnitImpl.h +++ /dev/null @@ -1,242 +0,0 @@ -#pragma once -#include -#include "UnitData.h" -#include - -namespace BWAPI -{ - class PlayerInterface; - typedef PlayerInterface *Player; - - class UnitImpl : public UnitInterface - { - private: - int id; - UnitType initialType; - int initialResources; - int initialHitPoints; - Position initialPosition; - int lastCommandFrame; - UnitCommand lastCommand; - public: - UnitData* self; - Unitset connectedUnits; - Unitset loadedUnits; - void clear(); - void saveInitialState(); - - UnitImpl(int _id); - - virtual int getID() const override; - virtual bool exists() const override; - virtual int getReplayID() const override; - virtual Player getPlayer() const override; - virtual UnitType getType() const override; - virtual Position getPosition() const override; - virtual double getAngle() const override; - virtual double getVelocityX() const override; - virtual double getVelocityY() const override; - virtual int getHitPoints() const override; - virtual int getShields() const override; - virtual int getEnergy() const override; - virtual int getResources() const override; - virtual int getResourceGroup() const override; - - virtual int getLastCommandFrame() const override; - virtual UnitCommand getLastCommand() const override; - virtual BWAPI::Player getLastAttackingPlayer() const override; - - virtual UnitType getInitialType() const override; - virtual Position getInitialPosition() const override; - virtual TilePosition getInitialTilePosition() const override; - virtual int getInitialHitPoints() const override; - virtual int getInitialResources() const override; - - virtual int getKillCount() const override; - virtual int getAcidSporeCount() const override; - virtual int getInterceptorCount() const override; - virtual int getScarabCount() const override; - virtual int getSpiderMineCount() const override; - virtual int getGroundWeaponCooldown() const override; - virtual int getAirWeaponCooldown() const override; - virtual int getSpellCooldown() const override; - virtual int getDefenseMatrixPoints() const override; - - virtual int getDefenseMatrixTimer() const override; - virtual int getEnsnareTimer() const override; - virtual int getIrradiateTimer() const override; - virtual int getLockdownTimer() const override; - virtual int getMaelstromTimer() const override; - virtual int getOrderTimer() const override; - virtual int getPlagueTimer() const override; - virtual int getRemoveTimer() const override; - virtual int getStasisTimer() const override; - virtual int getStimTimer() const override; - - virtual UnitType getBuildType() const override; - virtual UnitType::list getTrainingQueue() const override; - virtual TechType getTech() const override; - virtual UpgradeType getUpgrade() const override; - virtual int getRemainingBuildTime() const override; - virtual int getRemainingTrainTime() const override; - virtual int getRemainingResearchTime() const override; - virtual int getRemainingUpgradeTime() const override; - virtual Unit getBuildUnit() const override; - - virtual Unit getTarget() const override; - virtual Position getTargetPosition() const override; - virtual Order getOrder() const override; - virtual Unit getOrderTarget() const override; - virtual Position getOrderTargetPosition() const override; - virtual Order getSecondaryOrder() const override; - virtual Position getRallyPosition() const override; - virtual Unit getRallyUnit() const override; - virtual Unit getAddon() const override; - virtual Unit getNydusExit() const override; - virtual Unit getPowerUp() const override; - - virtual Unit getTransport() const override; - virtual Unitset getLoadedUnits() const override; - virtual Unit getCarrier() const override; - virtual Unitset getInterceptors() const override; - virtual Unit getHatchery() const override; - virtual Unitset getLarva() const override; - - virtual bool hasNuke() const override; - virtual bool isAccelerating() const override; - virtual bool isAttackFrame() const override; - virtual bool isAttacking() const override; - virtual bool isBeingGathered() const override; - virtual bool isBeingHealed() const override; - virtual bool isBlind() const override; - virtual bool isBraking() const override; - virtual bool isBurrowed() const override; - virtual bool isCarryingGas() const override; - virtual bool isCarryingMinerals() const override; - virtual bool isCloaked() const override; - virtual bool isCompleted() const override; - virtual bool isConstructing() const override; - virtual bool isDetected() const override; - virtual bool isGatheringGas() const override; - virtual bool isGatheringMinerals() const override; - virtual bool isHallucination() const override; - virtual bool isIdle() const override; - virtual bool isInterruptible() const override; - virtual bool isInvincible() const override; - virtual bool isLifted() const override; - virtual bool isMorphing() const override; - virtual bool isMoving() const override; - virtual bool isParasited() const override; - virtual bool isSelected() const override; - virtual bool isStartingAttack() const override; - virtual bool isStuck() const override; - virtual bool isTraining() const override; - virtual bool isUnderAttack() const override; - virtual bool isUnderDarkSwarm() const override; - virtual bool isUnderDisruptionWeb() const override; - virtual bool isUnderStorm() const override; - virtual bool isPowered() const override; - virtual bool isVisible(Player player = nullptr) const override; - virtual bool isTargetable() const override; - - virtual bool canCommand() const override; - virtual bool canCommandGrouped(bool checkCommandibility = true) const override; - virtual bool canTargetUnit(Unit targetUnit, bool checkCommandibility = true) const override; - - virtual bool canAttack(bool checkCommandibility = true) const override; - virtual bool canAttack(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canAttackGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canAttackGrouped(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canAttackMove(bool checkCommandibility = true) const override; - virtual bool canAttackMoveGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canAttackUnit(bool checkCommandibility = true) const override; - virtual bool canAttackUnit(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canAttackUnitGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canAttackUnitGrouped(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canBuild(bool checkCommandibility = true) const override; - virtual bool canBuild(UnitType uType, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canBuild(UnitType uType, BWAPI::TilePosition tilePos, bool checkTargetUnitType = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canBuildAddon(bool checkCommandibility = true) const override; - virtual bool canBuildAddon(UnitType uType, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canTrain(bool checkCommandibility = true) const override; - virtual bool canTrain(UnitType uType, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canMorph(bool checkCommandibility = true) const override; - virtual bool canMorph(UnitType uType, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canResearch(bool checkCommandibility = true) const override; - virtual bool canResearch(TechType type, bool checkCanIssueCommandType = true) const override; - virtual bool canUpgrade(bool checkCommandibility = true) const override; - virtual bool canUpgrade(UpgradeType type, bool checkCanIssueCommandType = true) const override; - virtual bool canSetRallyPoint(bool checkCommandibility = true) const override; - virtual bool canSetRallyPoint(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canSetRallyPosition(bool checkCommandibility = true) const override; - virtual bool canSetRallyUnit(bool checkCommandibility = true) const override; - virtual bool canSetRallyUnit(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canMove(bool checkCommandibility = true) const override; - virtual bool canMoveGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canPatrol(bool checkCommandibility = true) const override; - virtual bool canPatrolGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canFollow(bool checkCommandibility = true) const override; - virtual bool canFollow(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canGather(bool checkCommandibility = true) const override; - virtual bool canGather(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canReturnCargo(bool checkCommandibility = true) const override; - virtual bool canHoldPosition(bool checkCommandibility = true) const override; - virtual bool canStop(bool checkCommandibility = true) const override; - virtual bool canRepair(bool checkCommandibility = true) const override; - virtual bool canRepair(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canBurrow(bool checkCommandibility = true) const override; - virtual bool canUnburrow(bool checkCommandibility = true) const override; - virtual bool canCloak(bool checkCommandibility = true) const override; - virtual bool canDecloak(bool checkCommandibility = true) const override; - virtual bool canSiege(bool checkCommandibility = true) const override; - virtual bool canUnsiege(bool checkCommandibility = true) const override; - virtual bool canLift(bool checkCommandibility = true) const override; - virtual bool canLand(bool checkCommandibility = true) const override; - virtual bool canLand(TilePosition target, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canLoad(bool checkCommandibility = true) const override; - virtual bool canLoad(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canUnloadWithOrWithoutTarget(bool checkCommandibility = true) const override; - virtual bool canUnloadAtPosition(Position targDropPos, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canUnload(bool checkCommandibility = true) const override; - virtual bool canUnload(Unit targetUnit, bool checkCanTargetUnit = true, bool checkPosition = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canUnloadAll(bool checkCommandibility = true) const override; - virtual bool canUnloadAllPosition(bool checkCommandibility = true) const override; - virtual bool canUnloadAllPosition(Position targDropPos, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canRightClick(bool checkCommandibility = true) const override; - virtual bool canRightClick(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canRightClickGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canRightClickGrouped(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canRightClickPosition(bool checkCommandibility = true) const override; - virtual bool canRightClickPositionGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canRightClickUnit(bool checkCommandibility = true) const override; - virtual bool canRightClickUnit(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canRightClickUnitGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canRightClickUnitGrouped(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canHaltConstruction(bool checkCommandibility = true) const override; - virtual bool canCancelConstruction(bool checkCommandibility = true) const override; - virtual bool canCancelAddon(bool checkCommandibility = true) const override; - virtual bool canCancelTrain(bool checkCommandibility = true) const override; - virtual bool canCancelTrainSlot(bool checkCommandibility = true) const override; - virtual bool canCancelTrainSlot(int slot, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canCancelMorph(bool checkCommandibility = true) const override; - virtual bool canCancelResearch(bool checkCommandibility = true) const override; - virtual bool canCancelUpgrade(bool checkCommandibility = true) const override; - virtual bool canUseTechWithOrWithoutTarget(bool checkCommandibility = true) const override; - virtual bool canUseTechWithOrWithoutTarget(BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canUseTech(BWAPI::TechType tech, PositionOrUnit target = nullptr, bool checkCanTargetUnit = true, bool checkTargetsType = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canUseTechWithoutTarget(BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canUseTechUnit(BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canUseTechUnit(BWAPI::TechType tech, Unit targetUnit, bool checkCanTargetUnit = true, bool checkTargetsUnits = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canUseTechPosition(BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canUseTechPosition(BWAPI::TechType tech, Position target, bool checkTargetsPositions = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canPlaceCOP(bool checkCommandibility = true) const override; - virtual bool canPlaceCOP(TilePosition target, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - - virtual bool canIssueCommandType(BWAPI::UnitCommandType ct, bool checkCommandibility = true) const override; - virtual bool canIssueCommandTypeGrouped(BWAPI::UnitCommandType ct, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - virtual bool canIssueCommand(UnitCommand command, bool checkCanUseTechPositionOnPositions = true, bool checkCanUseTechUnitOnUnits = true, bool checkCanBuildUnitType = true, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const override; - virtual bool canIssueCommandGrouped(UnitCommand command, bool checkCanUseTechPositionOnPositions = true, bool checkCanUseTechUnitOnUnits = true, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const override; - - virtual bool issueCommand(UnitCommand command) override; - }; -} diff --git a/bwapi4-includes/BWAPI/Color.h b/bwapi4-includes/BWAPI/Color.h deleted file mode 100644 index e162569..0000000 --- a/bwapi4-includes/BWAPI/Color.h +++ /dev/null @@ -1,223 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// The Color object is used in drawing routines to specify the color to use. - /// - /// @note Starcraft uses a 256 color palette for rendering. Thus, the colors available are - /// limited to this palette. - /// - /// @see Colors - /// @ingroup TypeClasses - class Color : public Type - { - public: - /// A constructor that uses the color at the specified palette index. - /// - /// - /// The index of the color in the 256-color palette. - /// - Color(int id = 0); - - /// A constructor that uses the color index in the palette that is closest to the - /// given rgb values. On its first call, the colors in the palette will be sorted - /// for fast indexing. - /// - /// @note This function computes the distance of the RGB values and may not be accurate. - /// - /// - /// The amount of red. - /// - /// - /// The amount of green. - /// - /// - /// The amount of blue. - /// - Color(int red, int green, int blue); - - /// Retrieves the red component of the color. - /// - /// @returns integer containing the value of the red component. - int red() const; - - /// Retrieves the green component of the color. - /// - /// @returns integer containing the value of the green component. - int green() const; - - /// Retrieves the blue component of the color. - /// - /// @returns integer containing the value of the blue component. - int blue() const; - }; - - /// Namespace containing known colors. - /// @see Color - /// @ingroup Types - namespace Colors - { - /// The default color for Player 1. - extern const Color Red; - - /// The default color for Player 2. - extern const Color Blue; - - /// The default color for Player 3. - extern const Color Teal; - - /// The default color for Player 4. - extern const Color Purple; - - /// The default color for Player 5. - extern const Color Orange; - - /// The default color for Player 6. - extern const Color Brown; - - /// A bright white. Note that this is lighter than Player 7's white. - extern const Color White; - - /// The default color for Player 8. - extern const Color Yellow; - - /// The alternate color for Player 7 on Ice tilesets. - extern const Color Green; - - /// The default color for Neutral (Player 12). - extern const Color Cyan; - - /// The color black - extern const Color Black; - - /// The color grey - extern const Color Grey; - } - - /// Namespace containing text formatting codes. Such codes are used in calls - /// to Game::drawText, Game::printf, and Broodwar::operator<< - namespace Text - { - /// Enumeration of text formatting codes - enum Enum - { - /// Uses the previous color that was specified before the current one. - Previous = 1, - - /// Uses the default blueish color. This color is used in standard game messages. - Default = 2, - - /// A solid yellow. This yellow is used in notifications and is also the default - /// color when printing text to Broodwar. - Yellow = 3, - - /// A bright white. This is used for timers. - White = 4, - - /// A dark grey. This color code will override all color formatting that follows. - Grey = 5, - - /// A deep red. This color code is used for error messages. - Red = 6, - - /// A solid green. This color is used for sent messages and resource counters. - Green = 7, - - /// A type of red. This color is used to color the name of the red player. - BrightRed = 8, - - /// This code hides all text and formatting that follows. - Invisible = 11, - - /// A deep blue. This color is used to color the name of the blue player. - Blue = 14, - - /// A teal color. This color is used to color the name of the teal player. - Teal = 15, - - /// A deep purple. This color is used to color the name of the purple player. - Purple = 16, - - /// A solid orange. This color is used to color the name of the orange player. - Orange = 17, - - /// An alignment directive that aligns the text to the right side of the screen. - Align_Right = 18, - - /// An alignment directive that aligns the text to the center of the screen. - Align_Center = 19, - - /// @copydoc Invisible - Invisible2 = 20, - - /// A dark brown. This color is used to color the name of the brown player. - Brown = 21, - - /// A dirty white. This color is used to color the name of the white player. - PlayerWhite = 22, - - /// A deep yellow. This color is used to color the name of the yellow player. - PlayerYellow = 23, - - /// A dark green. This color is used to color the name of the green player. - DarkGreen = 24, - - /// A bright yellow. - LightYellow = 25, - - /// A cyan color. Similar to Default. - Cyan = 26, - - /// A tan color. - Tan = 27, - - /// A dark blueish color. - GreyBlue = 28, - - /// A type of Green. - GreyGreen = 29, - - /// A different type of Cyan. - GreyCyan = 30, - - /// A bright blue color. - Turquoise = 31 - }; - - /// Namespace containing text sizes. - namespace Size - { - /// Enumeration of available text sizes - enum Enum - { - /// The smallest text size in the game. - Small, - - /// The standard text size, used for most things in the game such as chat messages. - Default, - - /// A larger text size. This size is used for the in-game countdown timer seen in @CTF and @UMS game types. - Large, - - /// The largest text size in the game. - Huge - }; - } - - /// Standard output stream operator for text formatting codes. This is - /// used to correctly format the codes for output. - /// - /// - /// Reference to destination output stream. - /// - /// - /// Reference to the Text formatting code to insert into the output stream. - /// - /// - /// @returns Reference to the \p out parameter that was passed in. - std::ostream &operator << (std::ostream &out, const Text::Enum &t); - } - - static_assert(sizeof(Color) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/ComparisonFilter.h b/bwapi4-includes/BWAPI/ComparisonFilter.h deleted file mode 100644 index 15aa49b..0000000 --- a/bwapi4-includes/BWAPI/ComparisonFilter.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once -// Prevent warnings if someone includes windows.h -#ifdef max -#undef max -#endif - -#include -#include - -#include "UnaryFilter.h" - -#define BWAPI_COMPARE_FILTER_OP(op) UnaryFilter operator op(const RType &cmp) const \ - { return [=](PType v)->bool{ return (*this)(v) op cmp; }; } - -#define BWAPI_ARITHMATIC_FILTER_OP(op) template \ - CompareFilter > operator op(const T &other) const \ - { return [=](PType v)->int{ return (*this)(v) op other(v); }; } \ - CompareFilter > operator op(RType other) const \ - { return [=](PType v)->int{ return (*this)(v) op other; }; } - -namespace BWAPI -{ - /// The CompareFilter is a container in which a stored function predicate returns a - /// value. Arithmetic and bitwise operators will return a new CompareFilter that - /// applies the operation to the result of the original functor. If any relational operators are - /// used, then it creates a UnaryFilter that returns the result of the operation. - /// - /// @tparam PType - /// The parameter type, which is the type passed into the functor. - /// @tparam RType (optional) - /// The functor's return type. It is int by default. - /// @tparam Container (optional) - /// Storage container for the function predicate. It is std::function by default. - template < typename PType, typename RType=int, class Container = std::function > - class CompareFilter - { - private: - Container pred; - public: - // ctor - template - CompareFilter(const T &predicate) : pred(predicate) {} - - // Default copy/move ctor/assign and dtor - - // Comparison operators - BWAPI_COMPARE_FILTER_OP(==); - BWAPI_COMPARE_FILTER_OP(!=); - BWAPI_COMPARE_FILTER_OP(<=); - BWAPI_COMPARE_FILTER_OP(>=); - BWAPI_COMPARE_FILTER_OP(<); - BWAPI_COMPARE_FILTER_OP(>); - - // Arithmetic operators - BWAPI_ARITHMATIC_FILTER_OP(+); - BWAPI_ARITHMATIC_FILTER_OP(-); - BWAPI_ARITHMATIC_FILTER_OP(|); - BWAPI_ARITHMATIC_FILTER_OP(&); - BWAPI_ARITHMATIC_FILTER_OP(*); - BWAPI_ARITHMATIC_FILTER_OP(^); - - // Division - template - CompareFilter > operator /(const T &other) const - { - return [=](PType v)->int{ int rval = other(v); - return rval == 0 ? std::numeric_limits::max() : (*this)(v) / rval; - }; - }; - - // Modulus - template - CompareFilter > operator %(const T &other) const - { - return [=](PType v)->int{ int rval = other(v); - return rval == 0 ? 0 : (*this)(v) % rval; - }; - }; - - // call - inline RType operator()(PType u) const - { - return pred(u); - }; - - inline bool isValid() const - { - return (bool)pred; - }; - }; -} - diff --git a/bwapi4-includes/BWAPI/Constants.h b/bwapi4-includes/BWAPI/Constants.h deleted file mode 100644 index b5821df..0000000 --- a/bwapi4-includes/BWAPI/Constants.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -namespace BWAPI -{ - /** Used for converting between TilePosition coordinates and Position coordinates. */ - #define TILE_SIZE 32 -} diff --git a/bwapi4-includes/BWAPI/CoordinateType.h b/bwapi4-includes/BWAPI/CoordinateType.h deleted file mode 100644 index cfbc28f..0000000 --- a/bwapi4-includes/BWAPI/CoordinateType.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -namespace BWAPI -{ - /// Contains the coordinate type enumeration for relative drawing positions. - namespace CoordinateType - { - /// The coordinate type enumeration, used to indicate relative drawing positions. - enum Enum - { - /// A default value for uninitialized coordinate types. - None = 0, - - /// Positions::Origin (0,0) corresponds to the top left corner of the screen. - Screen = 1, - - /// Positions::Origin (0,0) corresponds to the top left corner of the map. - Map = 2, - - /// Positions::Origin (0,0) corresponds to the location of the mouse cursor. - Mouse = 3, - }; - } -} diff --git a/bwapi4-includes/BWAPI/DamageType.h b/bwapi4-includes/BWAPI/DamageType.h deleted file mode 100644 index 6c9d9b1..0000000 --- a/bwapi4-includes/BWAPI/DamageType.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// Namespace containing damage types. - /// - /// @see DamageType - /// - /// [View on Liquipedia](http://wiki.teamliquid.net/starcraft/Damage_Type)
- /// [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)
- /// [View on Starcraft Wikia](http://starcraft.wikia.com/wiki/Damage_types)
- namespace DamageTypes - { - /// Enumeration of damage types. - /// @see DamageType - namespace Enum - { - /// Enumeration of damage types. - /// @see DamageType - enum Enum - { - Independent, - Explosive, - Concussive, - Normal, - Ignore_Armor, - None, - Unknown, - MAX - }; - } - } - /// Damage types are used in Broodwar to determine the amount of damage that will be - /// done to a unit. This corresponds with UnitSizeType to determine the damage done to - /// a unit. - /// - /// @see WeaponType, DamageTypes, UnitSizeType - /// - /// [View on Liquipedia](http://wiki.teamliquid.net/starcraft/Damage_Type)
- /// [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)
- /// [View on Starcraft Wikia](http://starcraft.wikia.com/wiki/Damage_types)
- /// - /// @ingroup TypeClasses - class DamageType : public Type - { - public: - /// @copydoc Type::Type(int) - DamageType(int id = DamageTypes::Enum::None); - }; - - /// @ingroup Types - namespace DamageTypes - { - /// Retrieves the set of all the DamageTypes. - /// - /// @returns Set of DamageTypes. - const DamageType::set& allDamageTypes(); - - extern const DamageType Independent; - extern const DamageType Explosive; - extern const DamageType Concussive; - extern const DamageType Normal; - extern const DamageType Ignore_Armor; - extern const DamageType None; - extern const DamageType Unknown; - } - - static_assert(sizeof(DamageType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/Error.h b/bwapi4-includes/BWAPI/Error.h deleted file mode 100644 index 79b7d36..0000000 --- a/bwapi4-includes/BWAPI/Error.h +++ /dev/null @@ -1,106 +0,0 @@ -#pragma once -#include -#include - -namespace BWAPI -{ - class UnitType; - - /// Namespace containing error codes - /// @see Error - namespace Errors - { - /// Enumeration of Error types. - /// @see Error - namespace Enum - { - /// Enumeration of Error types. - /// @see Error - enum Enum - { - Unit_Does_Not_Exist, - Unit_Not_Visible, - Unit_Not_Owned, - Unit_Busy, - Incompatible_UnitType, - Incompatible_TechType, - Incompatible_State, - Already_Researched, - Fully_Upgraded, - Currently_Researching, - Currently_Upgrading, - Insufficient_Minerals, - Insufficient_Gas, - Insufficient_Supply, - Insufficient_Energy, - Insufficient_Tech, - Insufficient_Ammo, - Insufficient_Space, - Invalid_Tile_Position, - Unbuildable_Location, - Unreachable_Location, - Out_Of_Range, - Unable_To_Hit, - Access_Denied, - File_Not_Found, - Invalid_Parameter, - None, - Unknown, - MAX - }; - }; - }; - - /// The Error object is generally used to determine why certain functions in BWAPI - /// have failed. - /// - /// For example, you may not have enough resources to construct a unit. - /// @see Game::getLastError, Game::setLastError, Errors - /// @ingroup TypeClasses - class Error : public Type - { - public: - /// @copydoc Type::Type(int) - Error(int id = Errors::Enum::None); - }; - - /// @ingroup Types - namespace Errors - { - /// Retrieves the set of all the error codes. - /// - /// @returns Set of error types. - const Error::set& allErrors(); - - extern const Error Unit_Does_Not_Exist; - extern const Error Unit_Not_Visible; - extern const Error Unit_Not_Owned; - extern const Error Unit_Busy; - extern const Error Incompatible_UnitType; - extern const Error Incompatible_TechType; - extern const Error Incompatible_State; - extern const Error Already_Researched; - extern const Error Fully_Upgraded; - extern const Error Currently_Researching; - extern const Error Currently_Upgrading; - extern const Error Insufficient_Minerals; - extern const Error Insufficient_Gas; - extern const Error Insufficient_Supply; - extern const Error Insufficient_Energy; - extern const Error Insufficient_Tech; - extern const Error Insufficient_Ammo; - extern const Error Insufficient_Space; - extern const Error Invalid_Tile_Position; - extern const Error Unbuildable_Location; - extern const Error Unreachable_Location; - extern const Error Out_Of_Range; - extern const Error Unable_To_Hit; - extern const Error Access_Denied; - extern const Error File_Not_Found; - extern const Error Invalid_Parameter; - extern const Error None; - extern const Error Unknown; - } - - static_assert(sizeof(Error) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/Event.h b/bwapi4-includes/BWAPI/Event.h deleted file mode 100644 index 4828865..0000000 --- a/bwapi4-includes/BWAPI/Event.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once -#include -#include -#include - -#include - -namespace BWAPI -{ - // Forward Declarations - class PlayerInterface; - typedef PlayerInterface* Player; - - class Event - { - public: - Event() = default; - ~Event(); - Event(const Event& other); - Event(Event&& other); - Event& operator=(const Event& other); - Event& operator=(Event &&other); - bool operator==(const Event& other) const; - static Event MatchStart(); - static Event MatchEnd(bool isWinner); - static Event MatchFrame(); - static Event MenuFrame(); - static Event SendText(const char* text = nullptr); - static Event ReceiveText(Player player, const char* text = nullptr); - static Event PlayerLeft(Player player); - static Event NukeDetect(Position target); - static Event UnitDiscover(Unit unit); - static Event UnitEvade(Unit unit); - static Event UnitShow(Unit unit); - static Event UnitHide(Unit unit); - static Event UnitCreate(Unit unit); - static Event UnitDestroy(Unit unit); - static Event UnitMorph(Unit unit); - static Event UnitRenegade(Unit unit); - static Event SaveGame(const char* gameName = nullptr); - static Event UnitComplete(Unit unit); - EventType::Enum getType() const; - Position getPosition() const; - const std::string& getText() const; - Unit getUnit() const; - Player getPlayer() const; - bool isWinner() const; - - Event& setType(EventType::Enum type); - Event& setPosition(Position position); - Event& setText(const char* text); - Event& setUnit(Unit unit); - Event& setPlayer(Player player); - Event& setWinner(bool isWinner); - //static Event TriggerAction(); - private: - Position position = Positions::None; - std::string* text = nullptr; - Unit unit = nullptr; - Player player = nullptr; - EventType::Enum type = EventType::None; - bool winner = false; - }; -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/EventType.h b/bwapi4-includes/BWAPI/EventType.h deleted file mode 100644 index aeef475..0000000 --- a/bwapi4-includes/BWAPI/EventType.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once -namespace BWAPI -{ - /// Contains a list of event types supported by BWAPI. - namespace EventType - { - /// Enumeration of callback event types. - enum Enum - { - MatchStart, - MatchEnd, - MatchFrame, - MenuFrame, - SendText, - ReceiveText, - PlayerLeft, - NukeDetect, - UnitDiscover, - UnitEvade, - UnitShow, - UnitHide, - UnitCreate, - UnitDestroy, - UnitMorph, - UnitRenegade, - SaveGame, - UnitComplete, - //TriggerAction, - None - }; - } -} diff --git a/bwapi4-includes/BWAPI/ExplosionType.h b/bwapi4-includes/BWAPI/ExplosionType.h deleted file mode 100644 index 1002ca8..0000000 --- a/bwapi4-includes/BWAPI/ExplosionType.h +++ /dev/null @@ -1,96 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// Namespace containing explosion types. - /// @see ExplosionType - namespace ExplosionTypes - { - /// Enumeration of explosion types. - /// @see ExplosionType - namespace Enum - { - /// Enumeration of explosion types. - /// @see ExplosionType - enum Enum - { - None = 0, - Normal, - Radial_Splash, - Enemy_Splash, - Lockdown, - Nuclear_Missile, - Parasite, - Broodlings, - EMP_Shockwave, - Irradiate, - Ensnare, - Plague, - Stasis_Field, - Dark_Swarm, - Consume, - Yamato_Gun, - Restoration, - Disruption_Web, - Corrosive_Acid, - Mind_Control, - Feedback, - Optical_Flare, - Maelstrom, - Unused, - Air_Splash, - Unknown, - MAX - }; - }; - }; - /// A representation of a weapon's explosion type. This indicates how the - /// weapon behaves, such as if it deals splash damage or causes an effect to occur. - /// - /// @see ExplosionTypes - /// @ingroup TypeClasses - class ExplosionType : public Type - { - public: - /// @copydoc Type::Type(int) - ExplosionType(int id = ExplosionTypes::Enum::None); - }; - - /// @ingroup Types - namespace ExplosionTypes - { - /// Retrieves the set of all valid ExplosionTypes. - /// - /// @returns Set of ExplosionTypes. - const ExplosionType::set& allExplosionTypes(); - - extern const ExplosionType None; - extern const ExplosionType Normal; - extern const ExplosionType Radial_Splash; - extern const ExplosionType Enemy_Splash; - extern const ExplosionType Lockdown; - extern const ExplosionType Nuclear_Missile; - extern const ExplosionType Parasite; - extern const ExplosionType Broodlings; - extern const ExplosionType EMP_Shockwave; - extern const ExplosionType Irradiate; - extern const ExplosionType Ensnare; - extern const ExplosionType Plague; - extern const ExplosionType Stasis_Field; - extern const ExplosionType Dark_Swarm; - extern const ExplosionType Consume; - extern const ExplosionType Yamato_Gun; - extern const ExplosionType Restoration; - extern const ExplosionType Disruption_Web; - extern const ExplosionType Corrosive_Acid; - extern const ExplosionType Mind_Control; - extern const ExplosionType Feedback; - extern const ExplosionType Optical_Flare; - extern const ExplosionType Maelstrom; - extern const ExplosionType Air_Splash; - extern const ExplosionType Unknown; - } - - static_assert(sizeof(ExplosionType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/Filters.h b/bwapi4-includes/BWAPI/Filters.h deleted file mode 100644 index b63fcb5..0000000 --- a/bwapi4-includes/BWAPI/Filters.h +++ /dev/null @@ -1,476 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include - -namespace BWAPI -{ - // forwards - class PlayerInterface; - typedef PlayerInterface *Player; - class UnitType; - class UnitInterface; - typedef UnitInterface *Unit; - - // typedefs - typedef UnaryFilter UnitFilter; - typedef UnaryFilter PtrUnitFilter; - typedef BestFilter BestUnitFilter; - typedef CompareFilter PtrIntCompareUnitFilter; - - namespace Filter - { - /// A unary filter that checks if the unit type is a transport. - extern const PtrUnitFilter IsTransport; - - /// @see BWAPI::UnitType::canProduce - extern const PtrUnitFilter CanProduce; - - /// @see BWAPI::UnitType::canAttack - extern const PtrUnitFilter CanAttack; - - /// @see BWAPI::UnitType::canMove - extern const PtrUnitFilter CanMove; - - /// @see BWAPI::UnitType::isFlying - extern const PtrUnitFilter IsFlyer; - - /// @see BWAPI::UnitInterface::IsFlying - extern const PtrUnitFilter IsFlying; - - /// @see BWAPI::UnitType::regeneratesHP - extern const PtrUnitFilter RegeneratesHP; - - /// @see BWAPI::UnitType::isSpellcaster - extern const PtrUnitFilter IsSpellcaster; - - /// @see BWAPI::UnitType::hasPermanentCloak - extern const PtrUnitFilter HasPermanentCloak; - - /// @see BWAPI::UnitType::isOrganic - extern const PtrUnitFilter IsOrganic; - - /// @see BWAPI::UnitType::isMechanical - extern const PtrUnitFilter IsMechanical; - - /// @see BWAPI::UnitType::isRobotic - extern const PtrUnitFilter IsRobotic; - - /// @see BWAPI::UnitType::isDetector - extern const PtrUnitFilter IsDetector; - - /// @see BWAPI::UnitType::isResourceContainer - extern const PtrUnitFilter IsResourceContainer; - - /// @see BWAPI::UnitType::isResourceDepot - extern const PtrUnitFilter IsResourceDepot; - - /// @see BWAPI::UnitType::isRefinery - extern const PtrUnitFilter IsRefinery; - - /// @see BWAPI::UnitType::isWorker - extern const PtrUnitFilter IsWorker; - - /// @see BWAPI::UnitType::requiresPsi - extern const PtrUnitFilter RequiresPsi; - - /// @see BWAPI::UnitType::requiresCreep - extern const PtrUnitFilter RequiresCreep; - - /// @see BWAPI::UnitType::isBurrowable - extern const PtrUnitFilter IsBurrowable; - - /// @see BWAPI::UnitType::isCloakable - extern const PtrUnitFilter IsCloakable; - - /// @see BWAPI::UnitType::isBuilding - extern const PtrUnitFilter IsBuilding; - - /// @see BWAPI::UnitType::isAddon - extern const PtrUnitFilter IsAddon; - - /// @see BWAPI::UnitType::isFlyingBuilding - extern const PtrUnitFilter IsFlyingBuilding; - - /// @see BWAPI::UnitType::isNeutral - extern const PtrUnitFilter IsNeutral; - - /// @see BWAPI::UnitType::isHero - extern const PtrUnitFilter IsHero; - - /// @see BWAPI::UnitType::isPowerup - extern const PtrUnitFilter IsPowerup; - - /// @see BWAPI::UnitType::isBeacon - extern const PtrUnitFilter IsBeacon; - - /// @see BWAPI::UnitType::isFlagBeacon - extern const PtrUnitFilter IsFlagBeacon; - - /// @see BWAPI::UnitType::isSpecialBuilding - extern const PtrUnitFilter IsSpecialBuilding; - - /// @see BWAPI::UnitType::isSpell - extern const PtrUnitFilter IsSpell; - - /// @see BWAPI::UnitType::producesLarva - extern const PtrUnitFilter ProducesLarva; - - /// @see BWAPI::UnitType::isMineralField - extern const PtrUnitFilter IsMineralField; - - /// @see BWAPI::UnitType::isCritter - extern const PtrUnitFilter IsCritter; - - /// @see BWAPI::UnitType::canBuildAddon - extern const PtrUnitFilter CanBuildAddon; - - /// @see BWAPI::UnitInterface::getHitPoints - extern const PtrIntCompareUnitFilter HP; - - /// @see BWAPI::UnitType::maxHitPoints - extern const PtrIntCompareUnitFilter MaxHP; - - /// A comparison filter that retrieves the unit's HP percentage. The formula - /// is HP*100/MaxHP. - extern const PtrIntCompareUnitFilter HP_Percent; - - /// @see BWAPI::UnitInterface::getShields - extern const PtrIntCompareUnitFilter Shields; - - /// @see BWAPI::UnitType::maxShields - extern const PtrIntCompareUnitFilter MaxShields; - - /// A comparison filter that retrieves the unit's shields percentage. The - /// formula is Shields*100/MaxShields. - extern const PtrIntCompareUnitFilter Shields_Percent; - - /// @see BWAPI::UnitInterface::getEnergy - extern const PtrIntCompareUnitFilter Energy; - - /// @see BWAPI::PlayerInterface::maxEnergy - extern const PtrIntCompareUnitFilter MaxEnergy; - - /// A comparison filter that retrieves the unit's energy percentage. The - /// formula is Energy*100/MaxEnergy. - extern const PtrIntCompareUnitFilter Energy_Percent; - - /// @see BWAPI::PlayerInterface::armor - extern const PtrIntCompareUnitFilter Armor; - - /// @see BWAPI::UnitType::armorUpgrade - extern const CompareFilter ArmorUpgrade; - - /// @see BWAPI::UnitType::mineralPrice - extern const PtrIntCompareUnitFilter MineralPrice; - - /// @see BWAPI::UnitType::gasPrice - extern const PtrIntCompareUnitFilter GasPrice; - - /// @see BWAPI::UnitType::buildTime - extern const PtrIntCompareUnitFilter BuildTime; - - /// @see BWAPI::UnitType::supplyRequired - extern const PtrIntCompareUnitFilter SupplyRequired; - - /// @see BWAPI::UnitType::supplyProvided - extern const PtrIntCompareUnitFilter SupplyProvided; - - /// @see BWAPI::UnitType::spaceRequired - extern const PtrIntCompareUnitFilter SpaceRequired; - - /// @see BWAPI::UnitInterface::getSpaceRemaining - extern const PtrIntCompareUnitFilter SpaceRemaining; - - /// @see BWAPI::UnitType::spaceProvided - extern const PtrIntCompareUnitFilter SpaceProvided; - - /// @see BWAPI::UnitType::buildScore - extern const PtrIntCompareUnitFilter BuildScore; - - /// @see BWAPI::UnitType::destroyScore - extern const PtrIntCompareUnitFilter DestroyScore; - - /// @see BWAPI::PlayerInterface::topSpeed - extern const CompareFilter TopSpeed; - - /// @see BWAPI::PlayerInterface::sightRange - extern const PtrIntCompareUnitFilter SightRange; - - /// @see BWAPI::PlayerInterface::weaponDamageCooldown - extern const PtrIntCompareUnitFilter WeaponCooldown; - - /// @see BWAPI::UnitType::size - extern const CompareFilter SizeType; - - /// @see BWAPI::UnitType::groundWeapon - extern const CompareFilter GroundWeapon; - - /// @see BWAPI::UnitType::airWeapon - extern const CompareFilter AirWeapon; - - /// @see BWAPI::UnitInterface::getType - extern const CompareFilter GetType; - - /// @see BWAPI::UnitType::getRace - extern const CompareFilter GetRace; - - /// @see BWAPI::UnitInterface::getPlayer - extern const CompareFilter GetPlayer; - - /// @see BWAPI::UnitInterface::getResources - extern const PtrIntCompareUnitFilter Resources; - - /// @see BWAPI::UnitInterface::getResourceGroup - extern const PtrIntCompareUnitFilter ResourceGroup; - - /// @see BWAPI::UnitInterface::getAcidSporeCount - extern const PtrIntCompareUnitFilter AcidSporeCount; - - /// @see BWAPI::UnitInterface::getInterceptorCount - extern const PtrIntCompareUnitFilter InterceptorCount; - - /// @see BWAPI::UnitInterface::getScarabCount - extern const PtrIntCompareUnitFilter ScarabCount; - - /// @see BWAPI::UnitInterface::getSpiderMineCount - extern const PtrIntCompareUnitFilter SpiderMineCount; - - /// @see BWAPI::UnitInterface::getGroundWeaponCooldown - extern const PtrIntCompareUnitFilter MaxWeaponCooldown; - - /// @see BWAPI::UnitInterface::getSpellCooldown - extern const PtrIntCompareUnitFilter SpellCooldown; - - /// @see BWAPI::UnitInterface::getDefenseMatrixPoints - extern const PtrIntCompareUnitFilter DefenseMatrixPoints; - - /// @see BWAPI::UnitInterface::getDefenseMatrixTimer - extern const PtrIntCompareUnitFilter DefenseMatrixTime; - - /// @see BWAPI::UnitInterface::getEnsnareTimer - extern const PtrIntCompareUnitFilter EnsnareTime; - - /// @see BWAPI::UnitInterface::getIrradiateTimer - extern const PtrIntCompareUnitFilter IrradiateTime; - - /// @see BWAPI::UnitInterface::getLockdownTimer - extern const PtrIntCompareUnitFilter LockdownTime; - - /// @see BWAPI::UnitInterface::getMaelstromTimer - extern const PtrIntCompareUnitFilter MaelstromTime; - - /// @see BWAPI::UnitInterface::getOrderTimer - extern const PtrIntCompareUnitFilter OrderTime; - - /// @see BWAPI::UnitInterface::getPlagueTimer - extern const PtrIntCompareUnitFilter PlagueTimer; - - /// @see BWAPI::UnitInterface::getRemoveTimer - extern const PtrIntCompareUnitFilter RemoveTime; - - /// @see BWAPI::UnitInterface::getStasisTimer - extern const PtrIntCompareUnitFilter StasisTime; - - /// @see BWAPI::UnitInterface::getStimTimer - extern const PtrIntCompareUnitFilter StimTime; - - /// @see BWAPI::UnitInterface::getBuildType - extern const CompareFilter BuildType; - - /// @see BWAPI::UnitInterface::getRemainingBuildTime - extern const PtrIntCompareUnitFilter RemainingBuildTime; - - /// @see BWAPI::UnitInterface::getRemainingTrainTime - extern const PtrIntCompareUnitFilter RemainingTrainTime; - - /// @see BWAPI::UnitInterface::getTarget - extern const CompareFilter Target; - - /// @see BWAPI::UnitInterface::getOrder - extern const CompareFilter CurrentOrder; - - /// @see BWAPI::UnitInterface::getSecondaryOrder - extern const CompareFilter SecondaryOrder; - - /// @see BWAPI::UnitInterface::getOrderTarget - extern const CompareFilter OrderTarget; - - /// @see BWAPI::UnitInterface::getLeft - extern const PtrIntCompareUnitFilter GetLeft; - - /// @see BWAPI::UnitInterface::getTop - extern const PtrIntCompareUnitFilter GetTop; - - /// @see BWAPI::UnitInterface::getRight - extern const PtrIntCompareUnitFilter GetRight; - - /// @see BWAPI::UnitInterface::getBottom - extern const PtrIntCompareUnitFilter GetBottom; - - /// @see BWAPI::UnitInterface::exists - extern const PtrUnitFilter Exists; - - /// @see BWAPI::UnitInterface::isAttacking - extern const PtrUnitFilter IsAttacking; - - /// @see BWAPI::UnitInterface::isBeingConstructed - extern const PtrUnitFilter IsBeingConstructed; - - /// @see BWAPI::UnitInterface::isBeingGathered - extern const PtrUnitFilter IsBeingGathered; - - /// @see BWAPI::UnitInterface::isBeingHealed - extern const PtrUnitFilter IsBeingHealed; - - /// @see BWAPI::UnitInterface::isBlind - extern const PtrUnitFilter IsBlind; - - /// @see BWAPI::UnitInterface::isBraking - extern const PtrUnitFilter IsBraking; - - /// @see BWAPI::UnitInterface::isBurrowed - extern const PtrUnitFilter IsBurrowed; - - /// @see BWAPI::UnitInterface::isCarryingGas - extern const PtrUnitFilter IsCarryingGas; - - /// @see BWAPI::UnitInterface::isCarryingMinerals - extern const PtrUnitFilter IsCarryingMinerals; - - /// A unary filter that checks if IsCarryingGas or IsCarryingMinerals return true. - extern const PtrUnitFilter IsCarryingSomething; - - /// @see BWAPI::UnitInterface::isCloaked - extern const PtrUnitFilter IsCloaked; - - /// @see BWAPI::UnitInterface::isCompleted - extern const PtrUnitFilter IsCompleted; - - /// @see BWAPI::UnitInterface::isConstructing - extern const PtrUnitFilter IsConstructing; - - /// @see BWAPI::UnitInterface::isDefenseMatrixed - extern const PtrUnitFilter IsDefenseMatrixed; - - /// @see BWAPI::UnitInterface::isDetected - extern const PtrUnitFilter IsDetected; - - /// @see BWAPI::UnitInterface::isEnsnared - extern const PtrUnitFilter IsEnsnared; - - /// @see BWAPI::UnitInterface::isFollowing - extern const PtrUnitFilter IsFollowing; - - /// @see BWAPI::UnitInterface::isGatheringGas - extern const PtrUnitFilter IsGatheringGas; - - /// @see BWAPI::UnitInterface::isGatheringMinerals - extern const PtrUnitFilter IsGatheringMinerals; - - /// @see BWAPI::UnitInterface::isHallucination - extern const PtrUnitFilter IsHallucination; - - /// @see BWAPI::UnitInterface::isHoldingPosition - extern const PtrUnitFilter IsHoldingPosition; - - /// @see BWAPI::UnitInterface::isIdle - extern const PtrUnitFilter IsIdle; - - /// @see BWAPI::UnitInterface::isInterruptible - extern const PtrUnitFilter IsInterruptible; - - /// @see BWAPI::UnitInterface::isInvincible - extern const PtrUnitFilter IsInvincible; - - /// @see BWAPI::UnitInterface::isIrradiated - extern const PtrUnitFilter IsIrradiated; - - /// @see BWAPI::UnitInterface::isLifted - extern const PtrUnitFilter IsLifted; - - /// @see BWAPI::UnitInterface::isLoaded - extern const PtrUnitFilter IsLoaded; - - /// @see BWAPI::UnitInterface::isLockedDown - extern const PtrUnitFilter IsLockedDown; - - /// @see BWAPI::UnitInterface::isMaelstrommed - extern const PtrUnitFilter IsMaelstrommed; - - /// @see BWAPI::UnitInterface::isMorphing - extern const PtrUnitFilter IsMorphing; - - /// @see BWAPI::UnitInterface::isMoving - extern const PtrUnitFilter IsMoving; - - /// @see BWAPI::UnitInterface::isParasited - extern const PtrUnitFilter IsParasited; - - /// @see BWAPI::UnitInterface::isPatrolling - extern const PtrUnitFilter IsPatrolling; - - /// @see BWAPI::UnitInterface::isPlagued - extern const PtrUnitFilter IsPlagued; - - /// @see BWAPI::UnitInterface::isRepairing - extern const PtrUnitFilter IsRepairing; - - /// @see BWAPI::UnitInterface::isResearching - extern const PtrUnitFilter IsResearching; - - /// @see BWAPI::UnitInterface::isSieged - extern const PtrUnitFilter IsSieged; - - /// @see BWAPI::UnitInterface::isStartingAttack - extern const PtrUnitFilter IsStartingAttack; - - /// @see BWAPI::UnitInterface::isStasised - extern const PtrUnitFilter IsStasised; - - /// @see BWAPI::UnitInterface::isStimmed - extern const PtrUnitFilter IsStimmed; - - /// @see BWAPI::UnitInterface::isStuck - extern const PtrUnitFilter IsStuck; - - /// @see BWAPI::UnitInterface::isTraining - extern const PtrUnitFilter IsTraining; - - /// @see BWAPI::UnitInterface::isUnderAttack - extern const PtrUnitFilter IsUnderAttack; - - /// @see BWAPI::UnitInterface::isUnderDarkSwarm - extern const PtrUnitFilter IsUnderDarkSwarm; - - /// @see BWAPI::UnitInterface::isUnderDisruptionWeb - extern const PtrUnitFilter IsUnderDisruptionWeb; - - /// @see BWAPI::UnitInterface::isUnderStorm - extern const PtrUnitFilter IsUnderStorm; - - /// @see BWAPI::UnitInterface::isPowered - extern const PtrUnitFilter IsPowered; - - /// @see BWAPI::UnitInterface::isVisible - extern const PtrUnitFilter IsVisible; - - /// A unary filter that checks if the current unit is an enemy of the BWAPI player. - /// @note This will always be false when the BWAPI Player is unspecified, such as in a replay. - extern const PtrUnitFilter IsEnemy; - - /// A unary filter that checks if the current unit is an ally of the BWAPI player. - /// @note This will always be false when the BWAPI Player is unspecified, such as in a replay. - extern const PtrUnitFilter IsAlly; - - /// A unary filter that checks if the current unit is owned by the BWAPI player. - /// @note This will always be false when the BWAPI Player is unspecified, such as in a replay. - extern const PtrUnitFilter IsOwned; - } -} - diff --git a/bwapi4-includes/BWAPI/Flag.h b/bwapi4-includes/BWAPI/Flag.h deleted file mode 100644 index def9295..0000000 --- a/bwapi4-includes/BWAPI/Flag.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -namespace BWAPI -{ - /// Contains flag enumerations for BWAPI. - /// @see Game::enableFlag, Game::isFlagEnabled - namespace Flag - { - /// Contains flag enumerations for BWAPI. - /// @see Game::enableFlag, Game::isFlagEnabled - enum Enum - { - /// Enable to get information about all units on the map, not just the visible units. - CompleteMapInformation = 0, - - /// Enable to get information from the user (what units are selected, chat messages - /// the user enters, etc) - UserInput = 1, - - /// The maximum number of different flags available. - Max - }; - } -} diff --git a/bwapi4-includes/BWAPI/Force.h b/bwapi4-includes/BWAPI/Force.h deleted file mode 100644 index 56ac1ef..0000000 --- a/bwapi4-includes/BWAPI/Force.h +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once -#include -#include - -namespace BWAPI -{ - // Forward Declarations - class Playerset; - - class ForceInterface; - typedef ForceInterface *Force; - - /// The Force class is used to get information about each force in a match. - /// Normally this is considered a team. - /// - /// @note It is not called a team because players on the same force do not necessarily need - /// to be allied at the beginning of a match. - /// - /// @ingroup Interface - class ForceInterface : public Interface - { - protected: - virtual ~ForceInterface() {}; - public : - /// Retrieves the unique ID that represents this Force. - /// - /// @returns - /// An integer containing the ID for the Force. - virtual int getID() const = 0; - - /// Retrieves the name of the Force. - /// - /// @returns - /// A std::string object containing the name of the force. - /// - /// Example usage: - /// @code - /// BWAPI::Force myForce = BWAPI::Broodwar->self()->getForce(); - /// if ( myForce->getName() == "Observers" ) - /// BWAPI::Broodwar << "Looks like we're observing a match." << std::endl; - /// @endcode - /// - /// @note Don't forget to use std::string::c_str() when passing this parameter to - /// Game::sendText and other variadic functions. - virtual std::string getName() const = 0; - - /// Retrieves the set of players that belong to this Force. - /// - /// @returns - /// A Playerset object containing the players that are part of this Force. - /// - /// Example usage: - /// @code - /// // Get the enemy force, but make sure we have an enemy - /// BWAPI::Force myEnemyForce = BWAPI::Broodwar->enemy() ? BWAPI::Broodwar->enemy()->getForce() : nullptr; - /// if ( myEnemyForce != nullptr ) - /// { - /// Broodwar << "The allies of my enemy are..." << std::endl; - /// for ( auto i = myEnemyForce.begin(); i != myEnemyForce.end(); ++i ) - /// Broodwar << " - " << i->getName() << std::endl; - /// } - /// @endcode - virtual Playerset getPlayers() const = 0; - }; -} diff --git a/bwapi4-includes/BWAPI/Forceset.h b/bwapi4-includes/BWAPI/Forceset.h deleted file mode 100644 index 5a94dab..0000000 --- a/bwapi4-includes/BWAPI/Forceset.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -#include "SetContainer.h" - -namespace BWAPI -{ - // Forward Declarations - class ForceInterface; - typedef ForceInterface *Force; - class Playerset; - - /// A container that holds a group of Forces. - /// - /// @see BWAPI::Force - class Forceset : public SetContainer> - { - public: - - /// @copydoc ForceInterface::getPlayers - Playerset getPlayers() const; - }; -} - diff --git a/bwapi4-includes/BWAPI/Game.h b/bwapi4-includes/BWAPI/Game.h deleted file mode 100644 index 2661abd..0000000 --- a/bwapi4-includes/BWAPI/Game.h +++ /dev/null @@ -1,1743 +0,0 @@ -#pragma once -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -namespace BWAPI -{ - // Forward Declarations - class Bulletset; - class Color; - class Event; - class ForceInterface; - typedef ForceInterface *Force; - class Forceset; - class GameType; - class PlayerInterface; - typedef PlayerInterface *Player; - class Playerset; - class Race; - - class RegionInterface; - typedef RegionInterface *Region; - - class Regionset; - class TechType; - class UnitCommand; - class Unitset; - class UpgradeType; - - /// The abstract Game class is implemented by BWAPI and is the primary means of obtaining all - /// game state information from Starcraft Broodwar. Game state information includes all units, - /// resources, players, forces, bullets, terrain, fog of war, regions, etc. - /// - /// @ingroup Interface - class Game : public Interface - { - protected: - virtual ~Game() {}; - - Game& operator=(const Game& other) = delete; - Game& operator=(Game&& other) = delete; - public : - /// Retrieves the set of all teams/forces. Forces are commonly seen in @UMS - /// game types and some others such as @TvB and the team versions of game types. - /// - /// @returns Forceset containing all forces in the game. - virtual const Forceset& getForces() const = 0; - - /// Retrieves the set of all players in the match. This includes the neutral - /// player, which owns all the resources and critters by default. - /// - /// @returns Playerset containing all players in the game. - virtual const Playerset& getPlayers() const = 0; - - /// Retrieves the set of all accessible units. If - /// Flag::CompleteMapInformation is enabled, then the set also includes units that are not - /// visible to the player. - /// - /// @note Units that are inside refineries are not included in this set. - /// - /// @returns Unitset containing all known units in the game. - virtual const Unitset& getAllUnits() const = 0; - - /// Retrieves the set of all accessible @minerals in the game. - /// - /// @returns Unitset containing @minerals - virtual const Unitset& getMinerals() const = 0; - - /// Retrieves the set of all accessible @geysers in the game. - /// - /// @returns Unitset containing @geysers - virtual const Unitset& getGeysers() const = 0; - - /// Retrieves the set of all accessible neutral units in the game. This - /// includes @minerals, @geysers, and @critters. - /// - /// @returns Unitset containing all neutral units. - virtual const Unitset& getNeutralUnits() const = 0; - - /// Retrieves the set of all @minerals that were available at the beginning of the - /// game. - /// - /// @note This set includes resources that have been mined out or are inaccessible. - /// - /// @returns Unitset containing static @minerals - virtual const Unitset& getStaticMinerals() const = 0; - - /// Retrieves the set of all @geysers that were available at the beginning of the - /// game. - /// - /// @note This set includes resources that are inaccessible. - /// - /// @returns Unitset containing static @geysers - virtual const Unitset& getStaticGeysers() const = 0; - - /// Retrieves the set of all units owned by the neutral player (resources, critters, - /// etc.) that were available at the beginning of the game. - /// - /// @note This set includes units that are inaccessible. - /// - /// @returns Unitset containing static neutral units - virtual const Unitset& getStaticNeutralUnits() const = 0; - - /// Retrieves the set of all accessible bullets. - /// - /// @returns Bulletset containing all accessible Bullet objects. - virtual const Bulletset& getBullets() const = 0; - - /// Retrieves the set of all accessible @Nuke dots. - /// - /// @note Nuke dots are the red dots painted by a @Ghost when using the nuclear strike ability. - /// - /// @returns Set of Positions giving the coordinates of nuke locations. - virtual const Position::list& getNukeDots() const = 0; - - /// Retrieves the list of all unhandled game events. - /// - /// @returns std::list containing Event objects. - virtual const std::list< Event >& getEvents() const = 0; - - /// Retrieves the Force interface object associated with a given identifier. - /// - /// - /// The identifier for the Force object. - /// - /// - /// @returns Force interface object mapped to the given \p forceID. - /// @retval nullptr if the given identifier is invalid. - virtual Force getForce(int forceID) const = 0; - - /// Retrieves the Player interface object associated with a given identifier. - /// - /// - /// The identifier for the Player object. - /// - /// - /// @returns Player interface object mapped to the given \p playerID. - /// @retval nullptr if the given identifier is invalid. - virtual Player getPlayer(int playerID) const = 0; - - /// Retrieves the Unit interface object associated with a given identifier. - /// - /// - /// The identifier for the Unit object. - /// - /// - /// @returns Unit interface object mapped to the given \p unitID. - /// @retval nullptr if the given identifier is invalid. - virtual Unit getUnit(int unitID) const = 0; - - /// Retrieves a Unit interface object from a given unit index. The value - /// given as an index maps directly to Broodwar's unit array index and matches the index found - /// in replay files. In order to use this function, CompleteMapInformation must be enabled. - /// - /// - /// The unitIndex to identify the Unit with. A valid index is 0 <= unitIndex & 0x7FF < 1700. - /// - /// - /// @returns Unit interface object that matches the given \p unitIndex. - /// @retval nullptr if the given index is invalid. - virtual Unit indexToUnit(int unitIndex) const = 0; - - /// Retrieves the Region interface object associated with a given identifier. - /// - /// - /// The identifier for the Region object. - /// - /// - /// @returns Region interface object mapped to the given \p regionID. - /// @retval nullptr if the given ID is invalid. - virtual Region getRegion(int regionID) const = 0; - - /// Retrieves the GameType of the current game. - /// - /// @returns GameType indicating the rules of the match. - /// @see GameType - virtual GameType getGameType() const = 0; - - /// Retrieves the current latency setting that the game is set to. Latency - /// indicates the delay between issuing a command and having it processed. - /// - /// @returns The latency setting of the game, which is of Latency::Enum. - /// @see Latency::Enum - /// - /// @todo Change return type to Latency::Enum without breaking everything. - virtual int getLatency() const = 0; - - /// Retrieves the number of logical frames since the beginning of the match. - /// If the game is paused, then getFrameCount will not increase. - /// - /// @returns Number of logical frames that have elapsed since the game started as an integer. - virtual int getFrameCount() const = 0; - - /// Retrieves the maximum number of logical frames that have been recorded in a - /// replay. If the game is not a replay, then the value returned is undefined. - /// - /// @returns The number of logical frames that the replay contains. - virtual int getReplayFrameCount() const = 0; - - /// Retrieves the logical frame rate of the game in frames per second (FPS). - /// - /// Example: - /// @code - /// BWAPI::Broodwar->setLocalSpeed(0); - /// - /// // Log and display the best logical FPS seen in the game - /// static int bestFPS = 0; - /// bestFPS = std::max(bestFPS, BWAPI::Broodwar->getFPS()); - /// BWAPI::Broodwar->drawTextScreen(BWAPI::Positions::Origin, "%cBest: %d GFPS\nCurrent: %d GFPS", BWAPI::Text::White, bestFPS, BWAPI::Broodwar->getFPS()); - /// @endcode - /// @returns Logical frames per second that the game is currently running at as an integer. - /// @see getAverageFPS - virtual int getFPS() const = 0; - - /// Retrieves the average logical frame rate of the game in frames per second (FPS). - /// - /// @returns Average logical frames per second that the game is currently running at as a - /// double. - /// @see getFPS - virtual double getAverageFPS() const = 0; - - /// Retrieves the position of the user's mouse on the screen, in Position coordinates. - /// - /// @returns Position indicating the location of the mouse. - /// @retval Positions::Unknown if Flag::UserInput is disabled. - virtual Position getMousePosition() const = 0; - - /// Retrieves the state of the given mouse button. - /// - /// - /// A MouseButton enum member indicating which button on the mouse to check. - /// - /// - /// @return A bool indicating the state of the given \p button. true if the button was pressed - /// and false if it was not. - /// @retval false always if Flag::UserInput is disabled. - /// - /// @see MouseButton - virtual bool getMouseState(MouseButton button) const = 0; - - /// Retrieves the state of the given keyboard key. - /// - /// - /// A Key enum member indicating which key on the keyboard to check. - /// - /// - /// @return A bool indicating the state of the given \p key. true if the key was pressed - /// and false if it was not. - /// @retval false always if Flag::UserInput is disabled. - /// - /// @see Key - virtual bool getKeyState(Key key) const = 0; - - /// Retrieves the top left position of the viewport from the top left corner of the - /// map, in pixels. - /// - /// @returns Position containing the coordinates of the top left corner of the game's viewport. - /// @retval Positions::Unknown always if Flag::UserInput is disabled. - /// @see setScreenPosition - virtual BWAPI::Position getScreenPosition() const = 0; - - /// Moves the top left corner of the viewport to the provided position relative to - /// the map's origin (top left (0,0)). - /// - /// - /// The x coordinate to move the screen to, in pixels. - /// - /// - /// The y coordinate to move the screen to, in pixels. - /// - /// @see getScreenPosition - virtual void setScreenPosition(int x, int y) = 0; - /// @overload - void setScreenPosition(BWAPI::Position p); - - /// Pings the minimap at the given position. Minimap pings are visible to - /// allied players. - /// - /// - /// The x coordinate to ping at, in pixels, from the map's origin (left). - /// - /// - /// The y coordinate to ping at, in pixels, from the map's origin (top). - /// - virtual void pingMinimap(int x, int y) = 0; - /// @overload - void pingMinimap(BWAPI::Position p); - - /// Checks if the state of the given flag is enabled or not. - /// - /// @note Flags may only be enabled at the start of the match during the AIModule::onStart - /// callback. - /// - /// - /// The Flag::Enum entry describing the flag's effects on BWAPI. - /// - /// - /// @returns true if the given \p flag is enabled, false if the flag is disabled. - /// - /// @see Flag::Enum - /// - /// @todo Take Flag::Enum as parameter instead of int - virtual bool isFlagEnabled(int flag) const = 0; - - /// Enables the state of a given flag. - /// - /// @note Flags may only be enabled at the start of the match during the AIModule::onStart - /// callback. - /// - /// - /// The Flag::Enum entry describing the flag's effects on BWAPI. - /// - /// - /// @see Flag::Enum - /// - /// @todo Take Flag::Enum as parameter instead of int - virtual void enableFlag(int flag) = 0; - - /// Retrieves the set of accessible units that are on a given build tile. - /// - /// - /// The X position, in tiles. - /// - /// - /// The Y position, in tiles. - /// - /// (optional) - /// A function predicate that indicates which units are included in the returned set. - /// - /// - /// @returns A Unitset object consisting of all the units that have any part of them on the - /// given build tile. - Unitset getUnitsOnTile(int tileX, int tileY, const UnitFilter &pred = nullptr) const; - /// @overload - Unitset getUnitsOnTile(BWAPI::TilePosition tile, const UnitFilter &pred = nullptr) const; - - /// Retrieves the set of accessible units that are in a given rectangle. - /// - /// - /// The X coordinate of the left position of the bounding box, in pixels. - /// - /// - /// The Y coordinate of the top position of the bounding box, in pixels. - /// - /// - /// The X coordinate of the right position of the bounding box, in pixels. - /// - /// - /// The Y coordinate of the bottom position of the bounding box, in pixels. - /// - /// (optional) - /// A function predicate that indicates which units are included in the returned set. - /// - /// - /// @returns A Unitset object consisting of all the units that have any part of them within the - /// given rectangle bounds. - virtual Unitset getUnitsInRectangle(int left, int top, int right, int bottom, const UnitFilter &pred = nullptr) const = 0; - /// @overload - Unitset getUnitsInRectangle(BWAPI::Position topLeft, BWAPI::Position bottomRight, const UnitFilter &pred = nullptr) const; - - /// Retrieves the set of accessible units that are within a given radius of a - /// position. - /// - /// - /// The x coordinate of the center, in pixels. - /// - /// - /// The y coordinate of the center, in pixels. - /// - /// - /// The radius from the center, in pixels, to include units. - /// - /// (optional) - /// A function predicate that indicates which units are included in the returned set. - /// - /// - /// @returns A Unitset object consisting of all the units that have any part of them within the - /// given radius from the center position. - Unitset getUnitsInRadius(int x, int y, int radius, const UnitFilter &pred = nullptr) const; - /// @overload - Unitset getUnitsInRadius(BWAPI::Position center, int radius, const UnitFilter &pred = nullptr) const; - - /// Retrieves the closest unit to center that matches the criteria of the callback - /// pred within an optional radius. - /// - /// - /// The position to start searching for the closest unit. - /// - /// (optional) - /// The UnitFilter predicate to determine which units should be included. This includes - /// all units by default. - /// - /// (optional) - /// The radius to search in. If omitted, the entire map will be searched. - /// - /// - /// @returns The desired unit that is closest to center. - /// @retval nullptr If a suitable unit was not found. - /// - /// @see getBestUnit, UnitFilter - Unit getClosestUnit(Position center, const UnitFilter &pred = nullptr, int radius = 999999) const; - - /// Retrieves the closest unit to center that matches the criteria of the callback - /// pred within an optional rectangle. - /// - /// - /// The position to start searching for the closest unit. - /// - /// (optional) - /// The UnitFilter predicate to determine which units should be included. This includes - /// all units by default. - /// - /// (optional) - /// The left position of the rectangle. This value is 0 by default. - /// - /// (optional) - /// The top position of the rectangle. This value is 0 by default. - /// - /// (optional) - /// The right position of the rectangle. This value includes the entire map width by default. - /// - /// (optional) - /// The bottom position of the rectangle. This value includes the entire map height by default. - /// - /// - /// @see UnitFilter - virtual Unit getClosestUnitInRectangle(Position center, const UnitFilter &pred = nullptr, int left = 0, int top = 0, int right = 999999, int bottom = 999999) const = 0; - - /// Compares all units with pred to determine which of them is the best. - /// All units are checked. If center and radius are specified, then it will check all units - /// that are within the radius of the position. - /// - /// - /// A BestUnitFilter that determines which parameters should be considered when calculating - /// which units are better than others. - /// - /// - /// A UnitFilter that determines which units to include in calculations. - /// - /// (optional) - /// The position to use in the search. If omitted, then the entire map is searched. - /// - /// (optional) - /// The distance from \p center to search for units. If omitted, then the entire map is - /// searched. - /// - /// - /// @returns The desired unit that best matches the given criteria. - /// @retval nullptr if a suitable unit was not found. - /// - /// @see getClosestUnit, BestUnitFilter, UnitFilter - virtual Unit getBestUnit(const BestUnitFilter &best, const UnitFilter &pred, Position center = Positions::Origin, int radius = 999999) const = 0; - - /// Returns the last error that was set using setLastError. If a function - /// call in BWAPI has failed, you can use this function to retrieve the reason it failed. - /// - /// @returns Error type containing the reason for failure. - /// - /// @see setLastError, Errors - virtual Error getLastError() const = 0; - - /// Sets the last error so that future calls to getLastError will return the value - /// that was set. - /// - /// (optional) - /// The error code to set. If omitted, then the last error will be cleared. - /// - /// - /// @retval true If the type passed was Errors::None, clearing the last error. - /// @retval false If any other error type was passed. - /// @see getLastError, Errors - virtual bool setLastError(BWAPI::Error e = Errors::None) const = 0; - - /// Retrieves the width of the map in build tile units. - /// - /// @returns Width of the map in tiles. - /// @see mapHeight - virtual int mapWidth() const = 0; - - /// Retrieves the height of the map in build tile units. - /// - /// @returns Height of the map in tiles. - /// @see mapHeight - virtual int mapHeight() const = 0; - - /// Retrieves the file name of the currently loaded map. - /// - /// @returns Map file name as std::string object. - /// - /// @see mapPathName, mapName - /// - /// @TODO: Note on campaign files. - virtual std::string mapFileName() const = 0; - - /// Retrieves the full path name of the currently loaded map. - /// - /// @returns Map file name as std::string object. - /// - /// @see mapFileName, mapName - /// - /// @TODO: Note on campaign files. - virtual std::string mapPathName() const = 0; - - /// Retrieves the title of the currently loaded map. - /// - /// @returns Map title as std::string object. - /// - /// @see mapFileName, mapPathName - virtual std::string mapName() const = 0; - - /// Calculates the SHA-1 hash of the currently loaded map file. - /// - /// @returns std::string object containing SHA-1 hash. - /// - /// @note Campaign maps will return a hash of their internal map chunk components(.chk), while - /// standard maps will return a hash of their entire map archive (.scm,.scx). - /// - /// @TODO: Note on replays. - virtual std::string mapHash() const = 0; - - /// Checks if the given mini-tile position is walkable. - /// - /// @note This function only checks if the static terrain is walkable. Its current occupied - /// state is excluded from this check. To see if the space is currently occupied or not, then - /// see #getUnitsInRectangle . - /// - /// - /// The x coordinate of the mini-tile, in mini-tile units (8 pixels). - /// - /// - /// The y coordinate of the mini-tile, in mini-tile units (8 pixels). - /// - /// - /// @returns true if the mini-tile is walkable and false if it is impassable for ground units. - virtual bool isWalkable(int walkX, int walkY) const = 0; - /// @overload - bool isWalkable(BWAPI::WalkPosition position) const; - - /// Returns the ground height at the given tile position. - /// - /// - /// X position to query, in tiles - /// - /// - /// Y position to query, in tiles - /// - /// - /// @returns The tile height as an integer. Possible values are: - /// - 0: Low ground - /// - 1: Low ground doodad - /// - 2: High ground - /// - 3: High ground doodad - /// - 4: Very high ground - /// - 5: Very high ground doodad - /// . - virtual int getGroundHeight(int tileX, int tileY) const = 0; - /// @overload - int getGroundHeight(TilePosition position) const; - - /// Checks if a given tile position is buildable. This means that, if all - /// other requirements are met, a structure can be placed on this tile. This function uses - /// static map data. - /// - /// - /// The x value of the tile to check. - /// - /// - /// The y value of the tile to check. - /// - /// (optional) - /// If this is true, then this function will also check if any visible structures are - /// occupying the space. If this value is false, then it only checks the static map data - /// for tile buildability. This value is false by default. - /// - /// - /// @returns boolean identifying if the given tile position is buildable (true) or not (false). - /// If \p includeBuildings was provided, then it will return false if a structure is currently - /// occupying the tile. - virtual bool isBuildable(int tileX, int tileY, bool includeBuildings = false) const = 0; - /// @overload - bool isBuildable(TilePosition position, bool includeBuildings = false) const; - - /// Checks if a given tile position is visible to the current player. - /// - /// - /// The x value of the tile to check. - /// - /// - /// The y value of the tile to check. - /// - /// - /// @returns boolean identifying the visibility of the tile. If the given tile is visible, then - /// the value is true. If the given tile is concealed by the fog of war, then this value will - /// be false. - virtual bool isVisible(int tileX, int tileY) const = 0; - /// @overload - bool isVisible(TilePosition position) const; - - /// Checks if a given tile position has been explored by the player. An - /// explored tile position indicates that the player has seen the location at some point in the - /// match, partially revealing the fog of war for the remainder of the match. - /// - /// - /// The x tile coordinate to check. - /// - /// - /// The y tile coordinate to check. - /// - /// - /// @retval true If the player has explored the given tile position (partially revealed fog). - /// @retval false If the tile position was never explored (completely black fog). - /// - /// @see isVisible - virtual bool isExplored(int tileX, int tileY) const = 0; - /// @overload - bool isExplored(TilePosition position) const; - - /// Checks if the given tile position has @Zerg creep on it. - /// - /// - /// The x tile coordinate to check. - /// - /// - /// The y tile coordinate to check. - /// - /// - /// @retval true If the given tile has creep on it. - /// @retval false If the given tile does not have creep, or if it is concealed by the fog of war. - virtual bool hasCreep(int tileX, int tileY) const = 0; - /// @overload - bool hasCreep(TilePosition position) const; - - /// Checks if the given pixel position is powered by an owned @Protoss_Pylon for an - /// optional unit type. - /// - /// - /// The x pixel coordinate to check. - /// - /// - /// The y pixel coordinate to check. - /// - /// (optional) - /// Checks if the given UnitType requires power or not. If ommitted, then it will assume - /// that the position requires power for any unit type. - /// - /// - /// @retval true if the type at the given position will have power. - /// @retval false if the type at the given position will be unpowered. - virtual bool hasPowerPrecise(int x, int y, UnitType unitType = UnitTypes::None ) const = 0; - /// @overload - bool hasPowerPrecise(Position position, UnitType unitType = UnitTypes::None) const; - - /// Checks if the given tile position if powered by an owned @Protoss_Pylon for an - /// optional unit type. - /// - /// - /// The x tile coordinate to check. - /// - /// - /// The y tile coordinate to check. - /// - /// (optional) - /// Checks if the given UnitType will be powered if placed at the given tile position. If - /// omitted, then only the immediate tile position is checked for power, and the function - /// will assume that the location requires power for any unit type. - /// - /// - /// @retval true if the type at the given tile position will receive power. - /// @retval false if the type will be unpowered at the given tile position. - bool hasPower(int tileX, int tileY, UnitType unitType = UnitTypes::None) const; - /// @overload - bool hasPower(TilePosition position, UnitType unitType = UnitTypes::None) const; - /// @overload - bool hasPower(int tileX, int tileY, int tileWidth, int tileHeight, UnitType unitType = UnitTypes::None) const; - /// @overload - bool hasPower(TilePosition position, int tileWidth, int tileHeight, UnitType unitType = UnitTypes::None) const; - - /// Checks if the given unit type can be built at the given build tile position. - /// This function checks for creep, power, and resource distance requirements in addition to - /// the tiles' buildability and possible units obstructing the build location. - /// - /// @note If the type is an addon and a builer is provided, then the location of the addon will - /// be placed 4 tiles to the right and 1 tile down from the given \p position. If the builder - /// is not given, then the check for the addon will be conducted at position. - /// - /// - /// Indicates the tile position that the top left corner of the structure is intended to go. - /// - /// - /// The UnitType to check for. - /// - /// (optional) - /// The intended unit that will build the structure. If specified, then this function will - /// also check if there is a path to the build site and exclude the builder from the set of - /// units that may be blocking the build site. - /// - /// (optional) - /// If this parameter is true, it will also check if the target position has been explored - /// by the current player. This value is false by default, ignoring the explored state of - /// the build site. - /// - /// - /// @returns true indicating that the structure can be placed at the given tile position, and - /// false if something may be obstructing the build location. - virtual bool canBuildHere(TilePosition position, UnitType type, Unit builder = nullptr, bool checkExplored = false) = 0; - - /// Checks all the requirements in order to make a given unit type for the current - /// player. These include resources, supply, technology tree, availability, and - /// required units. - /// - /// - /// The UnitType to check. - /// - /// (optional) - /// The Unit that will be used to build/train the provided unit \p type. If this value is - /// nullptr or excluded, then the builder will be excluded in the check. - /// - /// - /// @returns true indicating that the type can be made. If \p builder is provided, then it is - /// only true if \p builder can make the \p type. Otherwise it will return false, indicating - /// that the unit type can not be made. - virtual bool canMake(UnitType type, Unit builder = nullptr) const = 0; - - /// Checks all the requirements in order to research a given technology type for the - /// current player. These include resources, technology tree, availability, and - /// required units. - /// - /// - /// The TechType to check. - /// - /// (optional) - /// The Unit that will be used to research the provided technology \p type. If this value is - /// nullptr or excluded, then the unit will be excluded in the check. - /// - /// (optional) - /// TODO fill this in - /// - /// - /// @returns true indicating that the type can be researched. If \p unit is provided, then it is - /// only true if \p unit can research the \p type. Otherwise it will return false, indicating - /// that the technology can not be researched. - virtual bool canResearch(TechType type, Unit unit = nullptr, bool checkCanIssueCommandType = true) = 0; - - /// Checks all the requirements in order to upgrade a given upgrade type for the - /// current player. These include resources, technology tree, availability, and - /// required units. - /// - /// - /// The UpgradeType to check. - /// - /// (optional) - /// The Unit that will be used to upgrade the provided upgrade \p type. If this value is - /// nullptr or excluded, then the unit will be excluded in the check. - /// - /// (optional) - /// TODO fill this in - /// - /// - /// @returns true indicating that the type can be upgraded. If \p unit is provided, then it is - /// only true if \p unit can upgrade the \p type. Otherwise it will return false, indicating - /// that the upgrade can not be upgraded. - virtual bool canUpgrade(UpgradeType type, Unit unit = nullptr, bool checkCanIssueCommandType = true) = 0; - - /// Retrieves the set of all starting locations for the current map. A - /// starting location is essentially a candidate for a player's spawn point. - /// - /// @returns A TilePosition::list containing all the TilePosition objects that indicate a start - /// location. - /// @see PlayerInterface::getStartLocation - virtual const TilePosition::list& getStartLocations() const = 0; - - /// Prints text to the screen as a notification. This function allows text - /// formatting using Text::Enum members. The behaviour of this function is the same as printf, - /// located in header cstdio. - /// - /// @note That text printed through this function is not seen by other players or in replays. - /// - /// - /// Text formatting. See std::printf for more information. Refrain from passing non-constant - /// strings directly in this parameter. - /// - /// - /// The arguments that will be formatted using the given text formatting. - /// - /// - /// @see Text::Enum, std::printf - void printf(const char *format, ...); - - /// @copydoc printf - /// - /// This function is intended to forward an already-existing argument list. - /// - /// - /// The argument list that will be formatted. - /// - /// - /// @see printf - virtual void vPrintf(const char *format, va_list args) = 0; - - /// Sends a text message to all other players in the game. The behaviour of - /// this function is the same as std::printf, located in header cstdio. - /// - /// @note In a single player game this function can be used to execute cheat codes. - /// - /// - /// Text formatting. See std::printf for more information. Refrain from passing non-constant - /// strings directly in this parameter. - /// - /// - /// @see sendTextEx, std::printf - void sendText(const char *format, ...); - - /// @copydoc sendText - /// - /// This function is intended to forward an already-existing argument list. - /// - /// - /// The argument list that will be formatted. - /// - /// - /// @see sendText - void vSendText(const char *format, va_list args); - - /// An extended version of Game::sendText which allows messages to be forwarded to - /// allies. The behaviour of this function is the same as std::printf, located in - /// header cstdio. - /// - /// - /// If this parameter is set to true, then the message is only sent to allied players, - /// otherwise it will be sent to all players. - /// - /// - /// Text formatting. See std::printf for more information. Refrain from passing non-constant - /// strings directly in this parameter. - /// - /// - /// @see sendText, std::printf - void sendTextEx(bool toAllies, const char *format, ...); - - /// @copydoc sendTextEx - /// - /// This function is intended to forward an already-existing argument list. - /// - /// - /// The argument list that will be formatted. - /// - /// - /// @see sendTextEx - virtual void vSendTextEx(bool toAllies, const char *format, va_list args) = 0; - - /// Checks if the current client is inside a game. - /// - /// @returns true if the client is in a game, and false if it is not. - virtual bool isInGame() const = 0; - - /// Checks if the current client is inside a multiplayer game. - /// - /// @returns true if the client is in a multiplayer game, and false if it is a single player - /// game, a replay, or some other state. - virtual bool isMultiplayer() const = 0; - - /// Checks if the client is in a game that was created through the Battle.net - /// multiplayer gaming service. - /// - /// @returns true if the client is in a multiplayer Battle.net game and false if it is not. - virtual bool isBattleNet() const = 0; - - /// Checks if the current game is paused. While paused, AIModule::onFrame - /// will still be called. - /// - /// @returns true if the game is paused and false otherwise - /// @see pauseGame, resumeGame - virtual bool isPaused() const = 0; - - /// Checks if the client is watching a replay. - /// - /// @returns true if the client is watching a replay and false otherwise - virtual bool isReplay() const = 0; - - /// Pauses the game. While paused, AIModule::onFrame will still be called. - /// @see resumeGame - virtual void pauseGame() = 0; - - /// Resumes the game from a paused state. - /// @see pauseGame - virtual void resumeGame() = 0; - - /// Leaves the current game by surrendering and enters the post-game statistics/score - /// screen. - virtual void leaveGame() = 0; - - /// Restarts the match. Works the same as if the match was restarted from - /// the in-game menu (F10). This option is only available in single player games. - /// - /// @todo return a bool indicating success, document error code for invalid state - virtual void restartGame() = 0; - - /// Sets the number of milliseconds Broodwar spends in each frame. The - /// default values are as follows: - /// - Fastest: 42ms/frame - /// - Faster: 48ms/frame - /// - Fast: 56ms/frame - /// - Normal: 67ms/frame - /// - Slow: 83ms/frame - /// - Slower: 111ms/frame - /// - Slowest: 167ms/frame - /// - /// @note Specifying a value of 0 will not guarantee that logical frames are executed as fast - /// as possible. If that is the intention, use this in combination with #setFrameSkip. - /// - /// @bug Changing this value will cause the execution of @UMS scenario triggers to glitch. - /// This will only happen in campaign maps and custom scenarios (non-melee). - /// - /// - /// The time spent per frame, in milliseconds. A value of 0 indicates that frames are - /// executed immediately with no delay. Negative values will restore the default value - /// as listed above. - /// - /// - /// @see setFrameSkip, getFPS - virtual void setLocalSpeed(int speed) = 0; - - /// Issues a given command to a set of units. This function automatically - /// splits the set into groups of 12 and issues the same command to each of them. If a unit - /// is not capable of executing the command, then it is simply ignored. - /// - /// - /// A Unitset containing all the units to issue the command for. - /// - /// - /// A UnitCommand object containing relevant information about the command to be issued. - /// The Unit interface object associated with the command will be ignored. - /// - /// - /// @returns true if any one of the units in the Unitset were capable of executing the - /// command, and false if none of the units were capable of executing the command. - virtual bool issueCommand(const Unitset& units, UnitCommand command) = 0; - - /// Retrieves the set of units that are currently selected by the user outside of - /// BWAPI. This function requires that Flag::UserInput be enabled. - /// - /// @returns A Unitset containing the user's selected units. If Flag::UserInput is disabled, - /// then this set is always empty. - /// - /// @see enableFlag - virtual const Unitset& getSelectedUnits() const = 0; - - /// Retrieves the player object that BWAPI is controlling. - /// - /// @returns Pointer to Player interface object representing the current player. - /// @retval nullptr if the current game is a replay. - /// - /// Example usage - /// @code - /// void ExampleAIModule::onStart() - /// { - /// if ( BWAPI::Broodwar->self() ) - /// BWAPI::Broodwar->sendText("Hello, my name is %s.", BWAPI::Broodwar->self()->getName().c_str()); - /// } - /// @endcode - virtual Player self() const = 0; - - /// Retrieves the Player interface that represents the enemy player. If - /// there is more than one enemy, and that enemy is destroyed, then this function will still - /// retrieve the same, defeated enemy. If you wish to handle multiple opponents, see the - /// Game::enemies function. - /// - /// @returns Player interface representing an enemy player. - /// @retval nullptr If there is no enemy or the current game is a replay. - /// @see enemies - virtual Player enemy() const = 0; - - /// Retrieves the Player interface object representing the neutral player. - /// The neutral player owns all the resources and critters on the map by default. - /// - /// @returns Player interface indicating the neutral player. - virtual Player neutral() const = 0; - - /// Retrieves a set of all the current player's remaining allies. - /// - /// @returns Playerset containing all allied players. - virtual Playerset& allies() = 0; - - /// Retrieves a set of all the current player's remaining enemies. - /// - /// @returns Playerset containing all enemy players. - virtual Playerset& enemies() = 0; - - /// Retrieves a set of all players currently observing the game. An observer - /// is defined typically in a @UMS game type as not having any impact on the game. This means - /// an observer cannot start with any units, and cannot have any active trigger actions that - /// create units for it. - /// - /// @returns Playerset containing all currently active observer players - virtual Playerset& observers() = 0; - - /// @name Debugging Members - /// @{ - - /// Sets the size of the text for all calls to drawText following this one. - /// - /// (optional) - /// The size of the text. This value is one of Text::Size::Enum. If this value is omitted, - /// then a default value of Text::Size::Default is used. - /// - /// - /// Example usage - /// @code - /// void ExampleAIModule::onFrame() - /// { - /// // Centers the name of the player in the upper middle of the screen - /// BWAPI::Broodwar->setTextSize(BWAPI::Text::Size::Large); - /// BWAPI::Broodwar->drawTextScreen(BWAPI::Positions::Origin, "%c%c%s", - /// BWAPI::Text::Align_Center, - /// BWAPI::Text::Green, - /// BWAPI::Broodwar->self()->getName().c_str() ); - /// BWAPI::Broodwar->setTextSize(); // Set text size back to default - /// } - /// @endcode - /// @see Text::Size::Enum - virtual void setTextSize(Text::Size::Enum size = Text::Size::Default) = 0; - - /// Draws text on the screen at the given coordinates. Text can be drawn in - /// different colors or formatted using the Text::Enum members. - /// - /// - /// The coordinate type. Indicates the relative position to draw the shape. - /// - /// - /// The x coordinate, in pixels, relative to ctype. - /// - /// - /// The y coordinate, in pixels, relative to ctype. - /// - /// - /// The string formatting portion. This is the same as printf style formatting. - /// - /// - /// Arglist containing the intermediate list of arguments to format before finally sending - /// the string to Broodwar. - /// - virtual void vDrawText(CoordinateType::Enum ctype, int x, int y, const char *format, va_list arg) = 0; - /// @overload - void drawText(CoordinateType::Enum ctype, int x, int y, const char *format, ...); - /// @overload - void drawTextMap(int x, int y, const char *format, ...); - /// @overload - void drawTextMap(Position p, const char *format, ...); - /// @overload - void drawTextMouse(int x, int y, const char *format, ...); - /// @overload - void drawTextMouse(Position p, const char *format, ...); - /// @overload - void drawTextScreen(int x, int y, const char *format, ...); - /// @overload - void drawTextScreen(Position p, const char *format, ...); - - /// Draws a rectangle on the screen with the given color. - /// - /// - /// The coordinate type. Indicates the relative position to draw the shape. - /// - /// - /// The x coordinate, in pixels, relative to ctype, of the left edge of the rectangle. - /// - /// - /// The y coordinate, in pixels, relative to ctype, of the top edge of the rectangle. - /// - /// - /// The x coordinate, in pixels, relative to ctype, of the right edge of the rectangle. - /// - /// - /// The y coordinate, in pixels, relative to ctype, of the bottom edge of the rectangle. - /// - /// - /// The color of the rectangle. - /// - /// (optional) - /// If true, then the shape will be filled and drawn as a solid, otherwise it will be drawn - /// as an outline. If omitted, this value will default to false. - /// - virtual void drawBox(CoordinateType::Enum ctype, int left, int top, int right, int bottom, Color color, bool isSolid = false) = 0; - /// @overload - void drawBoxMap(int left, int top, int right, int bottom, Color color, bool isSolid = false); - /// @overload - void drawBoxMap(Position leftTop, Position rightBottom, Color color, bool isSolid = false); - /// @overload - void drawBoxMouse(int left, int top, int right, int bottom, Color color, bool isSolid = false); - /// @overload - void drawBoxMouse(Position leftTop, Position rightBottom, Color color, bool isSolid = false); - /// @overload - void drawBoxScreen(int left, int top, int right, int bottom, Color color, bool isSolid = false); - /// @overload - void drawBoxScreen(Position leftTop, Position rightBottom, Color color, bool isSolid = false); - - /// Draws a triangle on the screen with the given color. - /// - /// - /// The coordinate type. Indicates the relative position to draw the shape. - /// - /// - /// The x coordinate, in pixels, relative to ctype, of the first point. - /// - /// - /// The y coordinate, in pixels, relative to ctype, of the first point. - /// - /// - /// The x coordinate, in pixels, relative to ctype, of the second point. - /// - /// - /// The y coordinate, in pixels, relative to ctype, of the second point. - /// - /// - /// The x coordinate, in pixels, relative to ctype, of the third point. - /// - /// - /// The y coordinate, in pixels, relative to ctype, of the third point. - /// - /// - /// The color of the triangle. - /// - /// (optional) - /// If true, then the shape will be filled and drawn as a solid, otherwise it will be drawn - /// as an outline. If omitted, this value will default to false. - /// - virtual void drawTriangle(CoordinateType::Enum ctype, int ax, int ay, int bx, int by, int cx, int cy, Color color, bool isSolid = false) = 0; - /// @overload - void drawTriangleMap(int ax, int ay, int bx, int by, int cx, int cy, Color color, bool isSolid = false); - /// @overload - void drawTriangleMap(Position a, Position b, Position c, Color color, bool isSolid = false); - /// @overload - void drawTriangleMouse(int ax, int ay, int bx, int by, int cx, int cy, Color color, bool isSolid = false); - /// @overload - void drawTriangleMouse(Position a, Position b, Position c, Color color, bool isSolid = false); - /// @overload - void drawTriangleScreen(int ax, int ay, int bx, int by, int cx, int cy, Color color, bool isSolid = false); - /// @overload - void drawTriangleScreen(Position a, Position b, Position c, Color color, bool isSolid = false); - - /// Draws a circle on the screen with the given color. - /// - /// - /// The coordinate type. Indicates the relative position to draw the shape. - /// - /// - /// The x coordinate, in pixels, relative to ctype. - /// - /// - /// The y coordinate, in pixels, relative to ctype. - /// - /// - /// The radius of the circle, in pixels. - /// - /// - /// The color of the circle. - /// - /// (optional) - /// If true, then the shape will be filled and drawn as a solid, otherwise it will be drawn - /// as an outline. If omitted, this value will default to false. - /// - virtual void drawCircle(CoordinateType::Enum ctype, int x, int y, int radius, Color color, bool isSolid = false) = 0; - /// @overload - void drawCircleMap(int x, int y, int radius, Color color, bool isSolid = false); - /// @overload - void drawCircleMap(Position p, int radius, Color color, bool isSolid = false); - /// @overload - void drawCircleMouse(int x, int y, int radius, Color color, bool isSolid = false); - /// @overload - void drawCircleMouse(Position p, int radius, Color color, bool isSolid = false); - /// @overload - void drawCircleScreen(int x, int y, int radius, Color color, bool isSolid = false); - /// @overload - void drawCircleScreen(Position p, int radius, Color color, bool isSolid = false); - - /// Draws an ellipse on the screen with the given color. - /// - /// - /// The coordinate type. Indicates the relative position to draw the shape. - /// - /// - /// The x coordinate, in pixels, relative to ctype. - /// - /// - /// The y coordinate, in pixels, relative to ctype. - /// - /// - /// The x radius of the ellipse, in pixels. - /// - /// - /// The y radius of the ellipse, in pixels. - /// - /// - /// The color of the ellipse. - /// - /// (optional) - /// If true, then the shape will be filled and drawn as a solid, otherwise it will be drawn - /// as an outline. If omitted, this value will default to false. - /// - virtual void drawEllipse(CoordinateType::Enum ctype, int x, int y, int xrad, int yrad, Color color, bool isSolid = false) = 0; - /// @overload - void drawEllipseMap(int x, int y, int xrad, int yrad, Color color, bool isSolid = false); - /// @overload - void drawEllipseMap(Position p, int xrad, int yrad, Color color, bool isSolid = false); - /// @overload - void drawEllipseMouse(int x, int y, int xrad, int yrad, Color color, bool isSolid = false); - /// @overload - void drawEllipseMouse(Position p, int xrad, int yrad, Color color, bool isSolid = false); - /// @overload - void drawEllipseScreen(int x, int y, int xrad, int yrad, Color color, bool isSolid = false); - /// @overload - void drawEllipseScreen(Position p, int xrad, int yrad, Color color, bool isSolid = false); - - /// Draws a dot on the map or screen with a given color. - /// - /// - /// The coordinate type. Indicates the relative position to draw the shape. - /// - /// - /// The x coordinate, in pixels, relative to ctype. - /// - /// - /// The y coordinate, in pixels, relative to ctype. - /// - /// - /// The color of the dot. - /// - virtual void drawDot(CoordinateType::Enum ctype, int x, int y, Color color) = 0; - /// @overload - void drawDotMap(int x, int y, Color color); - /// @overload - void drawDotMap(Position p, Color color); - /// @overload - void drawDotMouse(int x, int y, Color color); - /// @overload - void drawDotMouse(Position p, Color color); - /// @overload - void drawDotScreen(int x, int y, Color color); - /// @overload - void drawDotScreen(Position p, Color color); - - /// Draws a line on the map or screen with a given color. - /// - /// - /// The coordinate type. Indicates the relative position to draw the shape. - /// - /// - /// The starting x coordinate, in pixels, relative to ctype. - /// - /// - /// The starting y coordinate, in pixels, relative to ctype. - /// - /// - /// The ending x coordinate, in pixels, relative to ctype. - /// - /// - /// The ending y coordinate, in pixels, relative to ctype. - /// - /// - /// The color of the line. - /// - virtual void drawLine(CoordinateType::Enum ctype, int x1, int y1, int x2, int y2, Color color) = 0; - /// @overload - void drawLineMap(int x1, int y1, int x2, int y2, Color color); - /// @overload - void drawLineMap(Position a, Position b, Color color); - /// @overload - void drawLineMouse(int x1, int y1, int x2, int y2, Color color); - /// @overload - void drawLineMouse(Position a, Position b, Color color); - /// @overload - void drawLineScreen(int x1, int y1, int x2, int y2, Color color); - /// @overload - void drawLineScreen(Position a, Position b, Color color); - - /// @} - - /// Retrieves the maximum delay, in number of frames, between a command being issued - /// and the command being executed by Broodwar. - /// - /// @note In Broodwar, latency is used to keep the game synchronized between players without - /// introducing lag. - /// - /// @returns Difference in frames between commands being sent and executed. - /// @see getLatencyTime, getRemainingLatencyFrames - virtual int getLatencyFrames() const = 0; - - /// Retrieves the maximum delay, in milliseconds, between a command being issued and - /// the command being executed by Broodwar. - /// - /// @returns Difference in milliseconds between commands being sent and executed. - /// @see getLatencyFrames, getRemainingLatencyTime - virtual int getLatencyTime() const = 0; - - /// Retrieves the number of frames it will take before a command sent in the current - /// frame will be executed by the game. - /// - /// @returns Number of frames until a command is executed if it were sent in the current - /// frame. - /// @see getRemainingLatencyTime, getLatencyFrames - virtual int getRemainingLatencyFrames() const = 0; - - /// Retrieves the number of milliseconds it will take before a command sent in the - /// current frame will be executed by Broodwar. - /// - /// @returns Amount of time, in milliseconds, until a command is executed if it were sent in - /// the current frame. - /// @see getRemainingLatencyFrames, getLatencyTime - virtual int getRemainingLatencyTime() const = 0; - - /// Retrieves the current revision of BWAPI. - /// - /// @returns The revision number of the current BWAPI interface. - /// - /// @threadsafe - virtual int getRevision() const = 0; - - /// Retrieves the debug state of the BWAPI build. - /// - /// @returns true if the BWAPI module is a DEBUG build, and false if it is a RELEASE build. - /// - /// @threadsafe - virtual bool isDebug() const = 0; - - /// Checks the state of latency compensation. - /// - /// @returns true if latency compensation is enabled, false if it is disabled. - /// @see setLatCom - virtual bool isLatComEnabled() const = 0; - - /// Changes the state of latency compensation. Latency compensation - /// modifies the state of BWAPI's representation of units to reflect the implications of - /// issuing a command immediately after the command was performed, instead of waiting - /// consecutive frames for the results. Latency compensation is enabled by default. - /// - /// - /// Set whether the latency compensation feature will be enabled (true) or disabled (false). - /// - /// - /// @see isLatComEnabled. - virtual void setLatCom(bool isEnabled) = 0; - - /// Checks if the GUI is enabled. The GUI includes all drawing functions of - /// BWAPI, as well as screen updates from Broodwar. - /// - /// @retval true If the GUI is enabled, and everything is visible - /// @retval false If the GUI is disabled and drawing functions are rejected - /// - /// @see setGUI - virtual bool isGUIEnabled() const = 0; - - /// Sets the rendering state of the Starcraft GUI. This typically gives - /// Starcraft a very low graphical frame rate and disables all drawing functionality in BWAPI. - /// - /// - /// A boolean value that determines the state of the GUI. Passing false to this function - /// will disable the GUI, and true will enable it. - /// - /// - /// Example Usage: - /// @code - /// void ExampleAIModule::onStart() - /// { // Make our bot run thousands of games as fast as possible! - /// Broodwar->setLocalSpeed(0); - /// Broodwar->setGUI(false); - /// } - /// @endcode - /// - /// @see isGUIEnabled - virtual void setGUI(bool enabled) = 0; - - /// Retrieves the Starcraft instance number recorded by BWAPI to identify which - /// Starcraft instance an AI module belongs to. The very first instance should - /// return 0. - /// - /// @returns - /// An integer value representing the instance number. - /// - /// @threadsafe - virtual int getInstanceNumber() const = 0; - - /// Retrieves the Actions Per Minute (APM) that the bot is producing. - /// - /// (optional) - /// If true, the return value will include selections as individual commands, otherwise - /// it will exclude selections. This value is false by default. - /// - /// - /// @returns The number of actions that the bot has executed per minute, on average. - virtual int getAPM(bool includeSelects = false) const = 0; - - /// Changes the map to the one specified. Once restarted, the game will - /// load the map that was provided. Changes do not take effect unless the game is restarted. - /// - /// - /// A string containing the path and file name to the desired map. - /// - /// - /// @retval true if the function succeeded and has changed the map. - /// @retval false if the function failed, does not have permission from the tournament module, - /// failed to find the map specified, or received an invalid parameter. - virtual bool setMap(const char *mapFileName) = 0; - /// @overload - bool setMap(const std::string &mapFileName); - - /// Sets the number of graphical frames for every logical frame. This - /// allows the game to run more logical frames per graphical frame, increasing the speed at - /// which the game runs. - /// - /// - /// Number of graphical frames per logical frame. If this value is 0 or less, then it will - /// default to 1. - /// - /// - /// @see setLocalSpeed - virtual void setFrameSkip(int frameSkip) = 0; - - /// Checks if there is a path from source to destination. This only checks - /// if the source position is connected to the destination position. This function does not - /// check if all units can actually travel from source to destination. Because of this - /// limitation, it has an O(1) complexity, and cases where this limitation hinders gameplay is - /// uncommon at best. - /// - /// - /// The source position. - /// - /// - /// The destination position. - /// - /// - /// @retval true if there is a path between the two positions - /// @retval false if there is no path - bool hasPath(Position source, Position destination) const; - - /// Sets the alliance state of the current player with the target player. - /// - /// - /// The target player to set alliance with. - /// - /// (optional) - /// If true, the current player will ally the target player. If false, the current player - /// will make the target player an enemy. This value is true by default. - /// - /// (optional) - /// Sets the state of "allied victory". If true, the game will end in a victory if all - /// allied players have eliminated their opponents. Otherwise, the game will only end if - /// no other players are remaining in the game. This value is true by default. - /// - virtual bool setAlliance(BWAPI::Player player, bool allied = true, bool alliedVictory = true) = 0; - - /// In a game, this function sets the vision of the current BWAPI player with the - /// target player. In a replay, this function toggles the visibility of the target - /// player. - /// - /// - /// The target player to toggle vision. - /// - /// (optional) - /// The vision state. If true, and in a game, the current player will enable shared vision - /// with the target player, otherwise it will unshare vision. If in a replay, the vision - /// of the target player will be shown, otherwise the target player will be hidden. This - /// value is true by default. - /// - virtual bool setVision(BWAPI::Player player, bool enabled = true) = 0; - - /// Retrieves current amount of time in seconds that the game has elapsed. - /// - /// @returns Time, in seconds, that the game has elapsed as an integer. - virtual int elapsedTime() const = 0; - - /// Sets the command optimization level. Command optimization is a feature - /// in BWAPI that tries to reduce the APM of the bot by grouping or eliminating unnecessary - /// game actions. For example, suppose the bot told 24 @Zerglings to @Burrow. At command - /// optimization level 0, BWAPI is designed to select each Zergling to burrow individually, - /// which costs 48 actions. With command optimization level 1, it can perform the same - /// behaviour using only 4 actions. The command optimizer also reduces the amount of bytes used - /// for each action if it can express the same action using a different command. For example, - /// Right_Click uses less bytes than Move. - /// - /// - /// An integer representation of the aggressiveness for which commands are optimized. A - /// lower level means less optimization, and a higher level means more optimization. - /// - /// - /// The values for \p level are as follows: - /// - 0: No optimization. - /// - 1: Some optimization. - /// - Is not detected as a hack. - /// - Does not alter behaviour. - /// - Units performing the following actions are grouped and ordered 12 at a time: - /// - Attack_Unit - /// - Morph (@Larva only) - /// - Hold_Position - /// - Stop - /// - Follow - /// - Gather - /// - Return_Cargo - /// - Repair - /// - Burrow - /// - Unburrow - /// - Cloak - /// - Decloak - /// - Siege - /// - Unsiege - /// - Right_Click_Unit - /// - Halt_Construction - /// - Cancel_Train (@Carrier and @Reaver only) - /// - Cancel_Train_Slot (@Carrier and @Reaver only) - /// - Cancel_Morph (for non-buildings only) - /// - Use_Tech - /// - Use_Tech_Unit - /// . - /// - The following order transformations are applied to allow better grouping: - /// - Attack_Unit becomes Right_Click_Unit if the target is an enemy - /// - Move becomes Right_Click_Position - /// - Gather becomes Right_Click_Unit if the target contains resources - /// - Set_Rally_Position becomes Right_Click_Position for buildings - /// - Set_Rally_Unit becomes Right_Click_Unit for buildings - /// - Use_Tech_Unit with Infestation becomes Right_Click_Unit if the target is valid - /// . - /// . - /// - 2: More optimization by grouping structures. - /// - Includes the optimizations made by all previous levels. - /// - May be detected as a hack by some replay utilities. - /// - Does not alter behaviour. - /// - Units performing the following actions are grouped and ordered 12 at a time: - /// - Attack_Unit (@Turrets, @Photon_Cannons, @Sunkens, @Spores) - /// - Train - /// - Morph - /// - Set_Rally_Unit - /// - Lift - /// - Cancel_Construction - /// - Cancel_Addon - /// - Cancel_Train - /// - Cancel_Train_Slot - /// - Cancel_Morph - /// - Cancel_Research - /// - Cancel_Upgrade - /// . - /// . - /// - 3: Extensive optimization - /// - Includes the optimizations made by all previous levels. - /// - Units may behave or move differently than expected. - /// - Units performing the following actions are grouped and ordered 12 at a time: - /// - Attack_Move - /// - Set_Rally_Position - /// - Move - /// - Patrol - /// - Unload_All - /// - Unload_All_Position - /// - Right_Click_Position - /// - Use_Tech_Position - /// . - /// . - /// - 4: Aggressive optimization - /// - Includes the optimizations made by all previous levels. - /// - Positions used in commands will be rounded to multiples of 32. - /// - @High_Templar and @Dark_Templar that merge into @Archons will be grouped and may - /// choose a different target to merge with. It will not merge with a target that - /// wasn't included. - /// . - /// . - /// - virtual void setCommandOptimizationLevel(int level) = 0; - - /// Returns the remaining countdown time. The countdown timer is used in - /// @CTF and @UMS game types. - /// - /// Example usage: - /// @code - /// void ExampleAIModule::onStart() - /// { - /// // Register a callback that only occurs once when the countdown timer reaches 0 - /// if ( BWAPI::Broodwar->getGameType() == BWAPI::GameTypes::Capture_The_Flag || - /// BWAPI::Broodwar->getGameType() == BWAPI::GameTypes::Team_Capture_The_Flag ) - /// { - /// BWAPI::Broodwar->registerEvent([](BWAPI::Game*){ BWAPI::Broodwar->sendText("Try to find my flag!"); }, // action - /// [](BWAPI::Game*){ return BWAPI::Broodwar->countdownTimer() == 0; }, // condition - /// 1); // times to run (once) - /// } - /// } - /// @endcode - /// - /// @returns Integer containing the time (in game seconds) on the countdown timer. - virtual int countdownTimer() const = 0; - - /// Retrieves the set of all regions on the map. - /// - /// @returns Regionset containing all map regions. - virtual const Regionset &getAllRegions() const = 0; - - /// Retrieves the region at a given position. - /// - /// - /// The x coordinate, in pixels. - /// - /// - /// The y coordinate, in pixels. - /// - /// - /// @returns Pointer to the Region interface at the given position. - /// @retval nullptr if the provided position is not valid (i.e. not within the map bounds). - /// - /// @note If the provided position is invalid, the error Errors::Invalid_Parameter is set. - /// @see getAllRegions, getRegion - virtual BWAPI::Region getRegionAt(int x, int y) const = 0; - /// @overload - BWAPI::Region getRegionAt(BWAPI::Position position) const; - - /// Retrieves the amount of time (in milliseconds) that has elapsed when running the last AI - /// module callback. This is used by tournament modules to penalize AI modules that use too - /// much processing time. - /// - /// @retval 0 When called from an AI module. - /// @returns Time in milliseconds spent in last AI module call. - virtual int getLastEventTime() const = 0; - - /// Sets the state of the fog of war when watching a replay. - /// - /// (optional) - /// The state of the reveal all flag. If false, all fog of war will be enabled. If true, - /// then the fog of war will be revealed. It is true by default. - /// - virtual bool setRevealAll(bool reveal = true) = 0; - - /// Retrieves a basic build position just as the default Computer AI would. - /// This allows users to find simple build locations without relying on external libraries. - /// - /// - /// A valid UnitType representing the unit type to accomodate space for. - /// - /// - /// A valid TilePosition containing the desired placement position. - /// - /// (optional) - /// The maximum distance (in tiles) to build from \p desiredPosition. - /// - /// (optional) - /// A special boolean value that changes the behaviour of @Creep_Colony placement. - /// - /// - /// @retval TilePositions::Invalid If a build location could not be found within \p maxRange. - /// @returns - /// A TilePosition containing the location that the structure should be constructed at. - TilePosition getBuildLocation(UnitType type, TilePosition desiredPosition, int maxRange = 64, bool creep = false) const; - - /// Calculates the damage received for a given player. It can be understood - /// as the damage from \p fromType to \p toType. Does not include shields in calculation. - /// Includes upgrades if players are provided. - /// - /// - /// The unit type that will be dealing the damage. - /// - /// - /// The unit type that will be receiving the damage. - /// - /// (optional) - /// The player owner of the given type that will be dealing the damage. If omitted, then - /// no player will be used to calculate the upgrades for \p fromType. - /// - /// (optional) - /// The player owner of the type that will be receiving the damage. If omitted, then this - /// parameter will default to Broodwar->self(). - /// - /// - /// @returns The amount of damage that fromType would deal to toType. - /// @see getDamageTo - int getDamageFrom(UnitType fromType, UnitType toType, Player fromPlayer = nullptr, Player toPlayer = nullptr) const; - - /// Calculates the damage dealt for a given player. It can be understood as - /// the damage to \p toType from \p fromType. Does not include shields in calculation. - /// Includes upgrades if players are provided. - /// - /// @note This function is nearly the same as #getDamageFrom. The only difference is that - /// the last parameter is intended to default to Broodwar->self(). - /// - /// - /// The unit type that will be receiving the damage. - /// - /// - /// The unit type that will be dealing the damage. - /// - /// (optional) - /// The player owner of the type that will be receiving the damage. If omitted, then - /// no player will be used to calculate the upgrades for \p toType. - /// - /// (optional) - /// The player owner of the given type that will be dealing the damage. If omitted, then - /// this parameter will default to Broodwar->self(). - /// - /// - /// @returns The amount of damage that fromType would deal to toType. - /// @see getDamageFrom - int getDamageTo(UnitType toType, UnitType fromType, Player toPlayer = nullptr, Player fromPlayer = nullptr) const; - }; - - extern Game *BroodwarPtr; - - /// Broodwar wrapper - class GameWrapper - { - private: - std::ostringstream ss; - public: - /// Definition of ostream_manipulator type for convenience. - typedef std::ostream& (*ostream_manipulator)(std::ostream&); - - /// Member access operator to retain the original Broodwar-> behaviour. - Game *operator ->() const; - - /// Output stream operator for printing text to Broodwar. Using this - /// operator invokes Game::printf when a newline character is encountered. - template < class T > - inline GameWrapper &operator <<(const T &in) - { - // Pass whatever into the stream - ss << in; - return *this; - }; - /// @overload - GameWrapper &operator <<(ostream_manipulator fn); - - /// Flushes the Broodwar stream, printing all text in the stream to the screen. - void flush(); - }; - - /// The primary Game interface, used to access any Game information or perform Game - /// actions. - extern GameWrapper Broodwar; - -} - diff --git a/bwapi4-includes/BWAPI/GameType.h b/bwapi4-includes/BWAPI/GameType.h deleted file mode 100644 index 5ddad69..0000000 --- a/bwapi4-includes/BWAPI/GameType.h +++ /dev/null @@ -1,80 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// Namespace containing game types. - /// @see GameType - namespace GameTypes - { - /// Enumeration of game types. - /// @see GameType - namespace Enum - { - /// Enumeration of game types. - /// @see GameType - enum Enum - { - None = 0, - Custom, // Warcraft III - Melee, - Free_For_All, - One_on_One, - Capture_The_Flag, - Greed, - Slaughter, - Sudden_Death, - Ladder, - Use_Map_Settings, - Team_Melee, - Team_Free_For_All, - Team_Capture_The_Flag, - Unknown_0x0E, - Top_vs_Bottom, - Iron_Man_Ladder, // Warcraft II - - Pro_Gamer_League = 32, // Not valid - Unknown, - MAX - }; - }; - }; - /// A class that represents game types in Broodwar. A game type is selected - /// when creating a game. - /// - /// @see GameTypes - /// @ingroup TypeClasses - class GameType : public Type - { - public: - /// @copydoc Type::Type(int) - GameType(int id = GameTypes::Enum::None); - }; - - /// @ingroup Types - namespace GameTypes - { - /// Retrieves the set of all the valid GameTypes. - /// - /// @returns Set of available GameTypes. - const GameType::set& allGameTypes(); - - extern const GameType Melee; - extern const GameType Free_For_All; - extern const GameType One_on_One; - extern const GameType Capture_The_Flag; - extern const GameType Greed; - extern const GameType Slaughter; - extern const GameType Sudden_Death; - extern const GameType Ladder; - extern const GameType Use_Map_Settings; - extern const GameType Team_Melee; - extern const GameType Team_Free_For_All; - extern const GameType Team_Capture_The_Flag; - extern const GameType Top_vs_Bottom; - extern const GameType None; - extern const GameType Unknown; - } - - static_assert(sizeof(GameType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/Input.h b/bwapi4-includes/BWAPI/Input.h deleted file mode 100644 index 24eb06c..0000000 --- a/bwapi4-includes/BWAPI/Input.h +++ /dev/null @@ -1,251 +0,0 @@ -#pragma once -namespace BWAPI -{ - /// An enumeration of mouse button inputs. - /// @see Game::getMouseState - enum MouseButton - { - M_LEFT = 0, - M_RIGHT, - M_MIDDLE, - M_MAX, - }; - - /// An enumeration of keyboard input values. - /// @see Game::getKeyState - enum Key - { - K_LBUTTON = 0x01, - K_RBUTTON, - K_CANCEL, - K_MBUTTON, - K_XBUTTON1, - K_XBUTTON2, - __UNDEFINED_7, - K_BACK, - K_TAB, - __RESERVED_A, - __RESERVED_B, - K_CLEAR, - K_RETURN, - __UNDEFINED_E, - __UNDEFINED_F, - K_SHIFT, - K_CONTROL, - K_MENU, - K_PAUSE, - K_CAPITAL, - K_KANA, - K_UNDEFINED_16, - K_JUNJA, - K_FINAL, - K_KANJI, - __UNDEFINED_1A, - K_ESCAPE, - K_CONVERT, - K_NONCONVERT, - K_ACCEPT, - K_MODECHANGE, - K_SPACE, - K_PRIOR, - K_NEXT, - K_END, - K_HOME, - K_LEFT, - K_UP, - K_RIGHT, - K_DOWN, - K_SELECT, - K_PRINT, - K_EXECUTE, - K_SNAPSHOT, - K_INSERT, - K_DELETE, - K_HELP, - K_0, - K_1, - K_2, - K_3, - K_4, - K_5, - K_6, - K_7, - K_8, - K_9, - __UNDEFINED_3A, - __UNDEFINED_3B, - __UNDEFINED_3C, - __UNDEFINED_3D, - __UNDEFINED_3E, - __UNDEFINED_3F, - __UNDEFINED_40, - K_A, - K_B, - K_C, - K_D, - K_E, - K_F, - K_G, - K_H, - K_I, - K_J, - K_K, - K_L, - K_M, - K_N, - K_O, - K_P, - K_Q, - K_R, - K_S, - K_T, - K_U, - K_V, - K_W, - K_X, - K_Y, - K_Z, - K_LWIN, - K_RWIN, - K_APPS, - __RESERVED_5E, - K_SLEEP, - K_NUMPAD0, - K_NUMPAD1, - K_NUMPAD2, - K_NUMPAD3, - K_NUMPAD4, - K_NUMPAD5, - K_NUMPAD6, - K_NUMPAD7, - K_NUMPAD8, - K_NUMPAD9, - K_MULTIPLY, - K_ADD, - K_SEPARATOR, - K_SUBTRACT, - K_DECIMAL, - K_DIVIDE, - K_F1, - K_F2, - K_F3, - K_F4, - K_F5, - K_F6, - K_F7, - K_F8, - K_F9, - K_F10, - K_F11, - K_F12, - K_F13, - K_F14, - K_F15, - K_F16, - K_F17, - K_F18, - K_F19, - K_F20, - K_F21, - K_F22, - K_F23, - K_F24, - __UNASSIGNED_88, - __UNASSIGNED_89, - __UNASSIGNED_8A, - __UNASSIGNED_8B, - __UNASSIGNED_8C, - __UNASSIGNED_8D, - __UNASSIGNED_8E, - __UNASSIGNED_8F, - K_NUMLOCK, - K_SCROLL, - - K_OEM_NEC_EQUAL, - K_OEM_FJ_JISHO, - K_OEM_FJ_MASSHOU, - K_OEM_FJ_TOUROKU, - K_OEM_FJ_LOYA, - __UNASSIGNED_97, - __UNASSIGNED_98, - __UNASSIGNED_99, - __UNASSIGNED_9A, - __UNASSIGNED_9B, - __UNASSIGNED_9C, - __UNASSIGNED_9D, - __UNASSIGNED_9E, - __UNASSIGNED_9F, - K_LSHIFT, - K_RSHIFT, - K_LCONTROL, - K_RCONTROL, - K_LMENU, - K_RMENU, - K_BROWSER_BACK, - K_BROWSER_FORWARD, - K_BROWSER_REFRESH, - K_BROWSER_STOP, - K_BROWSER_SEARCH, - K_BROWSER_FAVORITES, - K_BROWSER_HOME, - K_VOLUME_MUTE, - K_VOLUME_DOWN, - K_VOLUME_UP, - K_MEDIA_NEXT_TRACK, - K_MEDIA_PREV_TRACK, - K_MEDIA_STOP, - K_MEDIA_PLAY_PAUSE, - K_LAUNCH_MAIL, - K_LAUNCH_MEDIA_SELECT, - K_LAUNCH_APP1, - K_LAUNCH_APP2, - __RESERVED_B8, - __RESERVED_B9, - K_OEM_1, - K_OEM_PLUS, - K_OEM_COMMA, - K_OEM_MINUS, - K_OEM_PERIOD, - K_OEM_2, - K_OEM_3, - - K_OEM_4 = 0xDB, - K_OEM_5, - K_OEM_6, - K_OEM_7, - K_OEM_8, - __RESERVED_E0, - K_OEM_AX, - K_OEM_102, - K_ICO_HELP, - K_ICO_00, - K_PROCESSKEY, - K_ICO_CLEAR, - K_PACKET, - __UNASSIGNED_E8, - K_OEM_RESET, - K_OEM_JUMP, - K_OEM_PA1, - K_OEM_PA2, - K_OEM_PA3, - K_OEM_WSCTRL, - K_OEM_CUSEL, - K_OEM_ATTN, - K_OEM_FINISH, - K_OEM_COPY, - K_OEM_AUTO, - K_OEM_ENLW, - K_OEM_BACKTAB, - - K_ATTN, - K_CRSEL, - K_EXSEL, - K_EREOF, - K_PLAY, - K_ZOOM, - K_NONAME, - K_PA1, - K_OEM_CLEAR, - K_MAX - }; -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/Interface.h b/bwapi4-includes/BWAPI/Interface.h deleted file mode 100644 index b210ead..0000000 --- a/bwapi4-includes/BWAPI/Interface.h +++ /dev/null @@ -1,129 +0,0 @@ -#pragma once -#include -#include - -#include - -namespace BWAPI -{ - /// This generalized class allows the application of features that are common to all interface - /// classes. - /// - /// @tparam T - /// The class that inherits this interface. - template < typename T > - class Interface - { - protected: - /// @cond HIDDEN - Interface() = default; - virtual ~Interface() {}; - - std::map clientInfo; - std::list< InterfaceEvent > interfaceEvents; - - friend class GameImpl; - - // Function manages events and updates it for the given frame - void updateEvents() - { - auto e = interfaceEvents.begin(); - while ( e != interfaceEvents.end() ) - { - if ( e->isFinished() ) - { - e = interfaceEvents.erase(e); - } - else - { - e->execute(static_cast(this)); - ++e; - } - } - }; - /// @endcond - public: - /// Retrieves a pointer or value at an index that was stored for this interface using - /// setClientInfo. - /// - /// - /// The key containing the value to retrieve. Default is 0. - /// - /// - /// @retval nullptr if index is out of bounds. - /// @returns The client info at the given index. - /// @see setClientInfo - void *getClientInfo(int key = 0) const - { - // Retrieve iterator to element at index - auto result = this->clientInfo.find(key); - - // Return a default value if not found - if ( result == this->clientInfo.end() ) - return nullptr; - - // return the desired value - return result->second; - }; - - template - CT getClientInfo(int key = 0) const - { - return (CT)(int)this->getClientInfo(key); - }; - - /// Associates one or more pointers or values with any BWAPI interface. - /// - /// This client information is managed entirely by the AI module. It is not modified by BWAPI. - /// @warning If a pointer to allocated memory is used, then the AI module is responsible for - /// deallocating the memory when the game ends. - /// - /// If client info at the given index has already been set, then it will be overwritten. - /// - /// - /// The data to associate with this interface. - /// - /// - /// The key to use for this data. Default is 0. - /// - /// - /// @see getClientInfo - template < typename V > - void setClientInfo(const V &clientInfo, int key = 0) - { - this->clientInfo[key] = (void*)clientInfo; - }; - - /// Registers an event and associates it with the current Interface object. - /// Events can be used to automate tasks (like train X @Marines until Y of them have been - /// created by the given @Barracks) or to create user-defined callbacks. - /// - /// - /// The action callback to be executed when the event conditions are true. It is of type - /// void fn(T *inst) where fn is the function name and inst is a pointer to the instance of - /// the object performing the action. - /// - /// (optional) - /// The condition callback which will return true if the action is intended to be executed. - /// It is of type bool fn(T *inst) where fn is the function name and inst is a pointer to the - /// instance of the object performing the check. The condition will always be true if omitted. - /// - /// (optional) - /// The number of times to execute the action before the event is removed. If the value is - /// negative, then the event will never be removed. The value will be -1 if omitted, causing - /// the event to execute until the game ends. - /// - /// (optional) - /// The number of frames to skip between checks. If this value is 0, then a condition check is - /// made once per frame. If this value is 1, then the condition for this event is only checked - /// every other frame. This value is 0 by default, meaning the event's condition is checked - /// every frame. - /// - void registerEvent(const std::function &action, const std::function &condition = nullptr, int timesToRun = -1, int framesToCheck = 0) - { - interfaceEvents.push_back( InterfaceEvent(action,condition,timesToRun,framesToCheck) ); - }; - }; - - -} diff --git a/bwapi4-includes/BWAPI/InterfaceEvent.h b/bwapi4-includes/BWAPI/InterfaceEvent.h deleted file mode 100644 index e22a453..0000000 --- a/bwapi4-includes/BWAPI/InterfaceEvent.h +++ /dev/null @@ -1,112 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// The interface event is an attachment to BWAPI interfaces which allows the user to - /// register powerful conditional callbacks that can be executed a user-specified number of - /// times. - /// - /// @tparam T - /// The interface that this class is being used for. - /// - /// @see Interface::registerEvent - template < typename T > - class InterfaceEvent - { - public: - InterfaceEvent() = default; - - /// This is the expected constructor for an interface event. - /// - /// - /// An function callback that is run when all other conditions for this event are met. - /// - /// (optioinal) - /// A function predicate that returns true if this event should be triggered. - /// - /// (optional) - /// The number of times that the action is called before this event is discarded. A value - /// of -1 means the event will never be discarded until the game has ended. - /// - /// (optional) - /// The frequency that the event will check its condition at. A lower value indicates a - /// higher frequency. A value of 0 means that the condition is checked every frame. - /// A value of 10 means that the condition is checked once every 10 frames. - /// - InterfaceEvent(const std::function &action, const std::function &condition = nullptr, int timesToRun = -1, int framesToCheck = 0) - : condProc( condition ) - , execProc( action ) - , runFreq( framesToCheck ) - , runCount( timesToRun ) - , step( framesToCheck ) - {}; - - /// Checks if the event has finished its execution and is marked for removal. - /// - /// @returns true if the event has completed all runs and/or is marked for removal, otherwise - /// it returns false if the event should continue execution. - bool isFinished() const - { - return this->runCount == 0; - }; - - /// Marks the event for removal. - void removeEvent() - { - this->runCount = 0; - }; - - protected: - template < typename U > - friend class Interface; - - // Function that runs the event, checkings its conditions and running its action, then - // decrementing the run count. - bool execute(T *instance) - { - // condition check - if ( !this->isConditionMet(instance) ) - return false; - - // There must be an exec proc! - if ( !this->execProc ) - return false; - - // execute - this->execProc(instance); - - // Decrement run count (-1 being infinite) - if ( this->runCount > 0 ) - --this->runCount; - return true; - }; - - // Function to check if the condition associated with the event is true. Includes frame and - // run count checking. - bool isConditionMet(T *instance) - { - // Validity check - if ( this->isFinished() ) - return false; - - // Frame check - --step; - if ( step > 0 ) - return false; - this->step = this->runFreq; - - // Conditional check - if ( this->condProc ) - return this->condProc(instance); - return true; // always run if there is no conditional function - }; - private: - // Data members - std::function condProc = nullptr; - std::function execProc = nullptr; - int runFreq = 0; // Frequency of runs, in frames (0 means every frame, 1 means every other frame) - int runCount = 0; // Number of times that the action can occur (-1 being infinite) - int step = 0; // Current step. Executes when reaches 0, then reset to runFreq. - }; -} diff --git a/bwapi4-includes/BWAPI/Latency.h b/bwapi4-includes/BWAPI/Latency.h deleted file mode 100644 index 6fffef9..0000000 --- a/bwapi4-includes/BWAPI/Latency.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -namespace BWAPI -{ - /// Contains enumeration of known latency values. - /// @see Game::getLatency - namespace Latency - { - /// Contains enumeration of known latency values. - /// @see Game::getLatency - enum Enum - { - SinglePlayer = 2, - LanLow = 5, - LanMedium = 7, - LanHigh = 9, - BattlenetLow = 14, - BattlenetMedium = 19, - BattlenetHigh = 24 - }; - } -} diff --git a/bwapi4-includes/BWAPI/Order.h b/bwapi4-includes/BWAPI/Order.h deleted file mode 100644 index c29145d..0000000 --- a/bwapi4-includes/BWAPI/Order.h +++ /dev/null @@ -1,394 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// Namespace containing unit orders. - /// @see Order - namespace Orders - { - /// Enumeration of unit orders. - /// @see Order - namespace Enum - { - /// Enumeration of unit orders. - /// @see Order - enum Enum - { - Die, - Stop, - Guard, - PlayerGuard, - TurretGuard, - BunkerGuard, - Move, - ReaverStop, - Attack1, - Attack2, - AttackUnit, - AttackFixedRange, - AttackTile, - Hover, - AttackMove, - InfestedCommandCenter, - UnusedNothing, - UnusedPowerup, - TowerGuard, - TowerAttack, - VultureMine, - StayInRange, - TurretAttack, - Nothing, - Unused_24, - DroneStartBuild, - DroneBuild, - CastInfestation, - MoveToInfest, - InfestingCommandCenter, - PlaceBuilding, - PlaceProtossBuilding, - CreateProtossBuilding, - ConstructingBuilding, - Repair, - MoveToRepair, - PlaceAddon, - BuildAddon, - Train, - RallyPointUnit, - RallyPointTile, - ZergBirth, - ZergUnitMorph, - ZergBuildingMorph, - IncompleteBuilding, - IncompleteMorphing, - BuildNydusExit, - EnterNydusCanal, - IncompleteWarping, - Follow, - Carrier, - ReaverCarrierMove, - CarrierStop, - CarrierAttack, - CarrierMoveToAttack, - CarrierIgnore2, - CarrierFight, - CarrierHoldPosition, - Reaver, - ReaverAttack, - ReaverMoveToAttack, - ReaverFight, - ReaverHoldPosition, - TrainFighter, - InterceptorAttack, - ScarabAttack, - RechargeShieldsUnit, - RechargeShieldsBattery, - ShieldBattery, - InterceptorReturn, - DroneLand, - BuildingLand, - BuildingLiftOff, - DroneLiftOff, - LiftingOff, - ResearchTech, - Upgrade, - Larva, - SpawningLarva, - Harvest1, - Harvest2, - MoveToGas, - WaitForGas, - HarvestGas, - ReturnGas, - MoveToMinerals, - WaitForMinerals, - MiningMinerals, - Harvest3, - Harvest4, - ReturnMinerals, - Interrupted, - EnterTransport, - PickupIdle, - PickupTransport, - PickupBunker, - Pickup4, - PowerupIdle, - Sieging, - Unsieging, - WatchTarget, - InitCreepGrowth, - SpreadCreep, - StoppingCreepGrowth, - GuardianAspect, - ArchonWarp, - CompletingArchonSummon, - HoldPosition, - QueenHoldPosition, - Cloak, - Decloak, - Unload, - MoveUnload, - FireYamatoGun, - MoveToFireYamatoGun, - CastLockdown, - Burrowing, - Burrowed, - Unburrowing, - CastDarkSwarm, - CastParasite, - CastSpawnBroodlings, - CastEMPShockwave, - NukeWait, - NukeTrain, - NukeLaunch, - NukePaint, - NukeUnit, - CastNuclearStrike, - NukeTrack, - InitializeArbiter, - CloakNearbyUnits, - PlaceMine, - RightClickAction, - SuicideUnit, - SuicideLocation, - SuicideHoldPosition, - CastRecall, - Teleport, - CastScannerSweep, - Scanner, - CastDefensiveMatrix, - CastPsionicStorm, - CastIrradiate, - CastPlague, - CastConsume, - CastEnsnare, - CastStasisField, - CastHallucination, - Hallucination2, - ResetCollision, - ResetHarvestCollision, - Patrol, - CTFCOPInit, - CTFCOPStarted, - CTFCOP2, - ComputerAI, - AtkMoveEP, - HarassMove, - AIPatrol, - GuardPost, - RescuePassive, - Neutral, - ComputerReturn, - InitializePsiProvider, - SelfDestructing, - Critter, - HiddenGun, - OpenDoor, - CloseDoor, - HideTrap, - RevealTrap, - EnableDoodad, - DisableDoodad, - WarpIn, - Medic, - MedicHeal, - HealMove, - MedicHoldPosition, - MedicHealToIdle, - CastRestoration, - CastDisruptionWeb, - CastMindControl, - DarkArchonMeld, - CastFeedback, - CastOpticalFlare, - CastMaelstrom, - JunkYardDog, - Fatal, - None, - Unknown, - MAX - }; - } - } - /// An Order (Order type) represents a Unit's current action and can be retrieved with - /// UnitInterface::getOrder. It can also be used to identify the current state of the - /// unit during command execution (gathering minerals can consist of Orders::MoveToMinerals, - /// Orders::WaitForMinerals, Orders::MiningMinerals, etc.). - /// - /// @see UnitInterface::getOrder, Orders - /// @ingroup TypeClasses - class Order : public Type - { - public: - /// @copydoc Type::Type(int) - Order(int id = Orders::Enum::None); - }; - - /// @ingroup Types - namespace Orders - { - /// Retrieves the set of all defined game orders. - /// - /// @returns Set of all Order types. - const Order::set& allOrders(); - - extern const Order Die; - extern const Order Stop; - extern const Order Guard; - extern const Order PlayerGuard; - extern const Order TurretGuard; - extern const Order BunkerGuard; - extern const Order Move; - extern const Order AttackUnit; - extern const Order AttackTile; - extern const Order Hover; - extern const Order AttackMove; - extern const Order InfestedCommandCenter; - extern const Order UnusedNothing; - extern const Order UnusedPowerup; - extern const Order TowerGuard; - extern const Order VultureMine; - extern const Order Nothing; - extern const Order CastInfestation; - extern const Order InfestingCommandCenter; - extern const Order PlaceBuilding; - extern const Order CreateProtossBuilding; - extern const Order ConstructingBuilding; - extern const Order Repair; - extern const Order PlaceAddon; - extern const Order BuildAddon; - extern const Order Train; - extern const Order RallyPointUnit; - extern const Order RallyPointTile; - extern const Order ZergBirth; - extern const Order ZergUnitMorph; - extern const Order ZergBuildingMorph; - extern const Order IncompleteBuilding; - extern const Order BuildNydusExit; - extern const Order EnterNydusCanal; - extern const Order Follow; - extern const Order Carrier; - extern const Order ReaverCarrierMove; - extern const Order CarrierIgnore2; - extern const Order Reaver; - extern const Order TrainFighter; - extern const Order InterceptorAttack; - extern const Order ScarabAttack; - extern const Order RechargeShieldsUnit; - extern const Order RechargeShieldsBattery; - extern const Order ShieldBattery; - extern const Order InterceptorReturn; - extern const Order BuildingLand; - extern const Order BuildingLiftOff; - extern const Order DroneLiftOff; - extern const Order LiftingOff; - extern const Order ResearchTech; - extern const Order Upgrade; - extern const Order Larva; - extern const Order SpawningLarva; - extern const Order Harvest1; - extern const Order Harvest2; - extern const Order MoveToGas; - extern const Order WaitForGas; - extern const Order HarvestGas; - extern const Order ReturnGas; - extern const Order MoveToMinerals; - extern const Order WaitForMinerals; - extern const Order MiningMinerals; - extern const Order Harvest3; - extern const Order Harvest4; - extern const Order ReturnMinerals; - extern const Order Interrupted; - extern const Order EnterTransport; - extern const Order PickupIdle; - extern const Order PickupTransport; - extern const Order PickupBunker; - extern const Order Pickup4; - extern const Order PowerupIdle; - extern const Order Sieging; - extern const Order Unsieging; - extern const Order InitCreepGrowth; - extern const Order SpreadCreep; - extern const Order StoppingCreepGrowth; - extern const Order GuardianAspect; - extern const Order ArchonWarp; - extern const Order CompletingArchonSummon; - extern const Order HoldPosition; - extern const Order Cloak; - extern const Order Decloak; - extern const Order Unload; - extern const Order MoveUnload; - extern const Order FireYamatoGun; - extern const Order CastLockdown; - extern const Order Burrowing; - extern const Order Burrowed; - extern const Order Unburrowing; - extern const Order CastDarkSwarm; - extern const Order CastParasite; - extern const Order CastSpawnBroodlings; - extern const Order CastEMPShockwave; - extern const Order NukeWait; - extern const Order NukeTrain; - extern const Order NukeLaunch; - extern const Order NukePaint; - extern const Order NukeUnit; - extern const Order CastNuclearStrike; - extern const Order NukeTrack; - extern const Order CloakNearbyUnits; - extern const Order PlaceMine; - extern const Order RightClickAction; - extern const Order CastRecall; - extern const Order Teleport; - extern const Order CastScannerSweep; - extern const Order Scanner; - extern const Order CastDefensiveMatrix; - extern const Order CastPsionicStorm; - extern const Order CastIrradiate; - extern const Order CastPlague; - extern const Order CastConsume; - extern const Order CastEnsnare; - extern const Order CastStasisField; - extern const Order CastHallucination; - extern const Order Hallucination2; - extern const Order ResetCollision; - extern const Order Patrol; - extern const Order CTFCOPInit; - extern const Order CTFCOPStarted; - extern const Order CTFCOP2; - extern const Order ComputerAI; - extern const Order AtkMoveEP; - extern const Order HarassMove; - extern const Order AIPatrol; - extern const Order GuardPost; - extern const Order RescuePassive; - extern const Order Neutral; - extern const Order ComputerReturn; - extern const Order SelfDestructing; - extern const Order Critter; - extern const Order HiddenGun; - extern const Order OpenDoor; - extern const Order CloseDoor; - extern const Order HideTrap; - extern const Order RevealTrap; - extern const Order EnableDoodad; - extern const Order DisableDoodad; - extern const Order WarpIn; - extern const Order Medic; - extern const Order MedicHeal; - extern const Order HealMove; - extern const Order MedicHealToIdle; - extern const Order CastRestoration; - extern const Order CastDisruptionWeb; - extern const Order CastMindControl; - extern const Order DarkArchonMeld; - extern const Order CastFeedback; - extern const Order CastOpticalFlare; - extern const Order CastMaelstrom; - extern const Order JunkYardDog; - extern const Order Fatal; - extern const Order None; - extern const Order Unknown; - }; - - static_assert(sizeof(Order) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/Player.h b/bwapi4-includes/BWAPI/Player.h deleted file mode 100644 index 31959fe..0000000 --- a/bwapi4-includes/BWAPI/Player.h +++ /dev/null @@ -1,643 +0,0 @@ -#pragma once -#include - -#include -#include -#include -#include -#include - -namespace BWAPI -{ - // Forwards - class Color; - class ForceInterface; - typedef ForceInterface *Force; - class PlayerType; - class TechType; - class Unitset; - class UpgradeType; - class WeaponType; - - struct PlayerData; - - class PlayerInterface; - typedef PlayerInterface *Player; - - /// The Player represents a unique controller in the game. Each player in - /// a match will have his or her own player instance. There is also a neutral player which owns - /// all the neutral units (such as mineral patches and vespene geysers). - /// - /// @see Playerset, PlayerType, Race - /// @ingroup Interface - class PlayerInterface : public Interface - { - protected: - virtual ~PlayerInterface() {}; - public : - /// Retrieves a unique ID that represents the player. - /// - /// @returns - /// An integer representing the ID of the player. - virtual int getID() const = 0; - - /// Retrieves the name of the player. - /// - /// @returns - /// A std::string object containing the player's name. - /// - /// @note Don't forget to use std::string::c_str() when passing this parameter to - /// Game::sendText and other variadic functions. - /// - /// Example usage: - /// @code - /// BWAPI::Player myEnemy = BWAPI::Broodwar->enemy(); - /// if ( myEnemy != nullptr ) // Make sure there is an enemy! - /// BWAPI::Broodwar->sendText("Prepare to be crushed, %s!", myEnemy->getName().c_str()); - /// @endcode - virtual std::string getName() const = 0; - - /// Retrieves the set of all units that the player owns. This also includes - /// incomplete units. - /// - /// @returns Reference to a Unitset containing the units. - /// - /// @note This does not include units that are loaded into transports, @Bunkers, @Refineries, - /// @Assimilators, or @Extractors. - /// - /// Example usage: - /// @code - /// Unitset myUnits = BWAPI::Broodwar->self()->getUnits(); - /// for ( auto u = myUnits.begin(); u != myUnits.end(); ++u ) - /// { - /// // Do something with your units - /// } - /// @endcode - virtual const Unitset &getUnits() const = 0; - - /// Retrieves the race of the player. This allows you to change strategies - /// against different races, or generalize some commands for yourself. - /// - /// @retval Races::Unknown If the player chose Races::Random when the game started and they - /// have not been seen. - /// - /// @returns - /// The Race that the player is using. - /// - /// Example usage: - /// @code - /// if ( BWAPI::Broodwar->enemy() ) - /// { - /// BWAPI::Race enemyRace = BWAPI::Broodwar->enemy()->getRace(); - /// if ( enemyRace == Races::Zerg ) - /// BWAPI::Broodwar->sendText("Do you really think you can beat me with a zergling rush?"); - /// } - /// @endcode - virtual Race getRace() const = 0; - - /// Retrieves the player's controller type. This allows you to distinguish - /// betweeen computer and human players. - /// - /// @returns - /// The PlayerType that identifies who is controlling a player. - /// - /// @note Other players using BWAPI will be treated as a human player and return - /// PlayerTypes::Player. - /// - /// @code - /// if ( BWAPI::Broodwar->enemy() ) - /// { - /// if ( BWAPI::Broodwar->enemy()->getType() == PlayerTypes::Computer ) - /// BWAPI::Broodwar << "Looks like something I can abuse!" << std::endl; - /// } - /// @endcode - virtual PlayerType getType() const = 0; - - /// Retrieves the player's force. A force is the team that the player is - /// playing on. - /// - /// @returns - /// The Force object that the player is part of. - virtual Force getForce() const = 0; - - /// Checks if this player is allied to the specified player. - /// - /// - /// The player to check alliance with. - /// - /// - /// @retval true if this player is allied with \p player . - /// @retval false if this player is not allied with \p player. - /// - /// @note This function will also return false if this player is neutral or an observer, or - /// if \p player is neutral or an observer. - /// - /// @see isEnemy - virtual bool isAlly(const Player player) const = 0; - - /// Checks if this player is unallied to the specified player. - /// - /// - /// The player to check alliance with. - /// - /// - /// @retval true if this player is allied with \p player . - /// @retval false if this player is not allied with \p player . - /// - /// @note This function will also return false if this player is neutral or an observer, or if - /// \p player is neutral or an observer. - /// - /// @see isAlly - virtual bool isEnemy(const Player player) const = 0; - - /// Checks if this player is the neutral player. - /// - /// @retval true if this player is the neutral player. - /// @retval false if this player is any other player. - virtual bool isNeutral() const = 0; - - /// Retrieve's the player's starting location. - /// - /// @returns - /// A TilePosition containing the position of the start location. - /// - /// @retval TilePositions::None if the player does not have a start location. - /// @retval TilePositions::Unknown if an error occured while trying to retrieve the start - /// location. - /// - /// @see Game::getStartLocations, Game::getLastError - virtual TilePosition getStartLocation() const = 0; - - /// Checks if the player has achieved victory. - /// - /// @returns true if this player has achieved victory, otherwise false - virtual bool isVictorious() const = 0; - - /// Checks if the player has been defeated. - /// - /// @returns true if the player is defeated, otherwise false - virtual bool isDefeated() const = 0; - - /// Checks if the player has left the game. - /// - /// @returns true if the player has left the game, otherwise false - virtual bool leftGame() const = 0; - - /// Retrieves the current amount of minerals/ore that this player has. - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Amount of minerals that the player currently has for spending. - virtual int minerals() const = 0; - - /// Retrieves the current amount of vespene gas that this player has. - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Amount of gas that the player currently has for spending. - virtual int gas() const = 0; - - /// Retrieves the cumulative amount of minerals/ore that this player has gathered - /// since the beginning of the game, including the amount that the player starts the game - /// with (if any). - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Cumulative amount of minerals that the player has gathered. - virtual int gatheredMinerals() const = 0; - - /// Retrieves the cumulative amount of vespene gas that this player has gathered since - /// the beginning of the game, including the amount that the player starts the game with (if - /// any). - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Cumulative amount of gas that the player has gathered. - virtual int gatheredGas() const = 0; - - /// Retrieves the cumulative amount of minerals/ore that this player has spent on - /// repairing units since the beginning of the game. This function only applies to - /// @Terran players. - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Cumulative amount of minerals that the player has spent repairing. - virtual int repairedMinerals() const = 0; - - /// Retrieves the cumulative amount of vespene gas that this player has spent on - /// repairing units since the beginning of the game. This function only applies to - /// @Terran players. - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Cumulative amount of gas that the player has spent repairing. - virtual int repairedGas() const = 0; - - /// Retrieves the cumulative amount of minerals/ore that this player has gained from - /// refunding (cancelling) units and structures. - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Cumulative amount of minerals that the player has received from refunds. - virtual int refundedMinerals() const = 0; - - /// Retrieves the cumulative amount of vespene gas that this player has gained from - /// refunding (cancelling) units and structures. - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Cumulative amount of gas that the player has received from refunds. - virtual int refundedGas() const = 0; - - /// Retrieves the cumulative amount of minerals/ore that this player has spent, - /// excluding repairs. - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Cumulative amount of minerals that the player has spent. - virtual int spentMinerals() const = 0; - - /// Retrieves the cumulative amount of vespene gas that this player has spent, - /// excluding repairs. - /// - /// @note This function will return 0 if the player is inaccessible. - /// - /// @returns Cumulative amount of gas that the player has spent. - virtual int spentGas() const = 0; - - /// Retrieves the total amount of supply the player has available for unit control. - /// - /// @note In Starcraft programming, the managed supply values are double than what they appear - /// in the game. The reason for this is because @Zerglings use 0.5 visible supply. - /// - /// @note In Starcraft, the supply for each race is separate. Having a @Pylon and an @Overlord - /// will not give you 32 supply. It will instead give you 16 @Protoss supply and 16 @Zerg - /// supply. - /// - /// (optional) - /// The race to query the total supply for. If this is omitted, then the player's current - /// race will be used. - /// - /// - /// @returns The total supply available for this player and the given \p race. - /// - /// Example usage: - /// @code - /// if ( BWAPI::Broodwar->self()->supplyUsed() + 8 >= BWAPI::Broodwar->self()->supplyTotal() ) - /// { - /// // Construct pylons, supply depots, or overlords - /// } - /// @endcode - /// @see supplyUsed - virtual int supplyTotal(Race race = Races::None) const = 0; - - /// Retrieves the current amount of supply that the player is using for unit control. - /// - /// (optional) - /// The race to query the used supply for. If this is omitted, then the player's current - /// race will be used. - /// - /// - /// @returns The supply that is in use for this player and the given \p race. - /// @see supplyTotal - virtual int supplyUsed(Race race = Races::None) const = 0; - - /// Retrieves the total number of units that the player has. If the - /// information about the player is limited, then this function will only return the number - /// of visible units. - /// - /// (optional) - /// The unit type to query. UnitType macros are accepted. If this parameter is omitted, - /// then it will use UnitTypes::AllUnits by default. - /// - /// - /// @returns The total number of units of the given type that the player owns. - /// @see visibleUnitCount, completedUnitCount, incompleteUnitCount - virtual int allUnitCount(UnitType unit = UnitTypes::AllUnits) const = 0; - - /// Retrieves the total number of strictly visible units that the player has, even if - /// information on the player is unrestricted. - /// - /// (optional) - /// The unit type to query. UnitType macros are accepted. If this parameter is omitted, - /// then it will use UnitTypes::AllUnits by default. - /// - /// - /// @returns The total number of units of the given type that the player owns, and is visible - /// to the BWAPI player. - /// @see allUnitCount, completedUnitCount, incompleteUnitCount - virtual int visibleUnitCount(UnitType unit = UnitTypes::AllUnits) const = 0; - - /// Retrieves the number of completed units that the player has. If the - /// information about the player is limited, then this function will only return the number of - /// visible completed units. - /// - /// (optional) - /// The unit type to query. UnitType macros are accepted. If this parameter is omitted, - /// then it will use UnitTypes::AllUnits by default. - /// - /// - /// @returns The number of completed units of the given type that the player owns. - /// - /// Example usage: - /// @code - /// bool obtainNextUpgrade(BWAPI::UpgradeType upgType) - /// { - /// BWAPI::Player self = BWAPI::Broodwar->self(); - /// int maxLvl = self->getMaxUpgradeLevel(upgType); - /// int currentLvl = self->getUpgradeLevel(upgType); - /// if ( !self->isUpgrading(upgType) && currentLvl < maxLvl && - /// self->completedUnitCount(upgType.whatsRequired(currentLvl+1)) > 0 && - /// self->completedUnitCount(upgType.whatUpgrades()) > 0 ) - /// return self->getUnits().upgrade(upgType); - /// return false; - /// } - /// @endcode - /// - /// @see allUnitCount, visibleUnitCount, incompleteUnitCount - virtual int completedUnitCount(UnitType unit = UnitTypes::AllUnits) const = 0; - - /// Retrieves the number of incomplete units that the player has. If the - /// information about the player is limited, then this function will only return the number of - /// visible incomplete units. - /// - /// @note This function is a macro for allUnitCount() - completedUnitCount(). - /// - /// (optional) - /// The unit type to query. UnitType macros are accepted. If this parameter is omitted, - /// then it will use UnitTypes::AllUnits by default. - /// - /// - /// @returns The number of incomplete units of the given type that the player owns. - /// @see allUnitCount, visibleUnitCount, completedUnitCount - int incompleteUnitCount(UnitType unit = UnitTypes::AllUnits) const; - - /// Retrieves the number units that have died for this player. - /// - /// (optional) - /// The unit type to query. UnitType macros are accepted. If this parameter is omitted, - /// then it will use UnitTypes::AllUnits by default. - /// - /// - /// @returns The total number of units that have died throughout the game. - virtual int deadUnitCount(UnitType unit = UnitTypes::AllUnits) const = 0; - - /// Retrieves the number units that the player has killed. - /// - /// (optional) - /// The unit type to query. UnitType macros are accepted. If this parameter is omitted, - /// then it will use UnitTypes::AllUnits by default. - /// - /// - /// @returns The total number of units that the player has killed throughout the game. - virtual int killedUnitCount(UnitType unit = UnitTypes::AllUnits) const = 0; - - /// Retrieves the current upgrade level that the player has attained for a given - /// upgrade type. - /// - /// - /// The UpgradeType to query. - /// - /// - /// @returns The number of levels that the \p upgrade has been upgraded for this player. - /// - /// Example usage: - /// @code - /// bool obtainNextUpgrade(BWAPI::UpgradeType upgType) - /// { - /// BWAPI::Player self = BWAPI::Broodwar->self(); - /// int maxLvl = self->getMaxUpgradeLevel(upgType); - /// int currentLvl = self->getUpgradeLevel(upgType); - /// if ( !self->isUpgrading(upgType) && currentLvl < maxLvl && - /// self->completedUnitCount(upgType.whatsRequired(currentLvl+1)) > 0 && - /// self->completedUnitCount(upgType.whatUpgrades()) > 0 ) - /// return self->getUnits().upgrade(upgType); - /// return false; - /// } - /// @endcode - /// - /// @see UnitInterface::upgrade, getMaxUpgradeLevel - virtual int getUpgradeLevel(UpgradeType upgrade) const = 0; - - /// Checks if the player has already researched a given technology. - /// - /// - /// The TechType to query. - /// - /// - /// @returns true if the player has obtained the given \p tech, or false if they have not - /// @see isResearching, UnitInterface::research, isResearchAvailable - virtual bool hasResearched(TechType tech) const = 0; - - /// Checks if the player is researching a given technology type. - /// - /// - /// The TechType to query. - /// - /// - /// @returns true if the player is currently researching the \p tech, or false otherwise - /// @see UnitInterface::research, hasResearched - virtual bool isResearching(TechType tech) const = 0; - - /// Checks if the player is upgrading a given upgrade type. - /// - /// - /// The upgrade type to query. - /// - /// - /// @returns true if the player is currently upgrading the given \p upgrade, false otherwise - /// - /// Example usage: - /// @code - /// bool obtainNextUpgrade(BWAPI::UpgradeType upgType) - /// { - /// BWAPI::Player self = BWAPI::Broodwar->self(); - /// int maxLvl = self->getMaxUpgradeLevel(upgType); - /// int currentLvl = self->getUpgradeLevel(upgType); - /// if ( !self->isUpgrading(upgType) && currentLvl < maxLvl && - /// self->completedUnitCount(upgType.whatsRequired(currentLvl+1)) > 0 && - /// self->completedUnitCount(upgType.whatUpgrades()) > 0 ) - /// return self->getUnits().upgrade(upgType); - /// return false; - /// } - /// @endcode - /// - /// @see UnitInterface::upgrade - virtual bool isUpgrading(UpgradeType upgrade) const = 0; - - /// Retrieves the color value of the current player. - /// - /// @returns Color object that represents the color of the current player. - virtual BWAPI::Color getColor() const = 0; - - /// Retrieves the control code character that changes the color of text messages to - /// represent this player. - /// - /// @returns character code to use for text in Broodwar. - char getTextColor() const; - - /// Retrieves the maximum amount of energy that a unit type will have, taking the - /// player's energy upgrades into consideration. - /// - /// - /// The UnitType to retrieve the maximum energy for. - /// - /// - /// @returns Maximum amount of energy that the given unit type can have. - int maxEnergy(UnitType unit) const; - - /// Retrieves the top speed of a unit type, taking the player's speed upgrades into - /// consideration. - /// - /// - /// The UnitType to retrieve the top speed for. - /// - /// - /// @returns Top speed of the provided unit type for this player. - double topSpeed(UnitType unit) const; - - /// Retrieves the maximum weapon range of a weapon type, taking the player's weapon - /// upgrades into consideration. - /// - /// - /// The WeaponType to retrieve the maximum range for. - /// - /// - /// @returns Maximum range of the given weapon type for units owned by this player. - int weaponMaxRange(WeaponType weapon) const; - - /// Retrieves the sight range of a unit type, taking the player's sight range - /// upgrades into consideration. - /// - /// - /// The UnitType to retrieve the sight range for. - /// - /// - /// @returns Sight range of the provided unit type for this player. - int sightRange(UnitType unit) const; - - /// Retrieves the weapon cooldown of a unit type, taking the player's attack speed - /// upgrades into consideration. - /// - /// - /// The UnitType to retrieve the damage cooldown for. - /// - /// - /// @returns Weapon cooldown of the provided unit type for this player. - int weaponDamageCooldown(UnitType unit) const; - - /// Calculates the armor that a given unit type will have, including upgrades. - /// - /// - /// The unit type to calculate armor for, using the current player's upgrades. - /// - /// - /// @returns The amount of armor that the unit will have with the player's upgrades. - int armor(UnitType unit) const; - - /// Calculates the damage that a given weapon type can deal, including upgrades. - /// - /// - /// The weapon type to calculate for. - /// - /// - /// @returns The amount of damage that the weapon deals with this player's upgrades. - int damage(WeaponType wpn) const; - - /// Retrieves the total unit score, as seen in the end-game score screen. - /// - /// @returns The player's unit score. - virtual int getUnitScore() const = 0; - - /// Retrieves the total kill score, as seen in the end-game score screen. - /// - /// @returns The player's kill score. - virtual int getKillScore() const = 0; - - /// Retrieves the total building score, as seen in the end-game score screen. - /// - /// @returns The player's building score. - virtual int getBuildingScore() const = 0; - - /// Retrieves the total razing score, as seen in the end-game score screen. - /// - /// @returns The player's razing score. - virtual int getRazingScore() const = 0; - - /// Retrieves the player's custom score. This score is used in @UMS game - /// types. - /// - /// @returns The player's custom score. - virtual int getCustomScore() const = 0; - - /// Checks if the player is an observer player, typically in a @UMS observer - /// game. An observer player does not participate in the game. - /// - /// @returns true if the player is observing, or false if the player is capable of playing in - /// the game. - virtual bool isObserver() const = 0; - - /// Retrieves the maximum upgrades available specific to the player. This - /// value is only different from UpgradeType::maxRepeats in @UMS games. - /// - /// - /// The UpgradeType to retrieve the maximum upgrade level for. - /// - /// - /// @returns Maximum upgrade level of the given \p upgrade type. - /// - /// Example usage: - /// @code - /// bool obtainNextUpgrade(BWAPI::UpgradeType upgType) - /// { - /// BWAPI::Player self = BWAPI::Broodwar->self(); - /// int maxLvl = self->getMaxUpgradeLevel(upgType); - /// int currentLvl = self->getUpgradeLevel(upgType); - /// if ( !self->isUpgrading(upgType) && currentLvl < maxLvl && - /// self->completedUnitCount(upgType.whatsRequired(currentLvl+1)) > 0 && - /// self->completedUnitCount(upgType.whatUpgrades()) > 0 ) - /// return self->getUnits().upgrade(upgType); - /// return false; - /// } - /// @endcode - virtual int getMaxUpgradeLevel(UpgradeType upgrade) const = 0; - - /// Checks if a technology can be researched by the player. Certain - /// technologies may be disabled in @UMS game types. - /// - /// - /// The TechType to query. - /// - /// - /// @returns true if the \p tech type is available to the player for research. - virtual bool isResearchAvailable(TechType tech) const = 0; - - /// Checks if a unit type can be created by the player. Certain unit types - /// may be disabled in @UMS game types. - /// - /// - /// The UnitType to check. - /// - /// - /// @returns true if the \p unit type is available to the player. - virtual bool isUnitAvailable(UnitType unit) const = 0; - - /// Verifies that this player satisfies a unit type requirement. - /// This verifies complex type requirements involving morphable @Zerg structures. For example, - /// if something requires a @Spire, but the player has (or is in the process of morphing) a - /// @Greater_Spire, this function will identify the requirement. It is simply a convenience function - /// that performs all of the requirement checks. - /// - /// - /// The UnitType to check. - /// - /// (optional) - /// The amount of units that are required. - /// - /// - /// @returns true if the unit type requirements are met, and false otherwise. - /// - /// @since 4.1.2 - bool hasUnitTypeRequirement(UnitType unit, int amount = 1) const; - }; -}; diff --git a/bwapi4-includes/BWAPI/PlayerType.h b/bwapi4-includes/BWAPI/PlayerType.h deleted file mode 100644 index 56b1e52..0000000 --- a/bwapi4-includes/BWAPI/PlayerType.h +++ /dev/null @@ -1,82 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// Namespace containing player types (player controllers). - /// @see PlayerType - namespace PlayerTypes - { - /// Enumeration of player types (player controllers). - /// @see PlayerType - namespace Enum - { - /// Enumeration of player types (player controllers). - /// @see PlayerType - enum Enum - { - None = 0, - Computer, - Player, - RescuePassive, - RescueActive, - EitherPreferComputer, - EitherPreferHuman, - Neutral, - Closed, - Observer, - PlayerLeft, - ComputerLeft, - Unknown, - MAX - }; - }; - }; - /// Represents the type of controller for the player slot (i.e. human, computer). - /// - /// @see PlayerTypes - /// @ingroup TypeClasses - class PlayerType : public Type - { - public: - /// @copydoc Type::Type(int) - PlayerType(int id = PlayerTypes::Enum::None); - - /// Identifies whether or not this type is used for the pre-game lobby. - /// A type such as PlayerTypes::ComputerLeft would only appear in-game when a computer - /// player is defeated. - /// - /// @returns true if this type can appear in the pre-game lobby, false otherwise. - bool isLobbyType() const; - - /// Identifies whether or not this type is used in-game. A type such as - /// PlayerTypes::Closed would not be a valid in-game type. - /// - /// @returns true if the type can appear in-game, false otherwise. - /// @see isLobbyType - bool isGameType() const; - }; - - /// @ingroup Types - namespace PlayerTypes - { - /// Retrieves the set of all the PlayerTypes. - /// - /// @returns Set consisting of all valid PlayerTypes. - const PlayerType::set& allPlayerTypes(); - - extern const PlayerType None; - extern const PlayerType Computer; - extern const PlayerType Player; - extern const PlayerType RescuePassive; - extern const PlayerType EitherPreferComputer; - extern const PlayerType EitherPreferHuman; - extern const PlayerType Neutral; - extern const PlayerType Closed; - extern const PlayerType PlayerLeft; - extern const PlayerType ComputerLeft; - extern const PlayerType Unknown; - } - - static_assert(sizeof(PlayerType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/Playerset.h b/bwapi4-includes/BWAPI/Playerset.h deleted file mode 100644 index d1bd143..0000000 --- a/bwapi4-includes/BWAPI/Playerset.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once -#include "SetContainer.h" - -#include -#include - -namespace BWAPI -{ - // Forward Declarations - class PlayerInterface; - typedef PlayerInterface *Player; - class Unitset; - - /// A set containing Player objects. - class Playerset : public SetContainer> - { - public: - - /// Returns the set of all units that every player in this set owns. - /// - /// @returns Unitset containing Playerset's units - /// @see PlayerInterface::getUnits - Unitset getUnits() const; - - /// Returns the list of races that each player in the set is. - /// - /// @returns Race::set containing Playerset's races - /// @see PlayerInterface::getRace - Race::set getRaces() const; - - /// Sets the alliance status with all players contained in the Playerset. - /// - /// - /// Set to true to set the player to allied, or false for enemy. - /// - /// - /// Set to true to turn on allied victory, or false to disable it. - /// - /// - /// @see Game::setAlliance - void setAlliance(bool allies = true, bool alliedVictory = true); - - }; -} - diff --git a/bwapi4-includes/BWAPI/Position.h b/bwapi4-includes/BWAPI/Position.h deleted file mode 100644 index 7f44401..0000000 --- a/bwapi4-includes/BWAPI/Position.h +++ /dev/null @@ -1,435 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -namespace BWAPI -{ - // Declaration - template - class Point; - - // Restrictions (no division by 0 or types too small to contain map positions) - template class Point {}; - template class Point {}; - template class Point {}; - template class Point {}; - - /// The Point class is a base class that implements convenience members and performs - /// conversions for several different position scales. It is intended to be inherited - /// or typedef'd for use with BWAPI. Users can extend the Point class, and implement their own - /// members, and it will remain compatible with BWAPI. - /// - /// @tparam T - /// The underlying type of the x and y values. BWAPI uses int. - /// @tparam Scale - /// The underlying scale that this is intended to be used for. The smaller this value, the - /// higher the precision. A value of 1 indicates the pixel level. - /// - /// Consider the following: - /// @code - /// class VectorPos : public BWAPI::Point // Same as BWAPI::Position with underlying type double - /// { - /// public: - /// VectorPos(double x_, double y_) : BWAPI::Point(x_, y_) {} - /// // ... whatever members that operate with the underling type double - /// }; - /// @endcode - /// - /// It then follows that this code will work without incident: - /// @code - /// BWAPI::Unit myUnit; // assume that the unit is valid and assigned elsewhere - /// VectorPos myPos{5.7, 8.2}; - /// myUnit->move(myPos); // Automatic type conversion, unit is moved to (5,8) - /// @endcode - /// - /// @note For full compatibility with BWAPI, \p T must have a precision of at least 16 bits and - /// \p Scale must be a factor of 32. - template - class Point - { - public: - typedef std::deque< Point > list; - - Point() = default; - Point(T _x, T _y) : x(_x), y(_y) {} - - /// A copy constructor for positions with different underlying types. - /// - /// - /// The Point to receive data from. - /// - /// - /// @tparam FromT - /// The type being converted to type T. - template Point(const Point &pt) : x( static_cast(pt.x) ), y( static_cast(pt.y) ) {} - -#pragma warning( push ) -#pragma warning( disable: 4723 ) - /// A conversion copy constructor to convert positions of different scales to one - /// another. - /// - /// @tparam FromT - /// The type that it is converting from. - /// @tparam FromScale - /// The scale that it is converting from. - template explicit Point(const Point &pt) - : x(static_cast(FromScale > Scale ? pt.x*(FromScale / Scale) : pt.x / (Scale / FromScale))) - , y(static_cast(FromScale > Scale ? pt.y*(FromScale / Scale) : pt.y / (Scale / FromScale))) { } -#pragma warning( pop ) - - // Operators - /// A convenience for use with if statements to identify if a position is valid. - /// @see isValid - explicit operator bool() const { return this->isValid(); }; - - bool operator == (const Point &pos) const - { - return std::tie(this->x, this->y) == std::tie(pos.x, pos.y); - }; - bool operator != (const Point &pos) const - { - return !(*this == pos); - }; - - /// A less than operator that enables positions to be used by additional STL containers. - /// Compares lexicographically the x position, followed by the y position. - bool operator < (const Point &position) const - { - return std::tie(this->x, this->y) < std::tie(position.x, position.y); - }; - - inline Point &operator += (const Point &p) - { - x += p.x; - y += p.y; - return *this; - }; - inline Point operator + (const Point &p) const - { - Point r(*this); - return r += p; - }; - inline Point &operator -= (const Point &p) - { - x -= p.x; - y -= p.y; - return *this; - }; - inline Point operator - (const Point &p) const - { - Point r(*this); - return r -= p; - }; - - inline Point &operator *= (const T &v) - { - x *= v; - y *= v; - return *this; - }; - inline Point operator *(const T &v) const - { - Point r(*this); - return r *= v; - }; - inline Point &operator |= (const T &v) - { - x |= v; - y |= v; - return *this; - }; - inline Point operator |(const T &v) const - { - Point r(*this); - return r |= v; - }; - inline Point &operator &= (const T &v) - { - x &= v; - y &= v; - return *this; - }; - inline Point operator &(const T &v) const - { - Point r(*this); - return r &= v; - }; - inline Point &operator ^= (const T &v) - { - x ^= v; - y ^= v; - return *this; - }; - inline Point operator ^(const T &v) const - { - Point r(*this); - return r ^= v; - }; - - Point operator / (const T &v) const - { - Point result(*this); - return result /= v; - }; - Point &operator /= (const T &val) - { - if (val == 0) { x = 32000 / Scale; y = 32000 / Scale; } - else { x /= val; y /= val; } - return *this; - }; - Point operator %(const T &v) const - { - Point result(*this); - return result %= v; - }; - Point &operator %= (const T &val) - { - if (val == 0) { x = 32000 / Scale; y = 32000 / Scale; } - else { x %= val; y %= val; } - return *this; - }; - - /// Ouput stream operator overload. Outputs the Point in the format "(x,y)" without - /// quotations. - /// - /// - /// Output stream. - /// - /// - /// Point to output. - /// - /// @returns Output stream \p out. - friend std::ostream &operator << (std::ostream &out, const Point &pt) - { - return out << '(' << pt.x << ',' << pt.y << ')'; - }; - /// @overload - friend std::wostream &operator << (std::wostream &out, const Point &pt) - { - return out << L'(' << pt.x << L',' << pt.y << L')'; - }; - - /// Input stream operator overload. Reads the input in the form "x y" without - /// quotations. The x and y values are read as type T(typically int or float) and - /// stored into pt. - /// - /// - /// The input stream. - /// - /// - /// The receiving variable. - /// - /// @returns Input stream \p in. - friend std::istream &operator >> (std::istream &in, Point &pt) - { - return in >> pt.x >> pt.y; - }; - /// @overload - friend std::wistream &operator >> (std::wistream &in, Point &pt) - { - return in >> pt.x >> pt.y; - }; - - /// Checks if this point is within the game's map bounds. - /// - /// @note If the Broodwar pointer is not initialized, this function will check validity - /// against the largest (256x256) map size. - /// - /// @retval true If it is a valid position and on the map/playing field. - /// @retval false If this is not a valid position. - /// - /// @see makeValid - bool isValid() const; - - /// Checks if this point is within the game's map bounds, if not, then it will set - /// the x and y values to be within map bounds. For example, if x is less than 0, - /// then x is set to 0. - /// - /// @note If the Broodwar pointer is not initialized, this function will check validity - /// against the largest (256x256) map size. - /// - /// @returns A reference to itself. - /// @see isValid - Point &makeValid(); - - /// Gets an accurate distance measurement from this point to the given position. - /// - /// @note This function impedes performance. In most cases you should use getApproxDistance. - /// - /// - /// The target position to get the distance to. - /// - /// - /// @returns A double representing the distance between this point and \p position. - /// @see getApproxDistance - double getDistance(const Point &position) const - { - return ((*this) - position).getLength(); - }; - - /// Gets the length of this point from the top left corner of the map. - /// - /// @note This function impedes performance. In most cases you should use getApproxDistance. - /// - /// @returns A double representing the length of this point from (0,0). - /// @see getApproxDistance - double getLength() const - { - double x = (double)this->x; - double y = (double)this->y; - return sqrt(x * x + y * y); - }; - - /// Retrieves the approximate distance using an algorithm from Starcraft: Broodwar. - /// - /// @note This function is desired because it uses the same "imperfect" algorithm used in - /// Broodwar, so that calculations will be consistent with the game. It is also optimized - /// for performance. - /// - /// - /// The target point to measure the distance to. - /// - /// - /// @returns An integer representing the distance between this point and \p position. - /// @see getDistance - int getApproxDistance(const Point &position) const - { - unsigned int min = abs((int)(this->x - position.x)); - unsigned int max = abs((int)(this->y - position.y)); - if ( max < min ) - std::swap(min, max); - - if ( min < (max >> 2) ) - return max; - - unsigned int minCalc = (3*min) >> 3; - return (minCalc >> 5) + minCalc + max - (max >> 4) - (max >> 6); - }; - - /// Sets the maximum x and y values. If the current x or y values exceed - /// the given maximum, then values are set to the maximum. - /// - /// - /// Maximum x value. - /// - /// - /// Maximum y value. - /// - /// - /// @returns A reference to itself. - /// @see setMin - Point &setMax(T max_x, T max_y) - { - if ( x > max_x ) - x = max_x; - if ( y > max_y ) - y = max_y; - return *this; - }; - /// @overload - Point &setMax(const Point &max) - { - this->setMax(max.x, max.y); - return *this; - }; - - /// Sets the minimum x and y values. If the current x or y values are - /// below the given minimum, then values are set to the minimum. - /// - /// - /// Minimum x value. - /// - /// - /// Minimum y value. - /// - /// - /// @returns A reference to itself. - /// @see setMax - Point &setMin(T min_x, T min_y) - { - if ( x < min_x ) - x = min_x; - if ( y < min_y ) - y = min_y; - return *this; - }; - /// @overload - Point &setMin(const Point &min) - { - this->setMin(min.x, min.y); - return *this; - }; - - /// The x and y members for this class. - /// - /// Simply reference these members when retrieving a position's x and y values. - T x = T{}, y = T{}; - }; - - /// The scale of a @ref Position. Each position corresponds to a 1x1 pixel area. - /// @see Position - const int POSITION_SCALE = 1; - - /// The scale of a @ref WalkPosition. Each walk position corresponds to an 8x8 pixel area. - /// @see WalkPosition - const int WALKPOSITION_SCALE = 8; - - /// The scale of a @ref TilePosition. Each tile position corresponds to a 32x32 pixel area. - /// @see TilePosition - const int TILEPOSITION_SCALE = 32; - - /// Indicates a position that is 1x1 pixel in size. This is the most precise position type. - /// @see Positions - typedef BWAPI::Point Position; - - /// List of special @ref Position constants. - namespace Positions - { - /// @hideinitializer - const Position Invalid{32000 / POSITION_SCALE, 32000 / POSITION_SCALE}; - /// @hideinitializer - const Position None{32000 / POSITION_SCALE, 32032 / POSITION_SCALE}; - /// @hideinitializer - const Position Unknown{32000 / POSITION_SCALE, 32064 / POSITION_SCALE}; - const Position Origin{0, 0}; - } - - /// Indicates a position that is 8x8 pixels in size. - /// @see Game::isWalkable, WalkPositions - typedef BWAPI::Point WalkPosition; - - /// List of special @ref WalkPosition constants. - namespace WalkPositions - { - /// @hideinitializer - const WalkPosition Invalid{32000 / WALKPOSITION_SCALE, 32000 / WALKPOSITION_SCALE}; - /// @hideinitializer - const WalkPosition None{32000 / WALKPOSITION_SCALE, 32032 / WALKPOSITION_SCALE}; - /// @hideinitializer - const WalkPosition Unknown{32000 / WALKPOSITION_SCALE, 32064 / WALKPOSITION_SCALE}; - const WalkPosition Origin{0,0}; - } - - /// Indicates a position that is 32x32 pixels in size. Typically used for building placement. - /// @see TilePositions - typedef BWAPI::Point TilePosition; - - /// List of special @ref TilePosition constants. - namespace TilePositions - { - /// @hideinitializer - const TilePosition Invalid{32000 / TILEPOSITION_SCALE, 32000 / TILEPOSITION_SCALE}; - /// @hideinitializer - const TilePosition None{32000 / TILEPOSITION_SCALE, 32032 / TILEPOSITION_SCALE}; - /// @hideinitializer - const TilePosition Unknown{32000 / TILEPOSITION_SCALE, 32064 / TILEPOSITION_SCALE}; - const TilePosition Origin{0, 0}; - } - - static_assert(sizeof(Position) == 8, "Expected BWAPI Position to be 8 bytes."); - static_assert(sizeof(TilePosition) == 8, "Expected BWAPI Position to be 8 bytes."); - static_assert(sizeof(WalkPosition) == 8, "Expected BWAPI Position to be 8 bytes."); -} diff --git a/bwapi4-includes/BWAPI/PositionUnit.h b/bwapi4-includes/BWAPI/PositionUnit.h deleted file mode 100644 index 81a9309..0000000 --- a/bwapi4-includes/BWAPI/PositionUnit.h +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - class UnitInterface; - typedef UnitInterface *Unit; - - /// PositionOrUnit is a class that is either a Position or a Unit. - /// The purpose of this class is to reduce interface overhead by combining two commonly passed - /// values into one, and to allow more function overloads with less effort. - class PositionOrUnit - { - public: - /// Unit constructor. Assigns this class to contain a unit. - /// - /// - /// The unit to assign to this class. - /// - PositionOrUnit(Unit unit = nullptr); - - /// Position constructor. Assigns this class to contain a position. - /// - /// - /// The position to assign to this class. - /// - PositionOrUnit(Position pos); - - /// Unit assignment operator. Assigns a unit to this class. - PositionOrUnit &operator =(Unit pUnit); - - /// Position assignment operator. Assigns a position to this class. - PositionOrUnit &operator =(Position pos); - - /// Indicates if a Unit is currently held in this class. - /// - /// @returns true if the value contained within this class is considered a unit, and false if - /// it is a position. - bool isUnit() const; - - /// Retrieves the Unit attached to this class, if there is one. - /// - /// @returns The Unit that was assigned to this class. - /// @retval nullptr If this class does not contain a unit, or if nullptr was assigned to - /// this class as a Unit. - Unit getUnit() const; - - /// Indicates if a Position is currently held in this class. - /// - /// @returns true if the value contained within this class is considered a position, and false - /// if it is a unit. - bool isPosition() const; - - /// Retrieves the position if it was assigned to this class, otherwise it will - /// retrieve the position of the unit contained within this class if there is one. - /// - /// @returns Position that was stored if there is one. If not, then the position of the unit - /// will be used instead. - /// @retval Positions::None if a nullptr Unit was assigned to this class. - Position getPosition() const; - - private: - /// @cond HIDDEN - union - { - struct - { - int x, y; - } position; - struct - { - Unit pUnit; - int y; - } unit; - }; - /// @endcond - }; - -} diff --git a/bwapi4-includes/BWAPI/Race.h b/bwapi4-includes/BWAPI/Race.h deleted file mode 100644 index 4190e75..0000000 --- a/bwapi4-includes/BWAPI/Race.h +++ /dev/null @@ -1,107 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - class UnitType; - - /// Namespace containing all valid races. - /// @see Race - namespace Races - { - /// Enumeration of races. - /// @see Race - namespace Enum - { - /// Enumeration of races. - /// @see Race - enum Enum - { - Zerg = 0, - Terran, - Protoss, - Other, - Unused, - Select, - Random, - None, - Unknown, - MAX - }; - }; - } - - /// The Race object is used to get information about a particular race. For - /// example, the default worker and supply provider UnitType. - /// - /// As you should already know, Starcraft has three races: @Terran , @Protoss , and @Zerg . - /// @see UnitType::getRace, PlayerInterface::getRace, Races - /// @ingroup TypeClasses - class Race : public Type - { - public: - /// @copydoc Type::Type(int) - Race(int id = Races::Enum::None); - - /// Retrieves the default worker type for this Race. - /// - /// @note In Starcraft, workers are the units that are used to construct structures. - /// - /// @returns UnitType of the worker that this race uses. - UnitType getWorker() const; - - /// Retrieves the default resource center UnitType that is used to create expansions for - /// this Race. - /// - /// @note In Starcraft, the center is the very first structure of the Race's technology - /// tree. Also known as its base of operations or resource depot. - /// - /// @returns UnitType of the center that this race uses. - UnitType getCenter() const; - - /// Retrieves the default structure UnitType for this Race that is used to harvest gas from - /// @Geysers. - /// - /// @note In Starcraft, you must first construct a structure over a @Geyser in order to - /// begin harvesting Vespene Gas. - /// - /// @returns UnitType of the structure used to harvest gas. - UnitType getRefinery() const; - - /// Retrieves the default transport UnitType for this race that is used to transport ground - /// units across the map. - /// - /// @note In Starcraft, transports will allow you to carry ground units over unpassable - /// terrain. - /// - /// @returns UnitType for transportation. - UnitType getTransport() const; - - /// Retrieves the default supply provider UnitType for this race that is used to construct - /// units. - /// - /// @note In Starcraft, training, morphing, or warping in units requires that the player - /// has sufficient supply available for their Race. - /// - /// @returns UnitType that provides the player with supply. - UnitType getSupplyProvider() const; - }; - - /// @ingroup Types - namespace Races - { - /// Retrieves the set of all valid races. - /// - /// @returns Race::set containing all the Race types. - const Race::set& allRaces(); - - extern const Race Zerg; - extern const Race Terran; - extern const Race Protoss; - extern const Race Random; - extern const Race None; - extern const Race Unknown; - } - - static_assert(sizeof(Race) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/Region.h b/bwapi4-includes/BWAPI/Region.h deleted file mode 100644 index 5cbbb36..0000000 --- a/bwapi4-includes/BWAPI/Region.h +++ /dev/null @@ -1,134 +0,0 @@ -#pragma once -#include -#include -#include -#include - -namespace BWAPI -{ - class Regionset; - class Unitset; - - class RegionInterface; - typedef RegionInterface *Region; - - /// Region objects are created by Starcraft: Broodwar to contain several tiles with the same - /// properties, and create a node in pathfinding and other algorithms. Regions may not contain - /// detailed information, but have a sufficient amount of data to identify general chokepoints, - /// accessibility to neighboring terrain, be used in general pathing algorithms, and used as - /// nodes to rally units to. - /// - /// Most parameters that are available are explicitly assigned by Broodwar itself. - /// - /// @see Game::getAllRegions, Game::getRegionAt, UnitInterface::getRegion - /// @ingroup Interface - class RegionInterface : public Interface - { - protected: - virtual ~RegionInterface() {}; - public: - /// Retrieves a unique identifier for this region. - /// - /// @note This identifier is explicitly assigned by Broodwar. - /// - /// @returns An integer that represents this region. - /// @see Game::getRegion - virtual int getID() const = 0; - - /// Retrieves a unique identifier for a group of regions that are all connected and - /// accessible by each other. That is, all accessible regions will have the same - /// group ID. This function is generally used to check if a path is available between two - /// points in constant time. - /// - /// @note This identifier is explicitly assigned by Broodwar. - /// - /// @returns An integer that represents the group of regions that this one is attached to. - virtual int getRegionGroupID() const = 0; - - /// Retrieves the center of the region. This position is used as the node - /// of the region. - /// - /// @returns A Position indicating the center location of the Region, in pixels. - virtual BWAPI::Position getCenter() const = 0; - - /// Checks if this region is part of higher ground. Higher ground may be - /// used in strategic placement of units and structures. - /// - /// @returns true if this region is part of strategic higher ground, and false otherwise. - virtual bool isHigherGround() const = 0; - - /// Retrieves a value that represents the strategic advantage of this region relative - /// to other regions. A value of 2 may indicate a possible choke point, and a value - /// of 3 indicates a signficant strategic position. - /// - /// @note This value is explicitly assigned by Broodwar. - /// - /// @returns An integer indicating this region's strategic potential. - virtual int getDefensePriority() const = 0; - - /// Retrieves the state of accessibility of the region. The region is - /// considered accessible if it can be accessed by ground units. - /// - /// @returns true if ground units can traverse this region, and false if the tiles in this - /// region are inaccessible or unwalkable. - virtual bool isAccessible() const = 0; - - /// Retrieves the set of neighbor Regions that this one is connected to. - /// - /// @returns A reference to a Regionset containing the neighboring Regions. - virtual const Regionset &getNeighbors() const = 0; - - /// Retrieves the approximate left boundary of the region. - /// - /// @returns The x coordinate, in pixels, of the approximate left boundary of the region. - virtual int getBoundsLeft() const = 0; - - /// Retrieves the approximate top boundary of the region. - /// - /// @returns The y coordinate, in pixels, of the approximate top boundary of the region. - virtual int getBoundsTop() const = 0; - - /// Retrieves the approximate right boundary of the region. - /// - /// @returns The x coordinate, in pixels, of the approximate right boundary of the region. - virtual int getBoundsRight() const = 0; - - /// Retrieves the approximate bottom boundary of the region. - /// - /// @returns The y coordinate, in pixels, of the approximate bottom boundary of the region. - virtual int getBoundsBottom() const = 0; - - /// Retrieves the closest accessible neighbor region. - /// - /// @returns The closest Region that is accessible. - virtual BWAPI::Region getClosestAccessibleRegion() const = 0; - - /// Retrieves the closest inaccessible neighbor region. - /// - /// @returns The closest Region that is inaccessible. - virtual BWAPI::Region getClosestInaccessibleRegion() const = 0; - - /// Retrieves the center-to-center distance between two regions. - /// - /// - /// The target Region to calculate distance to. - /// - /// @returns The integer distance from this Region to \p other. - int getDistance(BWAPI::Region other) const; - - /// Retrieves a Unitset containing all the units that are in this region. - /// Also has the ability to filter the units before the creation of the Unitset. - /// - /// (optional) - /// If this parameter is used, it is a UnitFilter or function predicate that will retrieve - /// only the units whose attributes match the given criteria. If omitted, then a default - /// value of nullptr is used, in which case there is no filter. - /// - /// - /// @returns A Unitset containing all units in this region that have met the requirements - /// of \p pred. - /// - /// @see UnitFilter - Unitset getUnits(const UnitFilter &pred = nullptr) const; - }; -}; diff --git a/bwapi4-includes/BWAPI/Regionset.h b/bwapi4-includes/BWAPI/Regionset.h deleted file mode 100644 index e15586a..0000000 --- a/bwapi4-includes/BWAPI/Regionset.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once -#include "SetContainer.h" -#include -#include - -namespace BWAPI -{ - // Forward Declarations - class RegionInterface; - typedef RegionInterface *Region; - - class Unitset; - - /// A container that holds a set of Region objects. - class Regionset : public SetContainer> - { - public: - - /// @copydoc RegionInterface::getCenter - Position getCenter() const; - - /// @copydoc RegionInterface::getUnits - Unitset getUnits(const UnitFilter &pred = nullptr) const; - }; -} - diff --git a/bwapi4-includes/BWAPI/SetContainer.h b/bwapi4-includes/BWAPI/SetContainer.h deleted file mode 100644 index f1aed25..0000000 --- a/bwapi4-includes/BWAPI/SetContainer.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once -#include -#include - -namespace BWAPI -{ - template - using SetContainerUnderlyingT = std::unordered_set < T, HashT >; - - /// This container is used to wrap convenience functions for BWAPI and be used as a - /// bridge with a built-in set type. - /// - /// @tparam T - /// Type that this set contains. - /// @tparam HashT - /// Hash type. Defaults to integral hashing for BWAPI usage. - template > - class SetContainer : public SetContainerUnderlyingT < T, HashT > - { - public: - SetContainer() : SetContainerUnderlyingT() {} - SetContainer(SetContainer const &other) : SetContainerUnderlyingT(other) {} - SetContainer(SetContainer &&other) : SetContainerUnderlyingT(std::forward(other)) {} - SetContainer(std::initializer_list ilist) : SetContainerUnderlyingT(ilist) {} - - template - SetContainer(IterT _begin, IterT _end) : SetContainerUnderlyingT(_begin, _end) {} - - /// Iterates the set and erases each element x where pred(x) returns true. - /// - /// - /// Predicate for removing elements. - /// - /// @see std::erase_if - template - void erase_if(const Pred& pred) { - auto it = this->begin(); - while (it != this->end()) { - if (pred(*it)) it = this->erase(it); - else ++it; - } - }; - - /// Checks if this set contains a specific value. - /// - /// - /// Value to search for. - /// - bool contains(T const &value) const - { - return count(value) != 0; - } - }; - -} diff --git a/bwapi4-includes/BWAPI/TechType.h b/bwapi4-includes/BWAPI/TechType.h deleted file mode 100644 index d2ae413..0000000 --- a/bwapi4-includes/BWAPI/TechType.h +++ /dev/null @@ -1,214 +0,0 @@ -#pragma once -#include -#include - -namespace BWAPI -{ - class UnitType; - class WeaponType; - class Order; - class Race; - - /// Namespace containing tech types. - /// @see TechType - namespace TechTypes - { - /// Enumeration of Tech Types. - /// @see TechType - namespace Enum - { - /// Enumeration of Tech Types. - /// @see TechType - enum Enum - { - Stim_Packs = 0, - Lockdown, - EMP_Shockwave, - Spider_Mines, - Scanner_Sweep, - Tank_Siege_Mode, - Defensive_Matrix, - Irradiate, - Yamato_Gun, - Cloaking_Field, - Personnel_Cloaking, - Burrowing, - Infestation, - Spawn_Broodlings, - Dark_Swarm, - Plague, - Consume, - Ensnare, - Parasite, - Psionic_Storm, - Hallucination, - Recall, - Stasis_Field, - Archon_Warp, - Restoration, - Disruption_Web, - Unused_26, - Mind_Control, - Dark_Archon_Meld, - Feedback, - Optical_Flare, - Maelstrom, - Lurker_Aspect, - Unused_33, - Healing, - - None = 44, - Nuclear_Strike, - Unknown, - MAX - }; - }; - } - /// The TechType (or Technology Type, also referred to as an Ability) represents a Unit's ability - /// which can be researched with UnitInterface::research or used with UnitInterface::useTech. - /// In order for a Unit to use its own specialized ability, it must first be available and researched. - /// - /// @see TechTypes - /// @ingroup TypeClasses - class TechType : public Type - { - public: - /// @copydoc Type::Type(int) - TechType(int id = TechTypes::Enum::None); - - /// Retrieves the race that is required to research or use the TechType. - /// - /// @note There is an exception where @Infested_Kerrigan can use @Psi_Storm. This does not - /// apply to the behavior of this function. - /// - /// @returns Race object indicating which race is designed to use this technology type. - Race getRace() const; - - /// Retrieves the mineral cost of researching this technology. - /// - /// @returns Amount of minerals needed in order to research this technology. - int mineralPrice() const; - - /// Retrieves the vespene gas cost of researching this technology. - /// - /// @returns Amount of vespene gas needed in order to research this technology. - int gasPrice() const; - - /// Retrieves the number of frames needed to research the tech type. - /// - /// @returns The time, in frames, it will take for the research to complete. - /// @see UnitInterface::getRemainingResearchTime - int researchTime() const; - - /// Retrieves the amount of energy needed to use this TechType as an ability. - /// - /// @returns Energy cost of the ability. - /// @see UnitInterface::getEnergy - int energyCost() const; - - /// Retrieves the UnitType that can research this technology. - /// - /// @returns UnitType that is able to research the technology in the game. - /// @retval UnitTypes::None If the technology/ability is either provided for free or never - /// available. - UnitType whatResearches() const; - - /// Retrieves the Weapon that is attached to this tech type. - /// A technology's WeaponType is used to indicate the range and behaviour of the ability - /// when used by a Unit. - /// - /// @returns WeaponType containing information about the ability's behavior. - /// @retval WeaponTypes::None If there is no corresponding WeaponType. - WeaponType getWeapon() const; - - /// Checks if this ability can be used on other units. - /// - /// @returns true if the ability can be used on other units, and false if it can not. - bool targetsUnit() const; - - /// Checks if this ability can be used on the terrain (ground). - /// - /// @returns true if the ability can be used on the terrain. - bool targetsPosition() const; - - /// Retrieves the set of all UnitTypes that are capable of using this ability. - /// - /// @returns Set of UnitTypes that can use this ability when researched. - const UnitType::set& whatUses() const; - - /// Retrieves the Order that a Unit uses when using this ability. - /// - /// @returns Order representing the action a Unit uses to perform this ability - Order getOrder() const; - - /// Retrieves the UnitType required to research this technology. - /// The required unit type must be a completed unit owned by the player researching the - /// technology. - /// - /// @returns UnitType that is needed to research this tech type. - /// @retval UnitTypes::None if no unit is required to research this tech type. - /// - /// @see PlayerInterface::completedUnitCount - /// - /// @since 4.1.2 - UnitType requiredUnit() const; - }; - - /// @ingroup Types - namespace TechTypes - { - /// Retrieves the set of all the TechTypes. - /// - /// @returns Set of all available TechTypes. - const TechType::set& allTechTypes(); - - /// @name Terran Abilities - /// @{ - extern const TechType Stim_Packs; - extern const TechType Lockdown; - extern const TechType EMP_Shockwave; - extern const TechType Spider_Mines; - extern const TechType Scanner_Sweep; - extern const TechType Tank_Siege_Mode; - extern const TechType Defensive_Matrix; - extern const TechType Irradiate; - extern const TechType Yamato_Gun; - extern const TechType Cloaking_Field; - extern const TechType Personnel_Cloaking; - extern const TechType Restoration; - extern const TechType Optical_Flare; - extern const TechType Healing; - extern const TechType Nuclear_Strike; - /// @} - /// @name Zerg Abilities - /// @{ - extern const TechType Burrowing; - extern const TechType Infestation; - extern const TechType Spawn_Broodlings; - extern const TechType Dark_Swarm; - extern const TechType Plague; - extern const TechType Consume; - extern const TechType Ensnare; - extern const TechType Parasite; - extern const TechType Lurker_Aspect; - /// @} - /// @name Protoss Abilities - /// @{ - extern const TechType Psionic_Storm; - extern const TechType Hallucination; - extern const TechType Recall; - extern const TechType Stasis_Field; - extern const TechType Archon_Warp; - extern const TechType Disruption_Web; - extern const TechType Mind_Control; - extern const TechType Dark_Archon_Meld; - extern const TechType Feedback; - extern const TechType Maelstrom; - /// @} - - extern const TechType None; - extern const TechType Unknown; - }; - - static_assert(sizeof(TechType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/TournamentAction.h b/bwapi4-includes/BWAPI/TournamentAction.h deleted file mode 100644 index f4f1427..0000000 --- a/bwapi4-includes/BWAPI/TournamentAction.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -namespace BWAPI -{ - /// Contains a list of interruptable actions that the tournament module can allow or deny. - /// @see TournamentModule::onAction - namespace Tournament - { - /// Contains a list of interruptable actions that the tournament module can allow or deny. - /// @see TournamentModule::onAction - enum ActionID - { - /// @see Game::enableFlag - EnableFlag, - - /// @see Game::pauseGame - PauseGame, - - /// @see Game::resumeGame - ResumeGame, - - /// @see Game::leaveGame - LeaveGame, - - /// @see Game::setLocalSpeed - SetLocalSpeed, - - /// @see Game::setTextSize - SetTextSize, - - /// @see Game::setLatCom - SetLatCom, - - /// @see Game::setGUI - SetGUI, - - /// @see Game::setMap - SetMap, - - /// @see Game::setFrameSkip - SetFrameSkip, - - /// @see Game::printf - Printf, - - /// @see Game::sendText - SendText, - - /// @see Game::setCommandOptimizationLevel - SetCommandOptimizationLevel - }; - - }; -}; diff --git a/bwapi4-includes/BWAPI/Type.h b/bwapi4-includes/BWAPI/Type.h deleted file mode 100644 index 79f13d8..0000000 --- a/bwapi4-includes/BWAPI/Type.h +++ /dev/null @@ -1,160 +0,0 @@ -#pragma once -#include - -#include -#include -#include -#include -#include -#include - -namespace BWAPI -{ - template class Type; - - /// Base superclass for all BWAPI Types. - /// - /// @tparam T - /// The type class that this Type is representing. - /// - /// @tparam UnknownId - /// The enum ID of the unknown entry, which is also treated as the last entry for type - /// validity. - template - class Type - { - protected: - /// @cond HIDDEN - /// Primitive storage unit for the type identifier (type id). - int tid; - - /// Array of strings containing the type names. - static const std::string typeNames[UnknownId+1]; - - /// Type that maps names to their type values. - typedef std::unordered_map typeMapT; - /// @endcond - private: - static typeMapT typeMapInit() - { - typeMapT result(UnknownId+1); - for ( int i = 0; i < UnknownId + 1; ++i ) // include unknown - { - std::string n( typeNames[i] ); - - // erase-remove idiom, eliminates spaces and underscores from the string - n.erase( std::remove_if(n.begin(), n.end(), [](char const &c){ return isspace(c) || c == '_'; }), n.end() ); - - // Make lowercase - std::transform (n.begin (), n.end (), n.begin (), ::tolower); - - result.insert( typeMapT::value_type(n, T(i)) ); - } - return result; - } - public: - /// Expected type constructor. If the type is an invalid type, then it - /// becomes Types::Unknown. A type is invalid if its value is less than 0 or greater than - /// Types::Unknown. - /// - /// - /// The id that corresponds to this type. It is typically an integer value that corresponds - /// to an internal Broodwar type. If the given id is invalid, then it becomes Types::Unknown. - /// - explicit Type(int id) : tid( id < 0 || id > UnknownId ? UnknownId : id ) {}; - - /// A set type that contains the current type. - typedef SetContainer set; - - /// A list type that contains the current type. - typedef std::deque list; - - /// Conversion/convenience operator to convert this type to its primitive type. - /// - /// @returns An integer representation of this type. - inline operator int() const { return this->tid; }; - - /// Retrieves this type's identifier as an integer. - /// - /// @returns An integer representation of this type. - inline int getID() const { return this->tid; }; - - /// Checks if the current type has a valid identifier. The purpose of - /// this function is to prevent buffer overflows if a type has been handled improperly. - /// - /// A type is valid if it is between 0 and Unknown (inclusive). - /// - /// @returns true If this type is valid and false otherwise. - inline bool isValid() const { return this->tid >= 0 && this->tid <= UnknownId; }; - - /// Retrieves the variable name of the type. - /// - /// @returns Reference to std::string object containing the name. - inline const std::string &getName() const - { - return typeNames[this->isValid() ? this->tid : UnknownId]; - }; - - /// @copydoc Type::getName - inline const std::string &toString() const - { - return this->getName(); - }; - - /// Retrieves the variable name of the type as a c-style string. Meant to - /// be a convenience member. - /// - /// @returns Pointer to constant c-style string containing the name. - inline const char *c_str() const - { - return this->getName().c_str(); - }; - - /// Output stream operator overload. Allows printing of the type without - /// calling Type::getName. - /// - /// - /// The destination output stream. - /// - /// - /// The type to write as a string. - /// - friend inline std::ostream &operator << (std::ostream &out, const Type &t) - { - return out << t.getName(); - }; - /// @overload - friend inline std::wostream &operator << (std::wostream &out, const Type &t) - { - std::wstring wideName{ t.getName().begin(), t.getName().end() }; - return out << wideName; - }; - - /// Searches for the type associated with the given string and returns it. - /// - /// - /// A string containing the name of the type. - /// - /// @returns The type that resolves to the given name. - static T getType(std::string name) - { - // Mapping of strings to types - static const typeMapT typeMap( typeMapInit() ); - - // erase-remove idiom, eliminates spaces and underscores from the string to search - name.erase( std::remove_if(name.begin(), name.end(), [](char const &c){ return isspace(c) || c == '_'; }), name.end() ); - - // Make lowercase - std::transform (name.begin (), name.end (), name.begin (), ::tolower); - - // Find the type - auto it = typeMap.find(name); - if ( it != typeMap.end() ) - return it->second; - - // Return unknown if it wasn't found - return T(UnknownId); - }; - }; - -} diff --git a/bwapi4-includes/BWAPI/UnaryFilter.h b/bwapi4-includes/BWAPI/UnaryFilter.h deleted file mode 100644 index 043a5e1..0000000 --- a/bwapi4-includes/BWAPI/UnaryFilter.h +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// UnaryFilter allows for logical functor combinations. - /// - /// @code - /// Unit myUnit; - /// // The following two if statements are equivalent - /// if ( myUnit->getType().isWorker() && myUnit->isCompleted() && myUnit->isIdle() ) - /// {} - /// - /// if ( (IsWorker && IsCompleted && IsIdle)(myUnit) ) - /// {} - /// @endcode - /// - /// @tparam PType - /// The type being passed into the predicate, which will be of type bool(PType). - /// @tparam Container (optional) - /// Storage container for the function predicate. It is std::function by default. - template > - class UnaryFilter - { - private: - Container pred; - public: - // ctor - template < typename T > - UnaryFilter(const T &predicate) : pred(predicate) {} - - // Default copy/move ctor/assign and dtor - - // logical operators - template - inline UnaryFilter > operator &&(const T& other) const - { - return [=](PType v){ return (*this)(v) && other(v); }; - }; - - template - inline UnaryFilter > operator ||(const T& other) const - { - return [=](PType v){ return (*this)(v) || other(v); }; - }; - - inline UnaryFilter > operator !() const - { - if ( !this->pred ) - return nullptr; - return [=](PType v){ return !(*this)(v); }; - }; - - // call - inline bool operator()(PType v) const - { - return pred(v); - }; - - // operator bool - inline bool isValid() const - { - return (bool)pred; - }; - - }; - -} diff --git a/bwapi4-includes/BWAPI/Unit.h b/bwapi4-includes/BWAPI/Unit.h deleted file mode 100644 index fdae652..0000000 --- a/bwapi4-includes/BWAPI/Unit.h +++ /dev/null @@ -1,2460 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include - -namespace BWAPI -{ - // Forwards - class PlayerInterface; - typedef PlayerInterface *Player; - class Order; - class TechType; - class UpgradeType; - - class RegionInterface; - typedef RegionInterface *Region; - - class UnitCommand; - class UnitCommandType; - class Unitset; - class WeaponType; - - class UnitInterface; - typedef UnitInterface *Unit; - - /// The Unit class is used to get information about individual units as well as issue - /// orders to units. Each unit in the game has a unique Unit object, and Unit objects - /// are not deleted until the end of the match (so you don't need to worry about unit pointers - /// becoming invalid). - /// - /// Every Unit in the game is either accessible or inaccessible. To determine if an AI can access - /// a particular unit, BWAPI checks to see if Flag::CompleteMapInformation is enabled. So there - /// are two cases to consider - either the flag is enabled, or it is disabled: - /// - /// If Flag::CompleteMapInformation is disabled, then a unit is accessible if and only if it is visible. - /// @note Some properties of visible enemy units will not be made available to the AI (such as the - /// contents of visible enemy dropships). If a unit is not visible, UnitInterface::exists will return false, - /// regardless of whether or not the unit exists. This is because absolutely no state information on - /// invisible enemy units is made available to the AI. To determine if an enemy unit has been destroyed, the - /// AI must watch for AIModule::onUnitDestroy messages from BWAPI, which is only called for visible units - /// which get destroyed. - /// - /// If Flag::CompleteMapInformation is enabled, then all units that exist in the game are accessible, and - /// UnitInterface::exists is accurate for all units. Similarly AIModule::onUnitDestroy messages are generated for all - /// units that get destroyed, not just visible ones. - /// - /// If a Unit is not accessible, then only the getInitial__ functions will be available to the AI. - /// However for units that were owned by the player, getPlayer and getType will continue to work for units - /// that have been destroyed. - /// - /// @ingroup Interface - class UnitInterface : public Interface - { - protected: - virtual ~UnitInterface() {}; - public: - /// Retrieves a unique identifier for this unit. - /// - /// @returns An integer containing the unit's identifier. - /// - /// @see getReplayID - virtual int getID() const = 0; - - /// Checks if the Unit exists in the view of the BWAPI player. - /// - /// This is used primarily to check if BWAPI has access to a specific unit, or if the - /// unit is alive. This function is more general and would be synonymous to an isAlive - /// function if such a function were necessary. - /// - /// @retval true If the unit exists on the map and is visible according to BWAPI. - /// @retval false If the unit is not accessible or the unit is dead. - /// - /// In the event that this function returns false, there are two cases to consider: - /// 1. You own the unit. This means the unit is dead. - /// 2. Another player owns the unit. This could either mean that you don't have access - /// to the unit or that the unit has died. You can specifically identify dead units - /// by polling onUnitDestroy. - /// - /// @see isVisible, isCompleted - virtual bool exists() const = 0; - - /// Retrieves the unit identifier for this unit as seen in replay data. - /// - /// @note This is only available if Flag::CompleteMapInformation is enabled. - /// - /// @returns An integer containing the replay unit identifier. - /// - /// @see getID - virtual int getReplayID() const = 0; - - /// Retrieves the player that owns this unit. - /// - /// @retval Game::neutral() If the unit is a neutral unit or inaccessible. - /// - /// @returns The owning Player interface object. - virtual Player getPlayer() const = 0; - - /// Retrieves the unit's type. - /// - /// @retval UnitTypes::Unknown if this unit is inaccessible or cannot be determined. - /// @returns A UnitType objects representing the unit's type. - /// - /// @see getInitialType - virtual UnitType getType() const = 0; - - /// Retrieves the unit's position from the upper left corner of the map in pixels. - /// The position returned is roughly the center if the unit. - /// - /// @note The unit bounds are defined as this value plus/minus the values of - /// UnitType::dimensionLeft, UnitType::dimensionUp, UnitType::dimensionRight, - /// and UnitType::dimensionDown, which is conveniently expressed in UnitInterface::getLeft, - /// UnitInterface::getTop, UnitInterface::getRight, and UnitInterface::getBottom respectively. - /// - /// @retval Positions::Unknown if this unit is inaccessible. - /// - /// @returns Position object representing the unit's current position. - /// - /// @see getTilePosition, getInitialPosition, getLeft, getTop - virtual Position getPosition() const = 0; - - /// Retrieves the unit's build position from the upper left corner of the map in - /// tiles. - /// - /// @note: This tile position is the tile that is at the top left corner of the structure. - /// - /// @retval TilePositions::Unknown if this unit is inaccessible. - /// - /// @returns TilePosition object representing the unit's current tile position. - /// - /// @see getPosition, getInitialTilePosition - TilePosition getTilePosition() const; - - /// Retrieves the unit's facing direction in radians. - /// - /// @note A value of 0.0 means the unit is facing east. - /// - /// @returns A double with the angle measure in radians. - virtual double getAngle() const = 0; - - /// Retrieves the x component of the unit's velocity, measured in pixels per frame. - /// - /// @returns A double that represents the velocity's x component. - /// - /// @see getVelocityY - virtual double getVelocityX() const = 0; - - /// Retrieves the y component of the unit's velocity, measured in pixels per frame. - /// - /// @returns A double that represents the velocity's y component. - /// - /// @see getVelocityX - virtual double getVelocityY() const = 0; - - /// Retrieves the Region that the center of the unit is in. - /// - /// @retval nullptr If the unit is inaccessible. - /// - /// @returns The Region object that contains this unit. - /// - /// Example - /// @code - /// Unitset myUnits = Broodwar->self()->getUnits(); - /// for ( auto u = myUnits.begin(); u != myUnits.end(); ++u ) - /// { - /// if ( u->isFlying() && u->isUnderAttack() ) // implies exists and isCompleted - /// { - /// Region r = u->getRegion(); - /// if ( r ) - /// u->move(r->getClosestInaccessibleRegion()); // Retreat to inaccessible region - /// } - /// } - /// @endcode - /// @implies exists - BWAPI::Region getRegion() const; - - /// Retrieves the X coordinate of the unit's left boundary, measured in pixels from - /// the left side of the map. - /// - /// @returns An integer representing the position of the left side of the unit. - /// - /// @see getTop, getRight, getBottom - int getLeft() const; - - /// Retrieves the Y coordinate of the unit's top boundary, measured in pixels from - /// the top of the map. - /// - /// @returns An integer representing the position of the top side of the unit. - /// - /// @see getLeft, getRight, getBottom - int getTop() const; - - /// Retrieves the X coordinate of the unit's right boundary, measured in pixels from - /// the left side of the map. - /// - /// @returns An integer representing the position of the right side of the unit. - /// - /// @see getLeft, getTop, getBottom - int getRight() const; - - /// Retrieves the Y coordinate of the unit's bottom boundary, measured in pixels from - /// the top of the map. - /// - /// @returns An integer representing the position of the bottom side of the unit. - /// - /// @see getLeft, getTop, getRight - int getBottom() const; - - /// Retrieves the unit's current Hit Points (HP) as seen in the game. - /// - /// @returns An integer representing the amount of hit points a unit currently has. - /// - /// @note In Starcraft, a unit usually dies when its HP reaches 0. It is possible however, to - /// have abnormal HP values in the Use Map Settings game type and as the result of a hack over - /// Battle.net. Such values include units that have 0 HP (can't be killed conventionally) - /// or even negative HP (death in one hit). - /// - /// @see UnitType::maxHitPoints, getShields, getInitialHitPoints - virtual int getHitPoints() const = 0; - - /// Retrieves the unit's current Shield Points (Shields) as seen in the game. - /// - /// @returns An integer representing the amount of shield points a unit currently has. - /// - /// @see UnitType::maxShields, getHitPoints - virtual int getShields() const = 0; - - /// Retrieves the unit's current Energy Points (Energy) as seen in the game. - /// - /// @returns An integer representing the amount of energy points a unit currently has. - /// - /// @note Energy is required in order for units to use abilities. - /// - /// @see UnitType::maxEnergy - virtual int getEnergy() const = 0; - - /// Retrieves the resource amount from a resource container, such as a Mineral Field - /// and Vespene Geyser. If the unit is inaccessible, then the last known resource - /// amount is returned. - /// - /// @returns An integer representing the last known amount of resources remaining in this - /// resource. - /// - /// @see getInitialResources - virtual int getResources() const = 0; - - /// Retrieves a grouping index from a resource container. Other resource - /// containers of the same value are considered part of one expansion location (group of - /// resources that are close together). - /// - /// @note This grouping method is explicitly determined by Starcraft itself and is used only - /// by the internal AI. - /// - /// @returns An integer with an identifier between 0 and 250 that determine which resources - /// are grouped together to form an expansion. - virtual int getResourceGroup() const = 0; - - /// Retrieves the distance between this unit and a target. - /// - /// @note Distance is calculated from the edge of this unit, using Starcraft's own distance - /// algorithm. - /// - /// - /// A Position or a Unit to calculate the distance to. If it is a unit, then it will - /// calculate the distance to the edge of the target unit. - /// - /// - /// @returns An integer representation of the number of pixels between this unit and the - /// \p target. - int getDistance(PositionOrUnit target) const; - - /// Using data provided by Starcraft, checks if there is a path available from this - /// unit to the given target. - /// - /// @note This function only takes into account the terrain data, and does not include - /// buildings when determining if a path is available. However, the complexity of this - /// function is constant ( O(1) ), and no extensive calculations are necessary. - /// - /// @note If the current unit is an air unit, then this function will always return true. - /// - /// - /// A Position or a Unit that is used to determine if this unit has a path to the target. - /// - /// - /// @retval true If there is a path between this unit and the target. - /// @retval false If the target is on a different piece of land than this one (such as an - /// island). - bool hasPath(PositionOrUnit target) const; - - /// Retrieves the frame number that sent the last successful command. - /// - /// @note This value is comparable to Game::getFrameCount. - /// - /// @returns The frame number that sent the last successfully processed command to BWAPI. - /// @see Game::getFrameCount, getLastCommand - virtual int getLastCommandFrame() const = 0; - - /// Retrieves the last successful command that was sent to BWAPI. - /// - /// @returns A UnitCommand object containing information about the command that was processed. - /// @see getLastCommandFrame - virtual UnitCommand getLastCommand() const = 0; - - /// Retrieves the Player that last attacked this unit. - /// - /// @returns Player interface object representing the player that last attacked this unit. - /// @retval nullptr If this unit was not attacked. - /// @implies exists() - virtual BWAPI::Player getLastAttackingPlayer() const = 0; - - /// Retrieves the initial type of the unit. This is the type that the unit - /// starts as in the beginning of the game. This is used to access the types of static neutral - /// units such as mineral fields when they are not visible. - /// - /// @returns UnitType of this unit as it was when it was created. - /// @retval UnitTypes::Unknown if this unit was not a static neutral unit in the beginning of - /// the game. - virtual UnitType getInitialType() const = 0; - - /// Retrieves the initial position of this unit. This is the position that - /// the unit starts at in the beginning of the game. This is used to access the positions of - /// static neutral units such as mineral fields when they are not visible. - /// - /// @returns Position indicating the unit's initial position when it was created. - /// @retval Positions::Unknown if this unit was not a static neutral unit in the beginning of - /// the game. - virtual Position getInitialPosition() const = 0; - - /// Retrieves the initial build tile position of this unit. This is the tile - /// position that the unit starts at in the beginning of the game. This is used to access the - /// tile positions of static neutral units such as mineral fields when they are not visible. - /// The build tile position corresponds to the upper left corner of the unit. - /// - /// @returns TilePosition indicating the unit's initial tile position when it was created. - /// @retval TilePositions::Unknown if this unit was not a static neutral unit in the beginning of - /// the game. - virtual TilePosition getInitialTilePosition() const = 0; - - /// Retrieves the amount of hit points that this unit started off with at the - /// beginning of the game. The unit must be neutral. - /// - /// @returns Number of hit points that this unit started with. - /// @retval 0 if this unit was not a neutral unit at the beginning of the game. - /// - /// @note: It is possible for the unit's initial hit points to differ from the maximum hit - /// points. - /// - /// @see Game::getStaticNeutralUnits - virtual int getInitialHitPoints() const = 0; - - /// Retrieves the amount of resources contained in the unit at the beginning of the - /// game. The unit must be a neutral resource container. - /// - /// @returns Amount of resources that this unit started with. - /// @retval 0 if this unit was not a neutral unit at the beginning of the game, or if this - /// unit does not contain resources. It is possible that the unit simply contains 0 resources. - /// - /// @see Game::getStaticNeutralUnits - virtual int getInitialResources() const = 0; - - /// Retrieves the number of units that this unit has killed in total. - /// - /// @note The maximum amount of recorded kills per unit is 255. - /// - /// @returns integer indicating this unit's kill count. - virtual int getKillCount() const = 0; - - /// Retrieves the number of acid spores that this unit is inflicted with. - /// - /// @returns Number of acid spores on this unit. - virtual int getAcidSporeCount() const = 0; - - /// Retrieves the number of interceptors that this unit manages. This - /// function is only for the @Carrier. - /// - /// @returns Number of interceptors in this unit. - virtual int getInterceptorCount() const = 0; - - /// Retrieves the number of scarabs that this unit has for use. This - /// function is only for the @Reaver. - /// - /// @returns Number of scarabs this unit has ready. - virtual int getScarabCount() const = 0; - - /// Retrieves the amount of @mines this unit has available. This function - /// is only for the @Vulture. - /// - /// @returns Number of spider mines available for placement. - virtual int getSpiderMineCount() const = 0; - - /// Retrieves the unit's ground weapon cooldown. This value decreases every - /// frame, until it reaches 0. When the value is 0, this indicates that the unit is capable of - /// using its ground weapon, otherwise it must wait until it reaches 0. - /// - /// @note This value will vary, because Starcraft adds an additional random value between - /// (-1) and (+2) to the unit's weapon cooldown. - /// - /// @returns Number of frames needed for the unit's ground weapon to become available again. - virtual int getGroundWeaponCooldown() const = 0; - - /// Retrieves the unit's air weapon cooldown. This value decreases every - /// frame, until it reaches 0. When the value is 0, this indicates that the unit is capable of - /// using its air weapon, otherwise it must wait until it reaches 0. - /// - /// @note This value will vary, because Starcraft adds an additional random value between - /// (-1) and (+2) to the unit's weapon cooldown. - /// - /// @returns Number of frames needed for the unit's air weapon to become available again. - virtual int getAirWeaponCooldown() const = 0; - - /// Retrieves the unit's ability cooldown. This value decreases every frame, - /// until it reaches 0. When the value is 0, this indicates that the unit is capable of using - /// one of its special abilities, otherwise it must wait until it reaches 0. - /// - /// @note This value will vary, because Starcraft adds an additional random value between - /// (-1) and (+2) to the unit's ability cooldown. - /// - /// @returns Number of frames needed for the unit's abilities to become available again. - virtual int getSpellCooldown() const = 0; - - /// Retrieves the amount of hit points remaining on the @matrix created by a - /// @Science_Vessel. The @matrix ability starts with 250 hit points when it is used. - /// - /// @returns Number of hit points remaining on this unit's @matrix. - /// - /// @see getDefenseMatrixTimer, isDefenseMatrixed - virtual int getDefenseMatrixPoints() const = 0; - - /// Retrieves the time, in frames, that the @matrix will remain active on the current - /// unit. - /// - /// @returns Number of frames remaining until the effect is removed. - /// - /// @see getDefenseMatrixPoints, isDefenseMatrixed - virtual int getDefenseMatrixTimer() const = 0; - - /// Retrieves the time, in frames, that @ensnare will remain active on the current - /// unit. - /// - /// @returns Number of frames remaining until the effect is removed. - /// - /// @see isEnsnared - virtual int getEnsnareTimer() const = 0; - - /// Retrieves the time, in frames, that @irradiate will remain active on the current - /// unit. - /// - /// @returns Number of frames remaining until the effect is removed. - /// - /// @see isIrradiated - virtual int getIrradiateTimer() const = 0; - - /// Retrieves the time, in frames, that @lockdown will remain active on the current - /// unit. - /// - /// @returns Number of frames remaining until the effect is removed. - /// - /// @see isLockdowned - virtual int getLockdownTimer() const = 0; - - /// Retrieves the time, in frames, that @maelstrom will remain active on the current - /// unit. - /// - /// @returns Number of frames remaining until the effect is removed. - /// - /// @see isMaelstrommed - virtual int getMaelstromTimer() const = 0; - - /// Retrieves an internal timer used for the primary order. Its use is - /// specific to the order type that is currently assigned to the unit. - /// - /// @returns A value used as a timer for the primary order. - /// @see getOrder - virtual int getOrderTimer() const = 0; - - /// Retrieves the time, in frames, that @plague will remain active on the current - /// unit. - /// - /// @returns Number of frames remaining until the effect is removed. - /// - /// @see isPlagued - virtual int getPlagueTimer() const = 0; - - /// Retrieves the time, in frames, until this temporary unit is destroyed or - /// removed. This is used to determine the remaining time for the following units - /// that were created by abilities: - /// - @hallucination - /// - @broodling - /// - @swarm - /// - @dweb - /// - @scanner - /// . - /// Once this value reaches 0, the unit is destroyed. - virtual int getRemoveTimer() const = 0; - - /// Retrieves the time, in frames, that @stasis will remain active on the current - /// unit. - /// - /// @returns Number of frames remaining until the effect is removed. - /// - /// @see isPlagued - virtual int getStasisTimer() const = 0; - - /// Retrieves the time, in frames, that @stim will remain active on the current - /// unit. - /// - /// @returns Number of frames remaining until the effect is removed. - /// - /// @see isPlagued - virtual int getStimTimer() const = 0; - - /// Retrieves the building type that a @worker is about to construct. If - /// the unit is morphing or is an incomplete structure, then this returns the UnitType that it - /// will become when it has completed morphing/constructing. - /// - /// @returns UnitType indicating the type that a @worker is about to construct, or an - /// incomplete unit will be when completed. - virtual UnitType getBuildType() const = 0; - - /// Retrieves the list of units queued up to be trained. - /// - /// @returns a UnitType::set containing all the types that are in this factory's training - /// queue. - /// @see train, cancelTrain, isTraining - virtual UnitType::list getTrainingQueue() const = 0; - - /// Retrieves the technology that this unit is currently researching. - /// - /// @returns TechType indicating the technology being researched by this unit. - /// @retval TechTypes::None if this unit is not researching anything. - /// - /// @see research, cancelResearch, isResearching, getRemainingResearchTime - virtual TechType getTech() const = 0; - - /// Retrieves the upgrade that this unit is currently upgrading. - /// - /// @return UpgradeType indicating the upgrade in progress by this unit. - /// @retval UpgradeTypes::None if this unit is not upgrading anything. - /// - /// @see upgrade, cancelUpgrade, isUpgrading, getRemainingUpgradeTime - virtual UpgradeType getUpgrade() const = 0; - - /// Retrieves the remaining build time for a unit or structure that is being trained - /// or constructed. - /// - /// @returns Number of frames remaining until the unit's completion. - virtual int getRemainingBuildTime() const = 0; - - /// Retrieves the remaining time, in frames, of the unit that is currently being - /// trained. - /// - /// @note If the unit is a @Hatchery, @Lair, or @Hive, this retrieves the amount of time until - /// the next larva spawns. - /// - /// @returns Number of frames remaining until the current training unit becomes completed, or - /// the number of frames remaining until the next larva spawns. - /// @retval 0 If the unit is not training or has three larvae. - /// @see train, getTrainingQueue - virtual int getRemainingTrainTime() const = 0; - - /// Retrieves the amount of time until the unit is done researching its currently - /// assigned TechType. - /// - /// @returns The remaining research time, in frames, for the current technology being - /// researched by this unit. - /// @retval 0 If the unit is not researching anything. - /// - /// @see research, cancelResearch, isResearching, getTech - virtual int getRemainingResearchTime() const = 0; - - /// Retrieves the amount of time until the unit is done upgrading its current upgrade. - /// - /// @returns The remaining upgrade time, in frames, for the current upgrade. - /// @retval 0 If the unit is not upgrading anything. - /// - /// @see upgrade, cancelUpgrade, isUpgrading, getUpgrade - virtual int getRemainingUpgradeTime() const = 0; - - /// Retrieves the corresponding paired unit for @SCVs and @Terran structures. - /// For example, if this unit is a @Factory under construction, this function will return the - /// @SCV that is constructing it. If this unit is a @SCV, then it will return the structure it - /// is currently constructing. - /// - /// @returns Paired build unit that is either constructing this unit, or being constructed by - /// this unit. - /// @retval nullptr If there is no unit constructing this one, or this unit is not constructing - /// another unit. - virtual Unit getBuildUnit() const = 0; - - /// Generally returns the appropriate target unit after issuing an order that accepts - /// a target unit (i.e. attack, repair, gather, etc.). To get a target that has been - /// acquired automatically without issuing an order, use getOrderTarget. - /// - /// @returns Unit that is currently being targeted by this unit. - /// @see getOrderTarget - virtual Unit getTarget() const = 0; - - /// Retrieves the target position the unit is moving to, provided a valid path to the - /// target position exists. - /// - /// @returns Target position of a movement action. - virtual Position getTargetPosition() const = 0; - - /// Retrieves the primary Order that the unit is assigned. Primary orders - /// are distinct actions such as Orders::AttackUnit and Orders::PlayerGuard. - /// - /// @returns The primary Order that the unit is executing. - virtual Order getOrder() const = 0; - - /// Retrieves the secondary Order that the unit is assigned. Secondary - /// orders are run in the background as a sub-order. An example would be Orders::TrainFighter, - /// because a @Carrier can move and train fighters at the same time. - /// - /// @returns The secondary Order that the unit is executing. - virtual Order getSecondaryOrder() const = 0; - - /// Retrieves the unit's primary order target. This is usually set when the - /// low level unit AI acquires a new target automatically. For example if an enemy @Probe - /// comes in range of your @Marine, the @Marine will start attacking it, and getOrderTarget - /// will be set in this case, but not getTarget. - /// - /// @returns The Unit that this unit is currently targetting. - /// @see getTarget, getOrder - virtual Unit getOrderTarget() const = 0; - - /// Retrieves the target position for the unit's order. For example, when - /// Orders::Move is assigned, getTargetPosition returns the end of the unit's path, but this - /// returns the location that the unit is trying to move to. - /// - /// @returns Position that this unit is currently targetting. - /// @see getTargetPosition, getOrder - virtual Position getOrderTargetPosition() const = 0; - - /// Retrieves the position the structure is rallying units to once they are - /// completed. - /// - /// @returns Position that a completed unit coming from this structure will travel to. - /// @retval Positions::None If this building does not produce units. - /// - /// @note If getRallyUnit is valid, then this value is ignored. - /// - /// @see setRallyPoint, getRallyUnit - virtual Position getRallyPosition() const = 0; - - /// Retrieves the unit the structure is rallying units to once they are completed. - /// Units will then follow the targetted unit. - /// - /// @returns Unit that a completed unit coming from this structure will travel to. - /// @retval nullptr If the structure is not rallied to a unit or it does not produce units. - /// - /// @note A rallied unit takes precedence over a rallied position. That is if the return value - /// is valid(non-null), then getRallyPosition is ignored. - /// - /// @see setRallyPoint, getRallyPosition - virtual Unit getRallyUnit() const = 0; - - /// Retrieves the add-on that is attached to this unit. - /// - /// @returns Unit interface that represents the add-on that is attached to this unit. - /// @retval nullptr if this unit does not have an add-on. - virtual Unit getAddon() const = 0; - - /// Retrieves the @Nydus_Canal that is attached to this one. Every - /// @Nydus_Canal can place a "Nydus Exit" which, when connected, can be travelled through by - /// @Zerg units. - /// - /// @returns Unit interface representing the @Nydus_Canal connected to this one. - /// @retval nullptr if the unit is not a @Nydus_Canal, is not owned, or has not placed a Nydus - /// Exit. - virtual Unit getNydusExit() const = 0; - - /// Retrieves the power-up that the worker unit is holding. Power-ups are - /// special units such as the @Flag in the @CTF game type, which can be picked up by worker - /// units. - /// - /// @note If your bot is strictly melee/1v1, then this method is not necessary. - /// - /// @returns The Unit interface object that represents the power-up. - /// @retval nullptr If the unit is not carrying anything. - /// - /// Example - /// @code - /// BWAPI::Unitset myUnits = BWAPI::Broodwar->self()getUnits(); - /// for ( auto u = myUnits.begin(); u != myUnits.end(); ++u ) - /// { - /// // If we are carrying a flag - /// if ( u->getPowerUp() && u->getPowerUp()->getType() == BWAPI::UnitTypes::Powerup_Flag ) - /// u->move( u->getClosestUnit(BWAPI::Filter::IsFlagBeacon && BWAPI::Filter::IsOwned) ); // return it to our flag beacon to score - /// } - /// @endcode - /// @implies getType().isWorker(), isCompleted() - virtual Unit getPowerUp() const = 0; - - /// Retrieves the @Transport or @Bunker unit that has this unit loaded inside of it. - /// - /// @returns Unit interface object representing the @Transport containing this unit. - /// @retval nullptr if this unit is not in a @Transport. - virtual Unit getTransport() const = 0; - - /// Retrieves the set of units that are contained within this @Bunker or @Transport. - /// - /// @returns A Unitset object containing all of the units that are loaded inside of the - /// current unit. - virtual Unitset getLoadedUnits() const = 0; - - /// Retrieves the remaining unit-space available for @Bunkers and @Transports. - /// - /// @returns The number of spots available to transport a unit. - /// - /// @see getLoadedUnits - int getSpaceRemaining() const; - - /// Retrieves the parent @Carrier that owns this @Interceptor. - /// - /// @returns The parent @Carrier unit that has ownership of this one. - /// @retval nullptr if the current unit is not an @Interceptor. - virtual Unit getCarrier() const = 0; - - /// Retrieves the set of @Interceptors controlled by this unit. This is - /// intended for @Carriers. - /// - /// @returns Unitset containing @Interceptor units owned by this one. - virtual Unitset getInterceptors() const = 0; - - /// Retrieves the parent @Hatchery, @Lair, or @Hive that owns this particular unit. - /// This is intended for @Larvae. - /// - /// @returns Hatchery unit that has ownership of this larva. - /// @retval nullptr if the current unit is not a @Larva or has no parent. - virtual Unit getHatchery() const = 0; - - /// Retrieves the set of @Larvae that were spawned by this unit. Only - /// @Hatcheries, @Lairs, and @Hives are capable of spawning @Larvae. This is like clicking the - /// "Select Larva" button and getting the selection of @Larvae. - /// - /// @returns Unitset containing @Larva units owned by this unit. The set will be empty if - /// there are none. - virtual Unitset getLarva() const = 0; - - /// Retrieves the set of all units in a given radius of the current unit. - /// - /// Takes into account this unit's dimensions. Can optionally specify a filter that is composed - /// using BWAPI Filter semantics to include only specific units (such as only ground units, etc.) - /// - /// - /// The radius, in pixels, to search for units. - /// - /// (optional) - /// The composed function predicate to include only specific (desired) units in the set. Defaults to - /// nullptr, which means no filter. - /// - /// - /// @returns A Unitset containing the set of units that match the given criteria. - /// - /// Example usage: - /// @code - /// // Get main building closest to start location. - /// BWAPI::Unit pMain = BWAPI::Broodwar->getClosestUnit( BWAPI::Broodwar->self()->getStartLocation(), BWAPI::Filter::IsResourceDepot ); - /// if ( pMain ) // check if pMain is valid - /// { - /// // Get sets of resources and workers - /// BWAPI::Unitset myResources = pMain->getUnitsInRadius(1024, BWAPI::Filter::IsMineralField); - /// if ( !myResources.empty() ) // check if we have resources nearby - /// { - /// BWAPI::Unitset myWorkers = pMain->getUnitsInRadius(512, BWAPI::Filter::IsWorker && BWAPI::Filter::IsIdle && BWAPI::Filter::IsOwned ); - /// while ( !myWorkers.empty() ) // make sure we command all nearby idle workers, if any - /// { - /// for ( auto u = myResources.begin(); u != myResources.end() && !myWorkers.empty(); ++u ) - /// { - /// myWorkers.back()->gather(*u); - /// myWorkers.pop_back(); - /// } - /// } - /// } // myResources not empty - /// } // pMain != nullptr - /// @endcode - /// - /// @see getClosestUnit, getUnitsInWeaponRange, Game::getUnitsInRadius, Game::getUnitsInRectangle - Unitset getUnitsInRadius(int radius, const UnitFilter &pred = nullptr) const; - - /// Obtains the set of units within weapon range of this unit. - /// - /// - /// The weapon type to use as a filter for distance and units that can be hit by it. - /// - /// (optional) - /// A predicate used as an additional filter. If omitted, no additional filter is used. - /// - /// - /// @see getUnitsInRadius, getClosestUnit, Game::getUnitsInRadius, Game::getUnitsInRectangle - Unitset getUnitsInWeaponRange(WeaponType weapon, const UnitFilter &pred = nullptr) const; - - /// Retrieves the closest unit to this one. - /// - /// (optional) - /// A function predicate used to identify which conditions must be matched for a unit to - /// be considered. If omitted, then the closest unit owned by any player will be returned. - /// - /// (optional) - /// The maximum radius to check for the closest unit. For performance reasons, a developer - /// can limit the radius that is checked. If omitted, then the entire map is checked. - /// - /// - /// @see getUnitsInRadius, Game::getUnitsInRadius, Game::getUnitsInRectangle - Unit getClosestUnit(const UnitFilter &pred = nullptr, int radius = 999999) const; - - /// Checks if the current unit is housing a @Nuke. This is only available - /// for @Silos. - /// - /// @returns true if this unit has a @Nuke ready, and false if there is no @Nuke. - virtual bool hasNuke() const = 0; - - /// Checks if the current unit is accelerating. - /// - /// @returns true if this unit is accelerating, and false otherwise - virtual bool isAccelerating() const = 0; - - /// Checks if this unit is currently attacking something. - /// - /// @returns true if this unit is attacking another unit, and false if it is not. - virtual bool isAttacking() const = 0; - - /// Checks if this unit is currently playing an attack animation. Issuing - /// commands while this returns true may interrupt the unit's next attack sequence. - /// - /// @returns true if this unit is currently running an attack frame, and false if interrupting - /// the unit is feasible. - /// - /// @note This function is only available to some unit types, specifically those that play - /// special animations when they attack. - virtual bool isAttackFrame() const = 0; - - /// Checks if the current unit is being constructed. This is mostly - /// applicable to Terran structures which require an SCV to be constructing a structure. - /// - /// @retval true if this is either a Protoss structure, Zerg structure, or Terran structure - /// being constructed by an attached SCV. - /// @retval false if this is either completed, not a structure, or has no SCV constructing it - /// - /// @see build, cancelConstruction, haltConstruction, isConstructing - bool isBeingConstructed() const; - - /// Checks this @Mineral_Field or @Refinery is currently being gathered from. - /// - /// @returns true if this unit is a resource container and being harvested by a worker, and - /// false otherwise - virtual bool isBeingGathered() const = 0; - - /// Checks if this unit is currently being healed by a @Medic or repaired by a @SCV. - /// - /// @returns true if this unit is being healed, and false otherwise. - virtual bool isBeingHealed() const = 0; - - /// Checks if this unit is currently blinded by a @Medic 's @Optical_Flare ability. - /// Blinded units have reduced sight range and cannot detect other units. - /// - /// @returns true if this unit is blind, and false otherwise - virtual bool isBlind() const = 0; - - /// Checks if the current unit is slowing down to come to a stop. - /// - /// @returns true if this unit is breaking, false if it has stopped or is still moving at full - /// speed. - virtual bool isBraking() const = 0; - - /// Checks if the current unit is burrowed, either using the @Burrow ability, or is - /// an armed @Spider_Mine. - /// - /// @returns true if this unit is burrowed, and false otherwise - /// @see burrow, unburrow - virtual bool isBurrowed() const = 0; - - /// Checks if this worker unit is carrying some vespene gas. - /// - /// @returns true if this is a worker unit carrying vespene gas, and false if it is either - /// not a worker, or not carrying gas. - /// - /// Example - /// @code - /// BWAPI::Unitset myUnits = BWAPI::Broodwar->self()->getUnits(); - /// for ( auto u = myUnits.begin(); u != myUnits.end(); ++u ) - /// { - /// if ( u->isIdle() && (u->isCarryingGas() || u->isCarryingMinerals()) ) - /// u->returnCargo(); - /// } - /// @endcode - /// @implies isCompleted(), getType().isWorker() - /// @see returnCargo, isGatheringGas, isCarryingMinerals - virtual bool isCarryingGas() const = 0; - - /// Checks if this worker unit is carrying some minerals. - /// - /// @returns true if this is a worker unit carrying minerals, and false if it is either - /// not a worker, or not carrying minerals. - /// - /// Example - /// @code - /// BWAPI::Unitset myUnits = BWAPI::Broodwar->self()->getUnits(); - /// for ( auto u = myUnits.begin(); u != myUnits.end(); ++u ) - /// { - /// if ( u->isIdle() && (u->isCarryingGas() || u->isCarryingMinerals()) ) - /// u->returnCargo(); - /// } - /// @endcode - /// @implies isCompleted(), getType().isWorker() - /// @see returnCargo, isGatheringMinerals, isCarryingMinerals - virtual bool isCarryingMinerals() const = 0; - - /// Checks if this unit is currently @cloaked. - /// - /// @returns true if this unit is cloaked, and false if it is visible. - /// @see cloak, decloak - virtual bool isCloaked() const = 0; - - /// Checks if this unit has finished being constructed, trained, morphed, or warped - /// in, and can now receive orders. - /// - /// @returns true if this unit is completed, and false if it is under construction or inaccessible. - virtual bool isCompleted() const = 0; - - /// Checks if a unit is either constructing something or moving to construct something. - /// - /// @returns true when a unit has been issued an order to build a structure and is moving to - /// the build location, or is currently constructing something. - /// - /// @see isBeingConstructed, build, cancelConstruction, haltConstruction - virtual bool isConstructing() const = 0; - - /// Checks if this unit has the @matrix effect. - /// - /// @returns true if the @matrix ability was used on this unit, and false otherwise. - bool isDefenseMatrixed() const; - - /// Checks if this unit is visible or revealed by a detector unit. If this - /// is false and #isVisible is true, then the unit is only partially visible and requires a - /// detector in order to be targetted. - /// - /// @returns true if this unit is detected, and false if it needs a detector unit nearby in - /// order to see it. - /// @implies isVisible - virtual bool isDetected() const = 0; - - /// Checks if the @Queen ability @Ensnare has been used on this unit. - /// - /// @returns true if the unit is ensnared, and false if it is not - bool isEnsnared() const; - - /// This macro function checks if this unit is in the air. That is, the unit is - /// either a flyer or a flying building. - /// - /// @returns true if this unit is in the air, and false if it is on the ground - /// @see UnitType::isFlyer, UnitInterface::isLifted - bool isFlying() const; - - /// Checks if this unit is following another unit. When a unit is following - /// another unit, it simply moves where the other unit does, and does not attack enemies when - /// it is following. - /// - /// @returns true if this unit is following another unit, and false if it is not - /// @implies isCompleted - /// @see follow, getTarget - bool isFollowing() const; - - /// Checks if this unit is currently gathering gas. That is, the unit is - /// either moving to a refinery, waiting to enter a refinery, harvesting from the refinery, or - /// returning gas to a resource depot. - /// - /// @returns true if this unit is harvesting gas, and false if it is not - /// @implies isCompleted, getType().isWorker() - /// @see isCarryingGas - virtual bool isGatheringGas() const = 0; - - /// Checks if this unit is currently harvesting minerals. That is, the unit - /// is either moving to a @mineral_field, waiting to mine, mining minerals, or returning - /// minerals to a resource depot. - /// - /// @returns true if this unit is gathering minerals, and false if it is not - /// @implies isCompleted, getType().isWorker() - /// @see isCarryingMinerals - virtual bool isGatheringMinerals() const = 0; - - /// Checks if this unit is a hallucination. Hallucinations are created by - /// the @High_Templar using the @Hallucination ability. Enemy hallucinations are unknown if - /// Flag::CompleteMapInformation is disabled. Hallucinations have a time limit until they are - /// destroyed (see UnitInterface::getRemoveTimer). - /// - /// @returns true if the unit is a hallucination and false otherwise. - /// @see getRemoveTimer - virtual bool isHallucination() const = 0; - - /// Checks if the unit is currently holding position. A unit that is holding - /// position will attack other units, but will not chase after them. - /// - /// @returns true if this unit is holding position, and false if it is not. - /// - /// @see holdPosition - bool isHoldingPosition() const; - - /// Checks if this unit is running an idle order. This function is - /// particularly useful when checking for units that aren't doing any tasks that you assigned. - /// - /// A unit is considered idle if it is not doing any of the following: - /// - Training - /// - Constructing - /// - Morphing - /// - Researching - /// - Upgrading - /// - /// In addition to running one of the following orders: - /// - Orders::PlayerGuard: Player unit idle. - /// - Orders::Guard: Generic unit idle. - /// - Orders::Stop - /// - Orders::PickupIdle - /// - Orders::Nothing: Structure/generic idle. - /// - Orders::Medic: Medic idle. - /// - Orders::Carrier: Carrier idle. - /// - Orders::Reaver: Reaver idle. - /// - Orders::Critter: Critter idle. - /// - Orders::Neutral: Neutral unit idle. - /// - Orders::TowerGuard: Turret structure idle. - /// - Orders::Burrowed: Burrowed unit idle. - /// - Orders::NukeTrain - /// - Orders::Larva: Larva idle. - /// - /// @code - /// BWAPI::Unitset myUnits = BWAPI::Broodwar->self()->getUnits(); - /// for ( auto u = myUnits.begin(); u != myUnits.end(); ++u ) - /// { - /// // Order idle worker to gather from closest mineral field - /// if ( u->getType().isWorker() && u->isIdle() ) - /// u->gather( u->getClosestUnit( BWAPI::Filter::IsMineralField ) ); - /// } - /// @endcode - /// - /// @returns true if this unit is idle, and false if this unit is performing any action, such - /// as moving or attacking - /// @implies isCompleted - /// @see UnitInterface::stop - virtual bool isIdle() const = 0; - - /// Checks if the unit can be interrupted. - /// - /// @returns true if this unit can be interrupted, or false if this unit is uninterruptable - virtual bool isInterruptible() const = 0; - - /// Checks the invincibility state for this unit. - /// - /// @returns true if this unit is currently invulnerable, and false if it is vulnerable - virtual bool isInvincible() const = 0; - - /// Checks if the target unit can immediately be attacked by this unit in the current - /// frame. - /// - /// - /// The target unit to use in this check. - /// - /// - /// @returns true if \p target is within weapon range of this unit's appropriate weapon, and - /// false otherwise. - /// @retval false if \p target is invalid, inaccessible, too close, too far, or this unit does - /// not have a weapon that can attack \p target. - bool isInWeaponRange(Unit target) const; - - /// Checks if this unit is irradiated by a @Science_Vessel 's @Irradiate ability. - /// - /// @returns true if this unit is irradiated, and false otherwise - /// - /// Example usage: - /// @code - /// BWAPI::Unitset myUnits = BWAPI::Broodwar->self()->getUnits(); - /// for ( auto u = myUnits.begin(); u != myUnits.end(); ++u ) - /// { - /// if ( u->isIrradiated() && u->getIrradiateTimer > 50 && BWAPI::Broodwar->self()->hasResearched(BWAPI::TechTypes::Restoration) ) - /// { - /// BWAPI::Unit medic = u->getClosestUnit( BWAPI::Filter::GetType == BWAPI::UnitTypes::Terran_Medic && - /// BWAPI::Filter::Energy >= BWAPI::TechTypes::Restoration.energyCost() ); - /// if ( medic ) - /// medic->useTech(BWAPI::TechTypes::Restoration, *u); - /// } - /// } - /// @endcode - /// @see getIrradiateTimer - bool isIrradiated() const; - - /// Checks if this unit is a @Terran building and lifted off the ground. - /// This function generally implies this->getType().isBuilding() and this->isCompleted() both - /// return true. - /// - /// @returns true if this unit is a @Terran structure lifted off the ground. - /// @implies isCompleted, getType().isFlyingBuilding() - /// @see isFlying - virtual bool isLifted() const = 0; - - /// Checks if this unit is currently loaded into another unit such as a @Transport. - /// - /// @returns true if this unit is loaded in another one, and false otherwise - /// @implies isCompleted - /// @see load, unload, unloadAll - bool isLoaded() const; - - /// Checks if this unit is currently @locked by a @Ghost. - /// - /// @returns true if this unit is locked down, and false otherwise - /// @see getLockdownTimer - bool isLockedDown() const; - - /// Checks if this unit has been @Maelstrommed by a @Dark_Archon. - /// - /// @returns true if this unit is maelstrommed, and false otherwise - /// @see getMaelstromTimer - bool isMaelstrommed() const; - - /// Finds out if the current unit is morphing or not. @Zerg units and - /// structures often have the ability to #morph into different types of units. This function - /// allows you to identify when this process is occurring. - /// - /// @retval true if the unit is currently morphing. - /// @retval false if the unit is not morphing - /// - /// @see morph, cancelMorph, getBuildType, getRemainingBuildTime - virtual bool isMorphing() const = 0; - - /// Checks if this unit is currently moving. - /// - /// @returns true if this unit is moving, and false if it is not - /// @see stop - virtual bool isMoving() const = 0; - - /// Checks if this unit has been parasited by some other player. - /// - /// @returns true if this unit is inflicted with @parasite, and false if it is clean - virtual bool isParasited() const = 0; - - /// Checks if this unit is patrolling between two positions. - /// - /// @returns true if this unit is patrolling and false if it is not - /// @see patrol - bool isPatrolling() const; - - /// Checks if this unit has been been @plagued by a @defiler. - /// - /// @returns true if this unit is inflicted with @plague and is taking damage, and false if it - /// is clean - /// @see getPlagueTimer - bool isPlagued() const; - - /// Checks if this unit is repairing or moving to @repair another unit. - /// This is only applicable to @SCVs. - /// - /// @returns true if this unit is currently repairing or moving to @repair another unit, and - /// false if it is not - bool isRepairing() const; - - /// Checks if this unit is a structure that is currently researching a technology. - /// See TechTypes for a complete list of technologies in Broodwar. - /// - /// @returns true if this structure is researching a technology, false otherwise - /// @see research, cancelResearch, getTech, getRemainingResearchTime, - /// @implies exists(), isCompleted(), getType().isBuilding() - bool isResearching() const; - - /// Checks if this unit has been selected in the user interface. This - /// function is only available if the flag Flag::UserInput is enabled. - /// - /// @returns true if this unit is currently selected, and false if this unit is not selected - /// @see Game::getSelectedUnits - virtual bool isSelected() const = 0; - - /// Checks if this unit is currently @sieged. This is only applicable to - /// @Siege_Tanks. - /// - /// @returns true if the unit is in siege mode, and false if it is either not in siege mode or - /// not a @Siege_Tank - /// @see siege, unsiege - bool isSieged() const; - - /// Checks if the unit is starting to attack. - /// - /// @returns true if this unit is starting an attack. - /// - /// @see attack, getGroundWeaponCooldown, getAirWeaponCooldown - virtual bool isStartingAttack() const = 0; - - /// Checks if this unit is inflicted with @Stasis by an @Arbiter. - /// - /// @returns true if this unit is locked in a @Stasis and is unable to move, and false if it - /// is free. - /// - /// @note This function does not necessarily imply that the unit is invincible, since there - /// is a feature in the @UMS game type that allows stasised units to be vulnerable. - /// - /// @see getStasisTimer - bool isStasised() const; - - /// Checks if this unit is currently under the influence of a @Stim_Pack. - /// - /// @returns true if this unit has used a stim pack, false otherwise - /// @see getStimTimer - bool isStimmed() const; - - /// Checks if this unit is currently trying to resolve a collision by randomly moving - /// around. - /// - /// @returns true if this unit is currently stuck and trying to resolve a collision, and false - /// if this unit is free - virtual bool isStuck() const = 0; - - /// Checks if this unit is training a new unit. For example, a @Barracks - /// training a @Marine. - /// - /// @note It is possible for a unit to remain in the training queue with no progress. In that - /// case, this function will return false because of supply or unit count limitations. - /// - /// @returns true if this unit is currently training another unit, and false otherwise. - /// - /// @see train, getTrainingQueue, cancelTrain, getRemainingTrainTime - virtual bool isTraining() const = 0; - - /// Checks if the current unit is being attacked. Has a small delay before - /// this returns false - /// again when the unit is no longer being attacked. - /// - /// @returns true if this unit has been attacked within the past few frames, and false - /// if it has not - virtual bool isUnderAttack() const = 0; - - /// Checks if this unit is under the cover of a @Dark_Swarm. - /// - /// @returns true if this unit is protected by a @Dark_Swarm, and false if it is not - virtual bool isUnderDarkSwarm() const = 0; - - /// Checks if this unit is currently being affected by a @Disruption_Web. - /// - /// @returns true if this unit is under the effects of @Disruption_Web. - virtual bool isUnderDisruptionWeb() const = 0; - - /// Checks if this unit is currently taking damage from a @Psi_Storm. - /// - /// @returns true if this unit is losing hit points from a @Psi_Storm, and false otherwise. - virtual bool isUnderStorm() const = 0; - - /// Checks if this unit has power. Most structures are powered by default, - /// but @Protoss structures require a @Pylon to be powered and functional. - /// - /// @returns true if this unit has power or is inaccessible, and false if this unit is - /// unpowered. - /// - /// @since 4.0.1 Beta (previously isUnpowered) - virtual bool isPowered() const = 0; - - /// Checks if this unit is a structure that is currently upgrading an upgrade. - /// See UpgradeTypes for a full list of upgrades in Broodwar. - /// - /// @returns true if this structure is upgrading, false otherwise - /// @see upgrade, cancelUpgrade, getUpgrade, getRemainingUpgradeTime - /// @implies exists(), isCompleted(), getType().isBuilding() - bool isUpgrading() const; - - /// Checks if this unit is visible. - /// - /// (optional) - /// The player to check visibility for. If this parameter is omitted, then the BWAPI player - /// obtained from Game::self will be used. - /// - /// - /// @returns true if this unit is visible to the specified \p player, and false if it is not. - /// - /// @note If the Flag::CompleteMapInformation flag is enabled, existing units hidden by the - /// fog of war will be accessible, but isVisible will still return false. - /// - /// @see exists - virtual bool isVisible(Player player = nullptr) const = 0; - - /// Performs some cheap checks to attempt to quickly detect whether the unit is - /// unable to be targetted as the target unit of an unspecified command. - /// - /// @retval true if BWAPI was unable to determine whether the unit can be a target. - /// @retval false if an error occurred and the unit can not be a target. - /// - /// @see Game::getLastError, UnitInterface::canTargetUnit - virtual bool isTargetable() const = 0; - - /// @name Unit Commands - /// @{ - - /// This function issues a command to the unit(s), however it is used for interfacing - /// only, and is recommended to use one of the more specific command functions when writing an - /// AI. - /// - /// - /// A UnitCommand containing command parameters such as the type, position, target, etc. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see UnitCommandTypes, Game::getLastError, UnitInterface::canIssueCommand - virtual bool issueCommand(UnitCommand command) = 0; - - /// Orders the unit(s) to attack move to the specified position or attack the - /// specified unit. - /// - /// - /// A Position or a Unit to designate as the target. If a Position is used, the unit will - /// perform an Attack Move command. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @note A @Medic will use Heal Move instead of attack. - /// - /// @see Game::getLastError, UnitInterface::canAttack - bool attack(PositionOrUnit target, bool shiftQueueCommand = false); - - /// Orders the worker unit(s) to construct a structure at a target position. - /// - /// - /// The UnitType to build. - /// - /// - /// A TilePosition to specify the build location, specifically the upper-left corner of the - /// location. If the target is not specified, then the function call will be redirected to - /// the train command. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @note You must have sufficient resources and meet the necessary requirements in order to - /// build a structure. - /// - /// @see Game::getLastError, UnitInterface::train, UnitInterface::cancelConstruction, UnitInterface::canBuild - bool build(UnitType type, TilePosition target = TilePositions::None); - - /// Orders the @Terran structure(s) to construct an add-on. - /// - /// - /// The add-on UnitType to construct. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @note You must have sufficient resources and meet the necessary requirements in order to - /// build a structure. - /// - /// @see Game::getLastError, UnitInterface::build, UnitInterface::cancelAddon, UnitInterface::canBuildAddon - bool buildAddon(UnitType type); - - /// Orders the unit(s) to add a UnitType to its training queue, or morphs into the - /// UnitType if it is @Zerg. - /// - /// - /// The UnitType to train. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @note You must have sufficient resources, supply, and meet the necessary requirements in - /// order to train a unit. - /// @note This command is also used for training @Interceptors and @Scarabs. - /// @note If you call this using a @Hatchery, @Lair, or @Hive, then it will automatically - /// pass the command to one of its @Larvae. - /// - /// @see Game::getLastError, UnitInterface::build, UnitInterface::morph, UnitInterface::cancelTrain, UnitInterface::isTraining, - /// UnitInterface::canTrain - bool train(UnitType type = UnitTypes::None); - - /// Orders the unit(s) to morph into a different UnitType. - /// - /// - /// The UnitType to morph into. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see Game::getLastError, UnitInterface::build, UnitInterface::morph, UnitInterface::canMorph - bool morph(UnitType type); - - /// Orders the unit to research the given tech type. - /// - /// - /// The TechType to research. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see cancelResearch, isResearching, getRemainingResearchTime, getTech, canResearch - bool research(TechType tech); - - /// Orders the unit to upgrade the given upgrade type. - /// - /// - /// The UpgradeType to upgrade. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see cancelUpgrade, isUpgrading, getRemainingUpgradeTime, getUpgrade, canUpgrade - bool upgrade(UpgradeType upgrade); - - /// Orders the unit to set its rally position to the specified position or unit. - /// - /// - /// The target position or target unit that this structure will rally to. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see getRallyPosition, getRallyUnit, canSetRallyPoint, canSetRallyPosition, canSetRallyUnit - bool setRallyPoint(PositionOrUnit target); - - /// Orders the unit to move from its current position to the specified position. - /// - /// - /// The target position to move to. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see isMoving, canMove - bool move(Position target, bool shiftQueueCommand = false); - - /// Orders the unit to patrol between its current position and the specified position. - /// While patrolling, units will attack and chase enemy units that they encounter, and then - /// return to its patrol route. @Medics will automatically heal units and then return to their - /// patrol route. - /// - /// - /// The position to patrol to. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see isPatrolling, canPatrol - bool patrol(Position target, bool shiftQueueCommand = false); - - /// Orders the unit to hold its position. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see canHoldPosition, isHoldingPosition - bool holdPosition(bool shiftQueueCommand = false); - - /// Orders the unit to stop. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see canStop, isIdle - bool stop(bool shiftQueueCommand = false); - - /// Orders the unit to follow the specified unit. Units that are following - /// other units will not perform any other actions such as attacking. They will ignore attackers. - /// - /// - /// The target unit to start following. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see isFollowing, canFollow, getOrderTarget - bool follow(Unit target, bool shiftQueueCommand = false); - - /// Orders the unit to gather the specified unit (must be mineral or refinery type). - /// - /// - /// The target unit to gather from. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see isGatheringGas, isGatheringMinerals, canGather - bool gather(Unit target, bool shiftQueueCommand = false); - - /// Orders the unit to return its cargo to a nearby resource depot such as a Command - /// Center. Only workers that are carrying minerals or gas can be ordered to return - /// cargo. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see isCarryingGas, isCarryingMinerals, canReturnCargo - bool returnCargo(bool shiftQueueCommand = false); - - /// Orders the unit to repair the specified unit. Only Terran SCVs can be - /// ordered to repair, and the target must be a mechanical @Terran unit or building. - /// - /// - /// The unit to repair. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see isRepairing, canRepair - bool repair(Unit target, bool shiftQueueCommand = false); - - /// Orders the unit to burrow. Either the unit must be a @Lurker, or the - /// unit must be a @Zerg ground unit that is capable of @Burrowing, and @Burrow technology - /// must be researched. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see unburrow, isBurrowed, canBurrow - bool burrow(); - - /// Orders a burrowed unit to unburrow. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see burrow, isBurrowed, canUnburrow - bool unburrow(); - - /// Orders the unit to cloak. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see decloak, isCloaked, canCloak - bool cloak(); - - /// Orders a cloaked unit to decloak. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see cloak, isCloaked, canDecloak - bool decloak(); - - /// Orders the unit to siege. Only works for @Siege_Tanks. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see unsiege, isSieged, canSiege - bool siege(); - - /// Orders the unit to unsiege. Only works for sieged @Siege_Tanks. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see siege, isSieged, canUnsiege - bool unsiege(); - - /// Orders the unit to lift. Only works for liftable @Terran structures. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see land, isLifted, canLift - bool lift(); - - /// Orders the unit to land. Only works for @Terran structures that are - /// currently lifted. - /// - /// - /// The tile position to land this structure at. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see lift, isLifted, canLand - bool land(TilePosition target); - - /// Orders the unit to load the target unit. Only works if this unit is a - /// @Transport or @Bunker type. - /// - /// - /// The target unit to load into this @Transport or @Bunker. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see unload, unloadAll, getLoadedUnits, isLoaded - bool load(Unit target, bool shiftQueueCommand = false); - - /// Orders the unit to unload the target unit. Only works for @Transports - /// and @Bunkers. - /// - /// - /// Unloads the target unit from this @Transport or @Bunker. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see load, unloadAll, getLoadedUnits, isLoaded, canUnload, canUnloadAtPosition - bool unload(Unit target); - - /// Orders the unit to unload all loaded units at the unit's current position. - /// Only works for @Transports and @Bunkers. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see load, unload, getLoadedUnits, isLoaded, canUnloadAll, canUnloadAtPosition - bool unloadAll(bool shiftQueueCommand = false); - - /// Orders the unit to unload all loaded units at the specified location. - /// Only works for @Transports. Not applicable to @Bunkers. - /// - /// - /// The target position to unload the units at. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see load, unload, getLoadedUnits, isLoaded, canUnloadAllPosition, canUnloadAtPosition - bool unloadAll(Position target, bool shiftQueueCommand = false); - - /// Works like the right click in the GUI. - /// - /// - /// The target position or target unit to right click. - /// - /// (optional) - /// If this value is true, then the order will be queued instead of immediately executed. - /// If this value is omitted, then the order will be executed immediately by default. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see canRightClick, canRightClickPosition, canRightClickUnit - bool rightClick(PositionOrUnit target, bool shiftQueueCommand = false); - - /// Orders a @SCV to stop constructing a structure. This leaves the - /// structure in an incomplete state until it is either cancelled, razed, or completed by - /// another @SCV. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see isConstructing, canHaltConstruction - bool haltConstruction(); - - /// Orders this unit to cancel and refund itself from begin constructed. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see isBeingConstructed, build, canCancelConstruction - bool cancelConstruction(); - - /// Orders this unit to cancel and refund an add-on that is being constructed. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see canCancelAddon, buildAddon - bool cancelAddon(); - - /// Orders the unit to remove the specified unit from its training queue. - /// - /// (optional) - /// Identifies the slot that will be cancelled. If the specified value is at least 0, then - /// the unit in the corresponding slot from the list provided by getTrainingQueue will be - /// cancelled. If the value is either omitted or -2, then the last slot is cancelled. - /// - /// - /// @note The value of slot is passed directly to Broodwar. Other negative values have no - /// effect. - /// - /// @see train, cancelTrain, isTraining, getTrainingQueue, canCancelTrain, canCancelTrainSlot - bool cancelTrain(int slot = -2); - - /// Orders this unit to cancel and refund a unit that is morphing. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see morph, isMorphing, canCancelMorph - bool cancelMorph(); - - /// Orders this unit to cancel and refund a research that is in progress. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @see research, isResearching, getTech, canCancelResearch - bool cancelResearch(); - - /// Orders this unit to cancel and refund an upgrade that is in progress. - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// @see upgrade, isUpgrading, getUpgrade, canCancelUpgrade - bool cancelUpgrade(); - - /// Orders the unit to use a technology. - /// - /// - /// The technology type to use. - /// - /// (optional) - /// If specified, indicates the target location or unit to use the tech on. If unspecified, - /// causes the \p tech to be used without a target (i.e. @Stim_Packs). - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// - /// @see canUseTechWithOrWithoutTarget, canUseTech, canUseTechWithoutTarget, canUseTechUnit, - /// canUseTechPosition, TechTypes - bool useTech(TechType tech, PositionOrUnit target = nullptr); - - /// Moves a @Flag_Beacon to a different location. This is only used for @CTF - /// or @UMS game types. - /// - /// - /// The target tile position to place the @Flag_Beacon. - /// - /// - /// @returns true if the command was passed to Broodwar, and false if BWAPI determined that - /// the command would fail. - /// @note There is a small chance for a command to fail after it has been passed to Broodwar. - /// - /// @note This command is only available for the first 10 minutes of the game, as in Broodwar. - /// - /// @see canPlaceCOP - bool placeCOP(TilePosition target); - - /// @} - /// @name Command Verifiers - /// @{ - - /// Checks whether the unit is able to execute the given command. If you - /// are calling this function repeatedly (e.g. to generate a collection of valid commands), - /// you can avoid repeating the same kinds of checks by specifying false for some of the - /// optional boolean arguments. Make sure that the state hasn't changed since the check was - /// done though (eg a new frame/event, or a command issued). Also see the more specific functions. - /// - /// - /// A UnitCommand to check. - /// - /// - /// Only used if the command type is UnitCommandTypes::Enum::Use_Tech_Position. A boolean - /// for whether to perform cheap checks for whether the unit is unable to target any - /// positions using the command's TechType (i.e. regardless of what the other command - /// parameters are). You can set this to false if you know this check has already just been - /// performed. - /// - /// - /// Only used if the command type is UnitCommandTypes::Enum::Use_Tech_Unit. A boolean for - /// whether to perform cheap checks for whether the unit is unable to target any units using - /// the command's TechType (i.e. regardless of what the other command parameters are). You - /// can set this to false if you know this check has already just been performed. - /// - /// - /// Only used if the command type is UnitCommandTypes::Build. A boolean for whether to - /// perform cheap checks for whether the unit is unable to build the specified UnitType - /// (i.e. regardless of what the other command parameters are). You can set this to false if - /// you know this check has already just been performed. - /// - /// - /// Only used for command types that can target a unit. A boolean for whether to perform - /// UnitInterface::canTargetUnit as a check. You can set this to false if you know this check has - /// already just been performed. - /// - /// - /// A boolean for whether to perform UnitInterface::canIssueCommandType as a check. You can set this - /// to false if you know this check has already just been performed. - /// - /// - /// A boolean for whether to perform UnitInterface::canCommand as a check. You can set this to false - /// if you know this check has already just been performed. - /// - /// - /// @retval true if BWAPI determined that the command is valid. - /// @retval false if an error occurred and the command is invalid. - /// - /// @see UnitCommandTypes, Game::getLastError, UnitInterface::canCommand, UnitInterface::canIssueCommandType, - /// UnitInterface::canTargetUnit - virtual bool canIssueCommand(UnitCommand command, bool checkCanUseTechPositionOnPositions = true, bool checkCanUseTechUnitOnUnits = true, bool checkCanBuildUnitType = true, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute the given command as part of a Unitset - /// (even if none of the units in the Unitset are able to execute the command individually). - /// The reason this function exists is because some commands are valid for an individual unit - /// but not for those individuals as a group (e.g. buildings, critters) and some commands are - /// only valid for a unit if it is commanded as part of a unit group, e.g.: - /// 1. attackMove/attackUnit for a Unitset, some of which can't attack, e.g. @High_Templar. - /// This is supported simply for consistency with BW's behaviour - you - /// could issue move command(s) individually instead. - /// 2. attackMove/move/patrol/rightClickPosition for air unit(s) + e.g. @Larva, as part of - /// the air stacking technique. This is supported simply for consistency with BW's - /// behaviour - you could issue move/patrol/rightClickPosition command(s) for them - /// individually instead. - /// - /// @note BWAPI allows the following special cases to command a unit individually (rather than - /// only allowing it to be commanded as part of a Unitset). These commands are not available - /// to a user in BW when commanding units individually, but BWAPI allows them for convenience: - /// - attackMove for @Medic, which is equivalent to Heal Move. - /// - holdPosition for burrowed @Lurker, for ambushes. - /// - stop for @Larva, to move it to a different side of the @Hatchery / @Lair / @Hive (e.g. - /// so that @Drones morphed later morph nearer to minerals/gas). - /// - /// @see UnitCommandTypes, Game::getLastError, UnitInterface::canIssueCommand, - /// UnitInterface::canCommandGrouped, UnitInterface::canIssueCommandTypeGrouped, UnitInterface::canTargetUnit - virtual bool canIssueCommandGrouped(UnitCommand command, bool checkCanUseTechPositionOnPositions = true, bool checkCanUseTechUnitOnUnits = true, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Performs some cheap checks to attempt to quickly detect whether the unit is unable to - /// execute any commands (eg the unit is stasised). - /// - /// @retval true if BWAPI was unable to determine whether the unit can be commanded. - /// @retval false if an error occurred and the unit can not be commanded. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand - virtual bool canCommand() const = 0; - - /// Performs some cheap checks to attempt to quickly detect whether the unit is unable to - /// execute any commands as part of a Unitset (eg buildings, critters). - /// - /// @retval true if BWAPI was unable to determine whether the unit can be commanded grouped. - /// @retval false if an error occurred and the unit can not be commanded grouped. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canIssueCommand - virtual bool canCommandGrouped(bool checkCommandibility = true) const = 0; - - /// Performs some cheap checks to attempt to quickly detect whether the unit is unable to - /// execute the given command type (i.e. regardless of what other possible command parameters - /// could be). - /// - /// - /// A UnitCommandType. - /// - /// - /// A boolean for whether to perform UnitInterface::canCommand as a check. You can set this to false - /// if you know this check has already just been performed. - /// - /// - /// @retval true if BWAPI was unable to determine whether the command type is invalid. - /// @retval false if an error occurred and the command type is invalid. - /// - /// @see UnitCommandTypes, Game::getLastError, UnitInterface::canIssueCommand - virtual bool canIssueCommandType(UnitCommandType ct, bool checkCommandibility = true) const = 0; - - /// Performs some cheap checks to attempt to quickly detect whether the unit is unable to - /// execute the given command type (i.e. regardless of what other possible command parameters - /// could be) as part of a Unitset. - /// - /// - /// A UnitCommandType. - /// - /// - /// A boolean for whether to perform UnitInterface::canCommandGrouped as a check. You can set this - /// to false if you know this check has already just been performed. - /// - /// - /// A boolean for whether to perform UnitInterface::canCommand as a check. You can set this to false - /// if you know this check has already just been performed. - /// - /// - /// @retval true if BWAPI was unable to determine whether the command type is invalid. - /// @retval false if an error occurred and the command type is invalid. - /// - /// @see UnitCommandTypes, Game::getLastError, UnitInterface::canIssueCommandGrouped - virtual bool canIssueCommandTypeGrouped(UnitCommandType ct, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Performs some cheap checks to attempt to quickly detect whether the unit is unable to - /// use the given unit as the target unit of an unspecified command. - /// - /// - /// A target unit for an unspecified command. - /// - /// - /// A boolean for whether to perform UnitInterface::canCommand as a check. You can set this to false - /// if you know this check has already just been performed. - /// - /// - /// @retval true if BWAPI was unable to determine whether the unit can target the given unit. - /// @retval false if an error occurred and the unit can not target the given unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::isTargetable - virtual bool canTargetUnit(Unit targetUnit, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute an attack command to attack-move or attack a unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::attack, - /// UnitInterface::canAttackMove, UnitInterface::canAttackUnit - virtual bool canAttack(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an attack command to attack-move or attack a (non-null) - /// unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::attack, - /// UnitInterface::canAttackMove, UnitInterface::canAttackUnit - virtual bool canAttack(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute an attack command to attack-move or attack a unit, - /// as part of a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canAttack - virtual bool canAttackGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an attack command to attack-move or attack a - /// (non-null) unit, as part of a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canAttack - virtual bool canAttackGrouped(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an attack command to attack-move. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::attack - virtual bool canAttackMove(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an attack command to attack-move, as part of a - /// Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canAttackMove - virtual bool canAttackMoveGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute an attack command to attack a unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::attack - virtual bool canAttackUnit(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an attack command to attack a unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::attack - virtual bool canAttackUnit(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute an attack command to attack a unit, - /// as part of a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canAttackUnit - virtual bool canAttackUnitGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an attack command to attack a unit, as part of - /// a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canAttackUnit - virtual bool canAttackUnitGrouped(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a build command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::build - virtual bool canBuild(bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a build command for the given - /// UnitType. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::build - virtual bool canBuild(UnitType uType, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a build command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::build - virtual bool canBuild(UnitType uType, BWAPI::TilePosition tilePos, bool checkTargetUnitType = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a buildAddon command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::buildAddon - virtual bool canBuildAddon(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a buildAddon command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::buildAddon - virtual bool canBuildAddon(UnitType uType, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a train command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::train - virtual bool canTrain(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a train command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::train - virtual bool canTrain(UnitType uType, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a morph command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::morph - virtual bool canMorph(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a morph command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::morph - virtual bool canMorph(UnitType uType, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a research command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::research - virtual bool canResearch(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a research command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::research - virtual bool canResearch(TechType type, bool checkCanIssueCommandType = true) const = 0; - - /// Cheap checks for whether the unit is able to execute an upgrade command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::upgrade - virtual bool canUpgrade(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an upgrade command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::upgrade - virtual bool canUpgrade(UpgradeType type, bool checkCanIssueCommandType = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a setRallyPoint command to a - /// position or unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::setRallyPoint, - /// UnitInterface::canSetRallyPosition, UnitInterface::canSetRallyUnit. - virtual bool canSetRallyPoint(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a setRallyPoint command to a position - /// or (non-null) unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::setRallyPoint, - /// UnitInterface::canSetRallyPosition, UnitInterface::canSetRallyUnit. - virtual bool canSetRallyPoint(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a setRallyPoint command to a position. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::setRallyPoint - virtual bool canSetRallyPosition(bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a setRallyPoint command to a unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::setRallyPoint - virtual bool canSetRallyUnit(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a setRallyPoint command to a unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::setRallyPoint - virtual bool canSetRallyUnit(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a move command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::move - virtual bool canMove(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a move command, as part of a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canMove - virtual bool canMoveGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a patrol command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::patrol - virtual bool canPatrol(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a patrol command, as part of a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canPatrol - virtual bool canPatrolGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a follow command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::follow - virtual bool canFollow(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a follow command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::follow - virtual bool canFollow(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a gather command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::gather - virtual bool canGather(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a gather command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::gather - virtual bool canGather(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a returnCargo command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::returnCargo - virtual bool canReturnCargo(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a holdPosition command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::holdPosition - virtual bool canHoldPosition(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a stop command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::stop - virtual bool canStop(bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a repair command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::repair - virtual bool canRepair(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a repair command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::repair - virtual bool canRepair(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a burrow command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::burrow - virtual bool canBurrow(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an unburrow command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::unburrow - virtual bool canUnburrow(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a cloak command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::cloak - virtual bool canCloak(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a decloak command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::decloak - virtual bool canDecloak(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a siege command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::siege - virtual bool canSiege(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an unsiege command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::unsiege - virtual bool canUnsiege(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a lift command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::lift - virtual bool canLift(bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a land command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::land - virtual bool canLand(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a land command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::land - virtual bool canLand(TilePosition target, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a load command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::load - virtual bool canLoad(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a load command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::load - virtual bool canLoad(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute an unload command or unloadAll at - /// current position command or unloadAll at a different position command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::unload, UnitInterface::unloadAll - virtual bool canUnloadWithOrWithoutTarget(bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute an unload command or unloadAll at - /// current position command or unloadAll at a different position command, for a given - /// position. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::unload, UnitInterface::unloadAll - virtual bool canUnloadAtPosition(Position targDropPos, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute an unload command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::unload - virtual bool canUnload(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an unload command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::unload, UnitInterface::canUnloadAtPosition - virtual bool canUnload(Unit targetUnit, bool checkCanTargetUnit = true, bool checkPosition = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an unloadAll command for the current position. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::unloadAll - virtual bool canUnloadAll(bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute an unloadAll command for a different - /// position. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::unloadAll - virtual bool canUnloadAllPosition(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute an unloadAll command for a different position. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::unloadAll - virtual bool canUnloadAllPosition(Position targDropPos, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a rightClick command to a position - /// or unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::rightClick, - /// UnitInterface::canRightClickPosition, UnitInterface::canRightClickUnit. - virtual bool canRightClick(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a rightClick command to a position or (non-null) - /// unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::rightClick, - /// UnitInterface::canRightClickPosition, UnitInterface::canRightClickUnit. - virtual bool canRightClick(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a rightClick command to a position - /// or unit, as part of a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canRightClickUnit - virtual bool canRightClickGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a rightClick command to a position or (non-null) - /// unit, as part of a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canRightClickUnit - virtual bool canRightClickGrouped(PositionOrUnit target, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a rightClick command for a position. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::rightClick - virtual bool canRightClickPosition(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a rightClick command for a position, as part of - /// a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canRightClick - virtual bool canRightClickPositionGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a rightClick command to a unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::rightClick - virtual bool canRightClickUnit(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a rightClick command to a unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::rightClick - virtual bool canRightClickUnit(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a rightClick command to a unit, as - /// part of a Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canRightClickUnit - virtual bool canRightClickUnitGrouped(bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a rightClick command to a unit, as part of a - /// Unitset. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommandGrouped, UnitInterface::canRightClickUnit - virtual bool canRightClickUnitGrouped(Unit targetUnit, bool checkCanTargetUnit = true, bool checkCanIssueCommandType = true, bool checkCommandibilityGrouped = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a haltConstruction command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::haltConstruction - virtual bool canHaltConstruction(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a cancelConstruction command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::cancelConstruction - virtual bool canCancelConstruction(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a cancelAddon command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::cancelAddon - virtual bool canCancelAddon(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a cancelTrain command for any slot. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::cancelTrain - virtual bool canCancelTrain(bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a cancelTrain command for an - /// unspecified slot. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::cancelTrain - virtual bool canCancelTrainSlot(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a cancelTrain command for a specified slot. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::cancelTrain - virtual bool canCancelTrainSlot(int slot, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a cancelMorph command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::cancelMorph - virtual bool canCancelMorph(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a cancelResearch command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::cancelResearch - virtual bool canCancelResearch(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a cancelUpgrade command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::cancelUpgrade - virtual bool canCancelUpgrade(bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a useTech command without a target or - /// or a useTech command with a target position or a useTech command with a target unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::useTech - virtual bool canUseTechWithOrWithoutTarget(bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a useTech command without a target or - /// or a useTech command with a target position or a useTech command with a target unit, for a - /// given TechType. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::useTech - virtual bool canUseTechWithOrWithoutTarget(BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a useTech command for a specified position or - /// unit (only specify nullptr if the TechType does not target another position/unit). - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::useTech, - /// UnitInterface::canUseTechWithoutTarget, UnitInterface::canUseTechUnit, UnitInterface::canUseTechPosition - virtual bool canUseTech(BWAPI::TechType tech, PositionOrUnit target = nullptr, bool checkCanTargetUnit = true, bool checkTargetsType = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a useTech command without a target. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::useTech - virtual bool canUseTechWithoutTarget(BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a useTech command with an unspecified - /// target unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::useTech - virtual bool canUseTechUnit(BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a useTech command with a target unit. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::useTech - virtual bool canUseTechUnit(BWAPI::TechType tech, Unit targetUnit, bool checkCanTargetUnit = true, bool checkTargetsUnits = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a useTech command with an unspecified target - /// position. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::useTech - virtual bool canUseTechPosition(BWAPI::TechType tech, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a useTech command with a target position. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::useTech - virtual bool canUseTechPosition(BWAPI::TechType tech, Position target, bool checkTargetsPositions = true, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - /// Cheap checks for whether the unit is able to execute a placeCOP command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::placeCOP - virtual bool canPlaceCOP(bool checkCommandibility = true) const = 0; - - /// Checks whether the unit is able to execute a placeCOP command. - /// - /// @see Game::getLastError, UnitInterface::canIssueCommand, UnitInterface::placeCOP - virtual bool canPlaceCOP(TilePosition target, bool checkCanIssueCommandType = true, bool checkCommandibility = true) const = 0; - - ///@} - }; -} diff --git a/bwapi4-includes/BWAPI/UnitCommand.h b/bwapi4-includes/BWAPI/UnitCommand.h deleted file mode 100644 index af877f2..0000000 --- a/bwapi4-includes/BWAPI/UnitCommand.h +++ /dev/null @@ -1,82 +0,0 @@ -#pragma once -#include -#include - -namespace BWAPI -{ - // Forwards - class UnitType; - class TechType; - class UpgradeType; - class PositionOrUnit; - class UnitInterface; - typedef UnitInterface *Unit; - - class UnitCommand - { - public: - UnitCommand() = default; - UnitCommand(Unit _unit, UnitCommandType _type, Unit _target, int _x, int _y, int _extra); - - static UnitCommand attack(Unit unit, PositionOrUnit target, bool shiftQueueCommand = false); - static UnitCommand build(Unit unit, TilePosition target, UnitType type); - static UnitCommand buildAddon(Unit unit, UnitType type); - static UnitCommand train(Unit unit, UnitType type); - static UnitCommand morph(Unit unit, UnitType type); - static UnitCommand research(Unit unit, TechType tech); - static UnitCommand upgrade(Unit unit, UpgradeType upgrade); - static UnitCommand setRallyPoint(Unit unit, PositionOrUnit target); - static UnitCommand move(Unit unit, Position target, bool shiftQueueCommand = false); - static UnitCommand patrol(Unit unit, Position target, bool shiftQueueCommand = false); - static UnitCommand holdPosition(Unit unit, bool shiftQueueCommand = false); - static UnitCommand stop(Unit unit, bool shiftQueueCommand = false); - static UnitCommand follow(Unit unit, Unit target, bool shiftQueueCommand = false); - static UnitCommand gather(Unit unit, Unit target, bool shiftQueueCommand = false); - static UnitCommand returnCargo(Unit unit, bool shiftQueueCommand = false); - static UnitCommand repair(Unit unit, Unit target, bool shiftQueueCommand = false); - static UnitCommand burrow(Unit unit); - static UnitCommand unburrow(Unit unit); - static UnitCommand cloak(Unit unit); - static UnitCommand decloak(Unit unit); - static UnitCommand siege(Unit unit); - static UnitCommand unsiege(Unit unit); - static UnitCommand lift(Unit unit); - static UnitCommand land(Unit unit, TilePosition target); - static UnitCommand load(Unit unit, Unit target, bool shiftQueueCommand = false); - static UnitCommand unload(Unit unit, Unit target); - static UnitCommand unloadAll(Unit unit, bool shiftQueueCommand = false); - static UnitCommand unloadAll(Unit unit, Position target, bool shiftQueueCommand = false); - static UnitCommand rightClick(Unit unit, PositionOrUnit target, bool shiftQueueCommand = false); - static UnitCommand haltConstruction(Unit unit); - static UnitCommand cancelConstruction(Unit unit); - static UnitCommand cancelAddon(Unit unit); - static UnitCommand cancelTrain(Unit unit, int slot = -2); - static UnitCommand cancelMorph(Unit unit); - static UnitCommand cancelResearch(Unit unit); - static UnitCommand cancelUpgrade(Unit unit); - static UnitCommand useTech(Unit unit,TechType tech); - static UnitCommand useTech(Unit unit,TechType tech, PositionOrUnit target); - static UnitCommand placeCOP(Unit unit, TilePosition target); - - UnitCommandType getType() const; - Unit getUnit() const; - Unit getTarget() const; - Position getTargetPosition() const; - TilePosition getTargetTilePosition() const; - UnitType getUnitType() const; - TechType getTechType() const; - UpgradeType getUpgradeType() const; - int getSlot() const; - bool isQueued() const; - - bool operator==(const UnitCommand& other) const; - bool operator!=(const UnitCommand& other) const; - - Unit unit = nullptr; - UnitCommandType type = UnitCommandTypes::None; - Unit target = nullptr; - int x = Positions::None.x; - int y = Positions::None.y; - int extra = 0; - }; -} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/UnitCommandType.h b/bwapi4-includes/BWAPI/UnitCommandType.h deleted file mode 100644 index cd1bfc5..0000000 --- a/bwapi4-includes/BWAPI/UnitCommandType.h +++ /dev/null @@ -1,138 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// Namespace containing unit command types. - /// @see UnitCommandType - namespace UnitCommandTypes - { - /// Enumeration of valid unit command types. - /// @see UnitCommandType - namespace Enum - { - /// Enumeration of valid unit command types. - /// @see UnitCommandType - enum Enum - { - Attack_Move = 0, - Attack_Unit, - Build, - Build_Addon, - Train, - Morph, - Research, - Upgrade, - Set_Rally_Position, - Set_Rally_Unit, - Move, - Patrol, - Hold_Position, - Stop, - Follow, - Gather, - Return_Cargo, - Repair, - Burrow, - Unburrow, - Cloak, - Decloak, - Siege, - Unsiege, - Lift, - Land, - Load, - Unload, - Unload_All, - Unload_All_Position, - Right_Click_Position, - Right_Click_Unit, - Halt_Construction, - Cancel_Construction, - Cancel_Addon, - Cancel_Train, - Cancel_Train_Slot, - Cancel_Morph, - Cancel_Research, - Cancel_Upgrade, - Use_Tech, - Use_Tech_Position, - Use_Tech_Unit, - Place_COP, - None, - Unknown, - MAX - }; - }; - }; - /// A representation of a unit command in BWAPI. This is used by bots to - /// notify BWAPI which commands to use. BWAPI filters commands accordingly and then converts - /// them to Broodwar commands, which differ in complexity. - /// - /// @see UnitCommandTypes - /// @ingroup TypeClasses - class UnitCommandType : public Type - { - public: - /// @copydoc Type::Type(int) - UnitCommandType(int id = UnitCommandTypes::Enum::None); - }; - - /// @ingroup Types - namespace UnitCommandTypes - { - /// Retrieves the set of all valid UnitCommandTypes. - /// - /// @returns Set of UnitCommandTypes. - const UnitCommandType::set& allUnitCommandTypes(); - - extern const UnitCommandType Attack_Move; - extern const UnitCommandType Attack_Unit; - extern const UnitCommandType Build; - extern const UnitCommandType Build_Addon; - extern const UnitCommandType Train; - extern const UnitCommandType Morph; - extern const UnitCommandType Research; - extern const UnitCommandType Upgrade; - extern const UnitCommandType Set_Rally_Position; - extern const UnitCommandType Set_Rally_Unit; - extern const UnitCommandType Move; - extern const UnitCommandType Patrol; - extern const UnitCommandType Hold_Position; - extern const UnitCommandType Stop; - extern const UnitCommandType Follow; - extern const UnitCommandType Gather; - extern const UnitCommandType Return_Cargo; - extern const UnitCommandType Repair; - extern const UnitCommandType Burrow; - extern const UnitCommandType Unburrow; - extern const UnitCommandType Cloak; - extern const UnitCommandType Decloak; - extern const UnitCommandType Siege; - extern const UnitCommandType Unsiege; - extern const UnitCommandType Lift; - extern const UnitCommandType Land; - extern const UnitCommandType Load; - extern const UnitCommandType Unload; - extern const UnitCommandType Unload_All; - extern const UnitCommandType Unload_All_Position; - extern const UnitCommandType Right_Click_Position; - extern const UnitCommandType Right_Click_Unit; - extern const UnitCommandType Halt_Construction; - extern const UnitCommandType Cancel_Construction; - extern const UnitCommandType Cancel_Addon; - extern const UnitCommandType Cancel_Train; - extern const UnitCommandType Cancel_Train_Slot; - extern const UnitCommandType Cancel_Morph; - extern const UnitCommandType Cancel_Research; - extern const UnitCommandType Cancel_Upgrade; - extern const UnitCommandType Use_Tech; - extern const UnitCommandType Use_Tech_Position; - extern const UnitCommandType Use_Tech_Unit; - extern const UnitCommandType Place_COP; - extern const UnitCommandType None; - extern const UnitCommandType Unknown; - } - - static_assert(sizeof(UnitCommandType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/UnitSizeType.h b/bwapi4-includes/BWAPI/UnitSizeType.h deleted file mode 100644 index 33fa978..0000000 --- a/bwapi4-includes/BWAPI/UnitSizeType.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - /// Namespace containing unit size types. - /// - /// @see UnitSizeType - /// - /// [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)
- namespace UnitSizeTypes - { - /// Enumeration of unit size types. - /// @see UnitSizeType - namespace Enum - { - /// Enumeration of unit size types. - /// @see UnitSizeType - enum Enum - { - Independent = 0, - Small, - Medium, - Large, - None, - Unknown, - MAX - }; - }; - }; - - /// Size types are used by unit types in Broodwar to determine how much damage will be - /// applied. This corresponds with DamageType for several different damage reduction - /// applications. - /// - /// @see DamageType, UnitType, UnitSizeTypes - /// - /// [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)
- /// @ingroup TypeClasses - class UnitSizeType : public Type - { - public: - /// @copydoc Type::Type(int) - UnitSizeType(int id = UnitSizeTypes::Enum::None); - }; - - /// @ingroup Types - namespace UnitSizeTypes - { - /// Retrieves the set of all valid UnitSizeTypes. - /// - /// @returns Set of all UnitSizeTypes. - const UnitSizeType::set& allUnitSizeTypes(); - - extern const UnitSizeType Independent; - extern const UnitSizeType Small; - extern const UnitSizeType Medium; - extern const UnitSizeType Large; - extern const UnitSizeType None; - extern const UnitSizeType Unknown; - } - - static_assert(sizeof(UnitSizeType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/UnitType.h b/bwapi4-includes/BWAPI/UnitType.h deleted file mode 100644 index 0074c85..0000000 --- a/bwapi4-includes/BWAPI/UnitType.h +++ /dev/null @@ -1,1238 +0,0 @@ -#pragma once -#include - -#include -#include - -namespace BWAPI -{ - // Forward Declarations - class TechType; - class UpgradeType; - class WeaponType; - class UnitSizeType; - class Race; - - /// Namespace containing unit types. - /// @see UnitType - namespace UnitTypes - { - /// Enumeration of unit types - /// @see UnitType - namespace Enum - { - /// Enumeration of unit types - /// @see UnitType - enum Enum - { - Terran_Marine = 0, - Terran_Ghost, - Terran_Vulture, - Terran_Goliath, - Terran_Goliath_Turret, - Terran_Siege_Tank_Tank_Mode, - Terran_Siege_Tank_Tank_Mode_Turret, - Terran_SCV, - Terran_Wraith, - Terran_Science_Vessel, - Hero_Gui_Montag, - Terran_Dropship, - Terran_Battlecruiser, - Terran_Vulture_Spider_Mine, - Terran_Nuclear_Missile, - Terran_Civilian, - Hero_Sarah_Kerrigan, - Hero_Alan_Schezar, - Hero_Alan_Schezar_Turret, - Hero_Jim_Raynor_Vulture, - Hero_Jim_Raynor_Marine, - Hero_Tom_Kazansky, - Hero_Magellan, - Hero_Edmund_Duke_Tank_Mode, - Hero_Edmund_Duke_Tank_Mode_Turret, - Hero_Edmund_Duke_Siege_Mode, - Hero_Edmund_Duke_Siege_Mode_Turret, - Hero_Arcturus_Mengsk, - Hero_Hyperion, - Hero_Norad_II, - Terran_Siege_Tank_Siege_Mode, - Terran_Siege_Tank_Siege_Mode_Turret, - Terran_Firebat, - Spell_Scanner_Sweep, - Terran_Medic, - Zerg_Larva, - Zerg_Egg, - Zerg_Zergling, - Zerg_Hydralisk, - Zerg_Ultralisk, - Zerg_Broodling, - Zerg_Drone, - Zerg_Overlord, - Zerg_Mutalisk, - Zerg_Guardian, - Zerg_Queen, - Zerg_Defiler, - Zerg_Scourge, - Hero_Torrasque, - Hero_Matriarch, - Zerg_Infested_Terran, - Hero_Infested_Kerrigan, - Hero_Unclean_One, - Hero_Hunter_Killer, - Hero_Devouring_One, - Hero_Kukulza_Mutalisk, - Hero_Kukulza_Guardian, - Hero_Yggdrasill, - Terran_Valkyrie, - Zerg_Cocoon, - Protoss_Corsair, - Protoss_Dark_Templar, - Zerg_Devourer, - Protoss_Dark_Archon, - Protoss_Probe, - Protoss_Zealot, - Protoss_Dragoon, - Protoss_High_Templar, - Protoss_Archon, - Protoss_Shuttle, - Protoss_Scout, - Protoss_Arbiter, - Protoss_Carrier, - Protoss_Interceptor, - Hero_Dark_Templar, - Hero_Zeratul, - Hero_Tassadar_Zeratul_Archon, - Hero_Fenix_Zealot, - Hero_Fenix_Dragoon, - Hero_Tassadar, - Hero_Mojo, - Hero_Warbringer, - Hero_Gantrithor, - Protoss_Reaver, - Protoss_Observer, - Protoss_Scarab, - Hero_Danimoth, - Hero_Aldaris, - Hero_Artanis, - Critter_Rhynadon, - Critter_Bengalaas, - Special_Cargo_Ship, - Special_Mercenary_Gunship, - Critter_Scantid, - Critter_Kakaru, - Critter_Ragnasaur, - Critter_Ursadon, - Zerg_Lurker_Egg, - Hero_Raszagal, - Hero_Samir_Duran, - Hero_Alexei_Stukov, - Special_Map_Revealer, - Hero_Gerard_DuGalle, - Zerg_Lurker, - Hero_Infested_Duran, - Spell_Disruption_Web, - Terran_Command_Center, - Terran_Comsat_Station, - Terran_Nuclear_Silo, - Terran_Supply_Depot, - Terran_Refinery, - Terran_Barracks, - Terran_Academy, - Terran_Factory, - Terran_Starport, - Terran_Control_Tower, - Terran_Science_Facility, - Terran_Covert_Ops, - Terran_Physics_Lab, - Unused_Terran1, - Terran_Machine_Shop, - Unused_Terran2, - Terran_Engineering_Bay, - Terran_Armory, - Terran_Missile_Turret, - Terran_Bunker, - Special_Crashed_Norad_II, - Special_Ion_Cannon, - Powerup_Uraj_Crystal, - Powerup_Khalis_Crystal, - Zerg_Infested_Command_Center, - Zerg_Hatchery, - Zerg_Lair, - Zerg_Hive, - Zerg_Nydus_Canal, - Zerg_Hydralisk_Den, - Zerg_Defiler_Mound, - Zerg_Greater_Spire, - Zerg_Queens_Nest, - Zerg_Evolution_Chamber, - Zerg_Ultralisk_Cavern, - Zerg_Spire, - Zerg_Spawning_Pool, - Zerg_Creep_Colony, - Zerg_Spore_Colony, - Unused_Zerg1, - Zerg_Sunken_Colony, - Special_Overmind_With_Shell, - Special_Overmind, - Zerg_Extractor, - Special_Mature_Chrysalis, - Special_Cerebrate, - Special_Cerebrate_Daggoth, - Unused_Zerg2, - Protoss_Nexus, - Protoss_Robotics_Facility, - Protoss_Pylon, - Protoss_Assimilator, - Unused_Protoss1, - Protoss_Observatory, - Protoss_Gateway, - Unused_Protoss2, - Protoss_Photon_Cannon, - Protoss_Citadel_of_Adun, - Protoss_Cybernetics_Core, - Protoss_Templar_Archives, - Protoss_Forge, - Protoss_Stargate, - Special_Stasis_Cell_Prison, - Protoss_Fleet_Beacon, - Protoss_Arbiter_Tribunal, - Protoss_Robotics_Support_Bay, - Protoss_Shield_Battery, - Special_Khaydarin_Crystal_Form, - Special_Protoss_Temple, - Special_XelNaga_Temple, - Resource_Mineral_Field, - Resource_Mineral_Field_Type_2, - Resource_Mineral_Field_Type_3, - Unused_Cave, - Unused_Cave_In, - Unused_Cantina, - Unused_Mining_Platform, - Unused_Independant_Command_Center, - Special_Independant_Starport, - Unused_Independant_Jump_Gate, - Unused_Ruins, - Unused_Khaydarin_Crystal_Formation, - Resource_Vespene_Geyser, - Special_Warp_Gate, - Special_Psi_Disrupter, - Unused_Zerg_Marker, - Unused_Terran_Marker, - Unused_Protoss_Marker, - Special_Zerg_Beacon, - Special_Terran_Beacon, - Special_Protoss_Beacon, - Special_Zerg_Flag_Beacon, - Special_Terran_Flag_Beacon, - Special_Protoss_Flag_Beacon, - Special_Power_Generator, - Special_Overmind_Cocoon, - Spell_Dark_Swarm, - Special_Floor_Missile_Trap, - Special_Floor_Hatch, - Special_Upper_Level_Door, - Special_Right_Upper_Level_Door, - Special_Pit_Door, - Special_Right_Pit_Door, - Special_Floor_Gun_Trap, - Special_Wall_Missile_Trap, - Special_Wall_Flame_Trap, - Special_Right_Wall_Missile_Trap, - Special_Right_Wall_Flame_Trap, - Special_Start_Location, - Powerup_Flag, - Powerup_Young_Chrysalis, - Powerup_Psi_Emitter, - Powerup_Data_Disk, - Powerup_Khaydarin_Crystal, - Powerup_Mineral_Cluster_Type_1, - Powerup_Mineral_Cluster_Type_2, - Powerup_Protoss_Gas_Orb_Type_1, - Powerup_Protoss_Gas_Orb_Type_2, - Powerup_Zerg_Gas_Sac_Type_1, - Powerup_Zerg_Gas_Sac_Type_2, - Powerup_Terran_Gas_Tank_Type_1, - Powerup_Terran_Gas_Tank_Type_2, - - None, - AllUnits, - Men, - Buildings, - Factories, - Unknown, - MAX - }; - - }; - } - /// The UnitType is used to get information about a particular type of unit, such as its cost, - /// build time, weapon, hit points, abilities, etc. - /// - /// @see UnitInterface::getType, UnitTypes - /// @ingroup TypeClasses - class UnitType : public Type - { - public: - /// @copydoc Type::Type(int) - UnitType(int id = UnitTypes::Enum::None); - - /// Retrieves the Race that the unit type belongs to. - /// - /// @returns Race indicating the race that owns this unit type. - /// @retval Race::None indicating that the unit type does not belong to any particular race (a - /// critter for example). - Race getRace() const; - - /// Obtains the source unit type that is used to build or train this unit type, as well as the - /// amount of them that are required. - /// - /// @returns std::pair in which the first value is the UnitType that builds this unit type, and - /// the second value is the number of those types that are required (this value is 2 for - /// @Archons, and 1 for all other types). - /// @retval pair(UnitTypes::None,0) If this unit type cannot be made by the player. - const std::pair< UnitType, int > whatBuilds() const; - - /// Retrieves the immediate technology tree requirements to make this unit type. - /// - /// @returns std::map containing a UnitType to number mapping of UnitTypes required. - const std::map< UnitType, int >& requiredUnits() const; - - /// Identifies the required TechType in order to create certain units. - /// - /// @note The only unit that requires a technology is the @Lurker, which needs @Lurker_Aspect. - /// @returns TechType indicating the technology that must be researched in order to create this - /// unit type. - /// @retval TechTypes::None If creating this unit type does not require a technology to be - /// researched. - TechType requiredTech() const; - - /// Retrieves the cloaking technology associated with certain units. - /// - /// @returns TechType referring to the cloaking technology that this unit type uses as an - /// ability. - /// @retval TechTypes::None If this unit type does not have an active cloak ability. - TechType cloakingTech() const; - - /// Retrieves the set of abilities that this unit can use, provided it is available to you in - /// the game. - /// - /// @returns Set of TechTypes containing ability information. - const SetContainer& abilities() const; - - /// Retrieves the set of upgrades that this unit can use to enhance its fighting ability. - /// - /// @return Set of UpgradeTypes containing upgrade types that will impact this unit type. - const SetContainer& upgrades() const; - - /// Retrieves the upgrade type used to increase the armor of this unit type. For each upgrade, - /// this unit type gains +1 additional armor. - /// - /// @returns UpgradeType indicating the upgrade that increases this unit type's armor amount. - UpgradeType armorUpgrade() const; - - /// Retrieves the default maximum amount of hit points that this unit type can have. - /// - /// @note This value may not necessarily match the value seen in the @UMS game type. - /// - /// @returns Integer indicating the maximum amount of hit points for this unit type. - int maxHitPoints() const; - - /// Retrieves the default maximum amount of shield points that this unit type can have. - /// - /// @note This value may not necessarily match the value seen in the @UMS game type. - /// - /// @returns Integer indicating the maximum amount of shield points for this unit type. - /// @retval 0 If this unit type does not have shields. - int maxShields() const; - - /// Retrieves the maximum amount of energy this unit type can have by default. - /// - /// @returns Integer indicating the maximum amount of energy for this unit type. - /// @retval 0 If this unit does not gain energy for abilities. - int maxEnergy() const; - - /// Retrieves the default amount of armor that the unit type starts with, excluding upgrades. - /// - /// @note This value may not necessarily match the value seen in the @UMS game type. - /// - /// @returns The amount of armor the unit type has. - int armor() const; - - /// Retrieves the default mineral price of purchasing the unit. - /// - /// @note This value may not necessarily match the value seen in the @UMS game type. - /// - /// @returns Mineral cost of the unit. - int mineralPrice() const; - - /// Retrieves the default vespene gas price of purchasing the unit. - /// - /// @note This value may not necessarily match the value seen in the @UMS game type. - /// - /// @returns Vespene gas cost of the unit. - int gasPrice() const; - - /// Retrieves the default time, in frames, needed to train, morph, or build the unit. - /// - /// @note This value may not necessarily match the value seen in the @UMS game type. - /// - /// @returns Number of frames needed in order to build the unit. - /// @see UnitInterface::getRemainingBuildTime - int buildTime() const; - - /// Retrieves the amount of supply that this unit type will use when created. It will use the - /// supply pool that is appropriate for its Race. - /// - /// @note In Starcraft programming, the managed supply values are double than what they appear - /// in the game. The reason for this is because @Zerglings use 0.5 visible supply. - /// - /// @returns Integer containing the supply required to build this unit. - /// @see supplyProvided, PlayerInterface::supplyTotal, PlayerInterface::supplyUsed - int supplyRequired() const; - - /// Retrieves the amount of supply that this unit type produces for its appropriate Race's - /// supply pool. - /// - /// @note In Starcraft programming, the managed supply values are double than what they appear - /// in the game. The reason for this is because @Zerglings use 0.5 visible supply. - /// - /// @see supplyRequired, PlayerInterface::supplyTotal, PlayerInterface::supplyUsed - int supplyProvided() const; - - /// Retrieves the amount of space required by this unit type to fit inside a @Bunker or - /// @Transport. - /// - /// @returns Amount of space required by this unit type for transport. - /// @retval 255 If this unit type can not be transported. - /// @see spaceProvided - int spaceRequired() const; - - /// Retrieves the amount of space provided by this @Bunker or @Transport for unit - /// transportation. - /// - /// @returns The number of slots provided by this unit type. - /// @see spaceRequired - int spaceProvided() const; - - /// Retrieves the amount of score points awarded for constructing this unit type. This value is - /// used for calculating scores in the post-game score screen. - /// - /// @returns Number of points awarded for constructing this unit type. - /// @see destroyScore - int buildScore() const; - - /// Retrieves the amount of score points awarded for killing this unit type. This value is - /// used for calculating scores in the post-game score screen. - /// - /// @returns Number of points awarded for killing this unit type. - /// @see buildScore - int destroyScore() const; - - /// Retrieves the UnitSizeType of this unit, which is used in calculations along with weapon - /// damage types to determine the amount of damage that will be dealt to this type. - /// - /// @returns UnitSizeType indicating the conceptual size of the unit type. - /// @see WeaponType::damageType - UnitSizeType size() const; - - /// Retrieves the width of this unit type, in tiles. Used for determining the tile size of - /// structures. - /// - /// @returns Width of this unit type, in tiles. - int tileWidth() const; - - /// Retrieves the height of this unit type, in tiles. Used for determining the tile size of - /// structures. - /// - /// @returns Height of this unit type, in tiles. - int tileHeight() const; - - /// Retrieves the tile size of this unit type. Used for determining the tile size of - /// structures. - /// - /// @returns TilePosition containing the width (x) and height (y) of the unit type, in tiles. - TilePosition tileSize() const; - - /// Retrieves the distance from the center of the unit type to its left edge. - /// - /// @returns Distance to this unit type's left edge from its center, in pixels. - int dimensionLeft() const; - - /// Retrieves the distance from the center of the unit type to its top edge. - /// - /// @returns Distance to this unit type's top edge from its center, in pixels. - int dimensionUp() const; - - /// Retrieves the distance from the center of the unit type to its right edge. - /// - /// @returns Distance to this unit type's right edge from its center, in pixels. - int dimensionRight() const; - - /// Retrieves the distance from the center of the unit type to its bottom edge. - /// - /// @returns Distance to this unit type's bottom edge from its center, in pixels. - int dimensionDown() const; - - /// A macro for retrieving the width of the unit type, which is calculated using - /// dimensionLeft + dimensionRight + 1. - /// - /// @returns Width of the unit, in pixels. - int width() const; - - /// A macro for retrieving the height of the unit type, which is calculated using - /// dimensionUp + dimensionDown + 1. - /// - /// @returns Height of the unit, in pixels. - int height() const; - - /// Retrieves the range at which this unit type will start targeting enemy units. - /// - /// @returns Distance at which this unit type begins to seek out enemy units, in pixels. - int seekRange() const; - - /// Retrieves the sight range of this unit type. - /// - /// @returns Sight range of this unit type, measured in pixels. - int sightRange() const; - - /// Retrieves this unit type's weapon type used when attacking targets on the ground. - /// - /// @returns WeaponType used as this unit type's ground weapon. - /// @see maxGroundHits, airWeapon - WeaponType groundWeapon() const; - - /// Retrieves the maximum number of hits this unit can deal to a ground target using its - /// ground weapon. This value is multiplied by the ground weapon's damage to calculate the - /// unit type's damage potential. - /// - /// @returns Maximum number of hits given to ground targets. - /// @see groundWeapon, maxAirHits - int maxGroundHits() const; - - /// Retrieves this unit type's weapon type used when attacking targets in the air. - /// - /// @returns WeaponType used as this unit type's air weapon. - /// @see maxAirHits, groundWeapon - WeaponType airWeapon() const; - - /// Retrieves the maximum number of hits this unit can deal to a flying target using its - /// air weapon. This value is multiplied by the air weapon's damage to calculate the - /// unit type's damage potential. - /// - /// @returns Maximum number of hits given to air targets. - /// @see airWeapon, maxGroundHits - int maxAirHits() const; - - /// Retrieves this unit type's top movement speed with no upgrades. - /// - /// @note That some units have inconsistent movement and this value is sometimes an - /// approximation. - /// - /// @returns The approximate top speed, in pixels per frame, as a double. For liftable @Terran - /// structures, this function returns their movement speed while lifted. - double topSpeed() const; - - /// Retrieves the unit's acceleration amount. - /// - /// @returns How fast the unit can accelerate to its top speed. - /// - /// @todo Figure out the units this quantity is measured in. - int acceleration() const; - - /// Retrieves the unit's halting distance. This determines how fast a unit - /// can stop moving. - /// - /// @returns A halting distance value. - /// - /// @todo Figure out the units this quantity is measured in. - int haltDistance() const; - - /// Retrieves a unit's turning radius. This determines how fast a unit can - /// turn. - /// - /// @returns A turn radius value. - /// - /// @todo Figure out the units this quantity is measured in. - int turnRadius() const; - - /// Determines if a unit can train other units. For example, - /// UnitTypes::Terran_Barracks.canProduce() will return true, while - /// UnitTypes::Terran_Marine.canProduce() will return false. This is also true for two - /// non-structures: @Carrier (can produce interceptors) and @Reaver (can produce scarabs). - /// - /// @returns true if this unit type can have a production queue, and false otherwise. - bool canProduce() const; - - /// Checks if this unit is capable of attacking. - /// - /// @note This function returns false for units that can only inflict damage via special - /// abilities, such as the @High_Templar. - /// - /// @returns true if this unit type is capable of damaging other units with a standard attack, - /// and false otherwise. - bool canAttack() const; - - /// Checks if this unit type is capable of movement. - /// - /// @note Buildings will return false, including @Terran liftable buildings which are capable - /// of moving when lifted. - /// - /// @returns true if this unit can use a movement command, and false if they cannot move. - bool canMove() const; - - /// Checks if this unit type is a flying unit. Flying units ignore ground pathing and - /// collisions. - /// - /// @returns true if this unit type is in the air by default, and false otherwise. - bool isFlyer() const; - - /// Checks if this unit type can regenerate hit points. This generally applies to @Zerg units. - /// - /// @returns true if this unit type regenerates its hit points, and false otherwise. - bool regeneratesHP() const; - - /// Checks if this unit type has the capacity to store energy and use it for special abilities. - /// - /// @returns true if this unit type generates energy, and false if it does not have an energy - /// pool. - bool isSpellcaster() const; - - /// Checks if this unit type is permanently cloaked. This means the unit type is always - /// cloaked and requires a detector in order to see it. - /// - /// @returns true if this unit type is permanently cloaked, and false otherwise. - bool hasPermanentCloak() const; - - /// Checks if this unit type is invincible by default. Invincible units - /// cannot take damage. - /// - /// @returns true if this unit type is invincible, and false if it is vulnerable to attacks. - bool isInvincible() const; - - /// Checks if this unit is an organic unit. The organic property is required for some abilities - /// such as @Heal. - /// - /// @returns true if this unit type has the organic property, and false otherwise. - bool isOrganic() const; - - /// Checks if this unit is mechanical. The mechanical property is required for some actions - /// such as @Repair. - /// - /// @returns true if this unit type has the mechanical property, and false otherwise. - bool isMechanical() const; - - /// Checks if this unit is robotic. The robotic property is applied - /// to robotic units such as the @Probe which prevents them from taking damage from - /// @Irradiate. - /// - /// @returns true if this unit type has the robotic property, and false otherwise. - bool isRobotic() const; - - /// Checks if this unit type is capable of detecting units that are cloaked or burrowed. - /// - /// @returns true if this unit type is a detector by default, false if it does not have this - /// property - bool isDetector() const; - - /// Checks if this unit type is capable of storing resources such as @minerals. Resources - /// are harvested from resource containers. - /// - /// @returns true if this unit type may contain resources that can be harvested, false - /// otherwise. - bool isResourceContainer() const; - - /// Checks if this unit type is a resource depot. Resource depots must be placed a certain - /// distance from resources. Resource depots are typically the main building for any - /// particular race. Workers will return resources to the nearest resource depot. - /// - /// Example: - /// @code - /// if ( BWAPI::Broodwar->self() ) - /// { - /// BWAPI::Unitset myUnits = BWAPI::Broodwar->self()->getUnits(); - /// for ( auto u : myUnits ) - /// { - /// if ( u->isIdle() && u->getType().isResourceDepot() ) - /// u->train( u->getType().getRace().getWorker() ); - /// } - /// } - /// @endcode - /// @returns true if the unit type is a resource depot, false if it is not. - bool isResourceDepot() const; - - /// Checks if this unit type is a refinery. A refinery is a structure that is placed on top of - /// a @geyser . Refinery types are @refinery , @extractor , and @assimilator. - /// - /// Example: - /// @code - /// if ( BWAPI::Broodwar->self() ) - /// { - /// BWAPI::Unitset myUnits = BWAPI::Broodwar->self()->getUnits(); - /// for ( auto u : myUnits ) - /// { - /// if ( u->getType().isRefinery() ) - /// { - /// int nWorkersAssigned = u->getClientInfo('work'); - /// if ( nWorkersAssigned < 3 ) - /// { - /// Unit pClosestIdleWorker = u->getClosestUnit(BWAPI::Filter::IsWorker && BWAPI::Filter::IsIdle); - /// if ( pClosestIdleWorker ) - /// { - /// // gather from the refinery (and check if successful) - /// if ( pClosestIdleWorker->gather(u) ) - /// { - /// // set a back reference for when the unit is killed or re-assigned (code not provided) - /// pClosestIdleWorker->setClientInfo(u, 'ref'); - /// - /// // Increment the number of workers assigned and associate it with the refinery - /// ++nWorkersAssigned; - /// u->setClientInfo(nWorkersAssigned, 'work'); - /// } - /// } - /// } // workers < 3 - /// } // isRefinery - /// } // for - /// } - /// @endcode - /// @returns true if this unit type is a refinery, and false if it is not. - bool isRefinery() const; - - /// Checks if this unit type is a worker unit. Worker units can harvest resources and build - /// structures. Worker unit types include the @SCV , @probe, and @drone. - /// - /// @returns true if this unit type is a worker, and false if it is not. - bool isWorker() const; - - /// Checks if this structure is powered by a psi field. Structures powered - /// by psi can only be placed near a @Pylon. If the @Pylon is destroyed, then this unit will - /// lose power. - /// - /// @returns true if this unit type can only be placed in a psi field, false otherwise. - /// @implies isBuilding(), getRace() == Races::Protoss - bool requiresPsi() const; - - /// Checks if this structure must be placed on @Zerg creep. - /// - /// @returns true if this unit type requires creep, false otherwise. - /// @implies isBuilding(), getRace() == Races::Zerg - bool requiresCreep() const; - - /// Checks if this unit type spawns two units when being hatched from an @Egg. - /// This is only applicable to @Zerglings and @Scourges. - /// - /// @returns true if morphing this unit type will spawn two of them, and false if only one - /// is spawned. - bool isTwoUnitsInOneEgg() const; - - /// Checks if this unit type has the capability to use the @Burrow technology when it - /// is researched. - /// - /// @note The @Lurker can burrow even without researching the ability. - /// @see TechTypes::Burrow - /// @returns true if this unit can use the @Burrow ability, and false otherwise. - /// @implies getRace() == Races::Zerg, !isBuilding(), canMove() - bool isBurrowable() const; - - /// Checks if this unit type has the capability to use a cloaking ability when it - /// is researched. This applies only to @Wraiths and @Ghosts, and does not include - /// units which are permanently cloaked. - /// - /// @returns true if this unit has a cloaking ability, false otherwise. - /// @see hasPermanentCloak, TechTypes::Cloaking_Field, TechTypes::Personnel_Cloaking - bool isCloakable() const; - - /// Checks if this unit is a structure. This includes @Mineral_Fields and - /// @Vespene_Geysers. - /// - /// @returns true if this unit is a building, and false otherwise. - bool isBuilding() const; - - /// Checks if this unit is an add-on. Add-ons are attachments used by some - /// @Terran structures such as the @Comsat_Station. - /// - /// @returns true if this unit is an add-on, and false otherwise. - /// @implies getRace() == Races::Terran, isBuilding() - bool isAddon() const; - - /// Checks if this structure has the capability to use the lift-off command. - /// - /// @returns true if this unit type is a flyable building, false otherwise. - /// @implies isBuilding() - bool isFlyingBuilding() const; - - /// Checks if this unit type is a neutral type, such as critters and resources. - /// - /// @returns true if this unit is intended to be neutral, and false otherwise. - bool isNeutral() const; - - /// Checks if this unit type is a hero. Heroes are types that the player - /// cannot obtain normally, and are identified by the white border around their icon when - /// selected with a group. - /// - /// @note There are two non-hero units included in this set, the @Civilian and @Dark_Templar_Hero. - /// - /// @returns true if this unit type is a hero type, and false otherwise. - bool isHero() const; - - /// Checks if this unit type is a powerup. Powerups can be picked up and - /// carried by workers. They are usually only seen in campaign maps and @Capture_the_flag. - /// - /// @returns true if this unit type is a powerup type, and false otherwise. - bool isPowerup() const; - - /// Checks if this unit type is a beacon. Each race has exactly one beacon - /// each. They are UnitTypes::Special_Zerg_Beacon, UnitTypes::Special_Terran_Beacon, and - /// UnitTypes::Special_Protoss_Beacon. - /// - /// @see isFlagBeacon - /// @returns true if this unit type is one of the three race beacons, and false otherwise. - bool isBeacon() const; - - /// Checks if this unit type is a flag beacon. Each race has exactly one - /// flag beacon each. They are UnitTypes::Special_Zerg_Flag_Beacon, - /// UnitTypes::Special_Terran_Flag_Beacon, and UnitTypes::Special_Protoss_Flag_Beacon. - /// Flag beacons spawn a @Flag after some ARBITRARY I FORGOT AMOUNT OF FRAMES. - /// - /// @see isBeacon - /// @returns true if this unit type is one of the three race flag beacons, and false otherwise. - /// - /// @todo specify number of frames for flag spawner - bool isFlagBeacon() const; - - /// Checks if this structure is special and cannot be obtained normally within the - /// game. - /// - /// @returns true if this structure is a special building, and false otherwise. - /// @implies isBuilding() - bool isSpecialBuilding() const; - - /// Identifies if this unit type is used to complement some @abilities. - /// These include UnitTypes::Spell_Dark_Swarm, UnitTypes::Spell_Disruption_Web, and - /// UnitTypes::Spell_Scanner_Sweep, which correspond to TechTypes::Dark_Swarm, - /// TechTypes::Disruption_Web, and TechTypes::Scanner_Sweep respectively. - /// - /// @returns true if this unit type is used for an ability, and false otherwise. - bool isSpell() const; - - /// Checks if this structure type produces creep. That is, the unit type - /// spreads creep over a wide area so that @Zerg structures can be placed on it. - /// - /// @returns true if this unit type spreads creep. - /// @implies getRace() == Races::Zerg, isBuilding() - /// - /// @since 4.1.2 - bool producesCreep() const; - - /// Checks if this unit type produces larva. This is essentially used to - /// check if the unit type is a @Hatchery, @Lair, or @Hive. - /// - /// @returns true if this unit type produces larva. - /// @implies getRace() == Races::Zerg, isBuilding() - bool producesLarva() const; - - /// Checks if this unit type is a mineral field and contains a resource amount. - /// This indicates that the unit type is either UnitTypes::Resource_Mineral_Field, - /// UnitTypes::Resource_Mineral_Field_Type_2, or UnitTypes::Resource_Mineral_Field_Type_3. - /// - /// @returns true if this unit type is a mineral field resource. - bool isMineralField() const; - - /// Checks if this unit type is a neutral critter. - /// - /// @returns true if this unit type is a critter, and false otherwise. - /// - /// Example usage: - /// @code - /// BWAPI::Position myBasePosition( BWAPI::Broodwar->self()->getStartLocation() ); - /// BWAPI::UnitSet unitsAroundTheBase = BWAPI::Broodwar->getUnitsInRadius(myBasePosition, 1024, !BWAPI::Filter::IsOwned && !BWAPI::Filter::IsParasited); - /// for ( auto u : unitsAroundTheBase ) - /// { - /// if ( u->getType().isCritter() && !u->isInvincible() ) - /// { - /// BWAPI::Unit myQueen = u->getClosestUnit(BWAPI::Filter::GetType == BWAPI::UnitTypes::Zerg_Queen && BWAPI::Filter::IsOwned); - /// if ( myQueen ) - /// myQueen->useTech(BWAPI::TechTypes::Parasite, u); - /// } - /// } - /// @endcode - bool isCritter() const; - - /// Checks if this unit type is capable of constructing an add-on. An add-on is an extension - /// or attachment for @Terran structures, specifically the @Command_Center, @Factory, - /// @Starport, and @Science_Facility. - /// - /// @returns true if this unit type can construct an add-on, and false if it can not. - /// @see isAddon - bool canBuildAddon() const; - - /// Retrieves the set of units that this unit type is capable of creating. - /// This includes training, constructing, warping, and morphing. - /// - /// @note Some maps have special parameters that disable construction of units that are otherwise - /// normally available. Use PlayerInterface::isUnitAvailable to determine if a unit type is - /// actually available in the current game for a specific player. - /// - /// @returns UnitType::set containing the units it can build. - /// @see PlayerInterface::isUnitAvailable - /// - /// @since 4.1.2 - const UnitType::set& buildsWhat() const; - - /// Retrieves the set of technologies that this unit type is capable of researching. - /// - /// @note Some maps have special parameters that disable certain technologies. Use - /// PlayerInterface::isResearchAvailable to determine if a technology is actually available in the - /// current game for a specific player. - /// - /// @returns TechType::set containing the technology types that can be researched. - /// @see PlayerInterface::isResearchAvailable - /// - /// @since 4.1.2 - const SetContainer& researchesWhat() const; - - /// Retrieves the set of upgrades that this unit type is capable of upgrading. - /// - /// @note Some maps have special upgrade limitations. Use PlayerInterface::getMaxUpgradeLevel - /// to check if an upgrade is available. - /// - /// @returns UpgradeType::set containing the upgrade types that can be upgraded. - /// @see PlayerInterface::getMaxUpgradeLevel - /// - /// @since 4.1.2 - const SetContainer& upgradesWhat() const; - }; - - /// The amount of shield points that a unit recovers over 256 frames. - /// That is, 7/256 shields are regenerated per frame. - /// - /// @since 4.1.0 Beta - static const int SHIELD_REGEN_RATE = 7; - - /// The amount of energy that a unit with special abilities recovers over 256 frames. - /// That is, 8/256 energy is generated per frame. - /// - /// @since 4.1.0 Beta - static const int ENERGY_REGEN_RATE = 8; - - /// The amount of life that a zerg unit recovers over 256 frames. - /// That is, 4/256 life is regenerated per frame. - /// - /// @since 4.1.0 Beta - static const int LIFE_REGEN_RATE = 4; - - /// @ingroup Types - namespace UnitTypes - { - /// Retrieves the maximum unit width from the set of all units. Used - /// internally to search through unit positions efficiently. - /// - /// @returns The maximum width of all unit types, in pixels. - int maxUnitWidth(); - - /// Retrieves the maximum unit height from the set of all units. Used - /// internally to search through unit positions efficiently. - /// - /// @returns The maximum height of all unit types, in pixels. - int maxUnitHeight(); - - /// Retrieves the set of all defined unit types. - /// - /// @returns A constant set of all available unit types. - const UnitType::set& allUnitTypes(); - - /// Retrieves the set of all macro unit types. A macro type is a fake unit - /// type, used by some functions. These include #AllUnits, #Men, #Buildings, and #Factories. - /// The purpose of these types are to match the same ones used in Broodwar, also seen in the - /// StarEdit map editor. - /// - /// @returns A constant set of all macro unit types. - const UnitType::set& allMacroTypes(); - - /// @name Terran Ground Units - /// @{ - extern const UnitType Terran_Firebat; - extern const UnitType Terran_Ghost; - extern const UnitType Terran_Goliath; - extern const UnitType Terran_Marine; - extern const UnitType Terran_Medic; - extern const UnitType Terran_SCV; - extern const UnitType Terran_Siege_Tank_Siege_Mode; - extern const UnitType Terran_Siege_Tank_Tank_Mode; - extern const UnitType Terran_Vulture; - extern const UnitType Terran_Vulture_Spider_Mine; - /// @} - /// @name Terran Air Units - /// @{ - extern const UnitType Terran_Battlecruiser; - extern const UnitType Terran_Dropship; - extern const UnitType Terran_Nuclear_Missile; - extern const UnitType Terran_Science_Vessel; - extern const UnitType Terran_Valkyrie; - extern const UnitType Terran_Wraith; - /// @} - /// @name Terran Heroes - /// @{ - extern const UnitType Hero_Alan_Schezar; - extern const UnitType Hero_Alexei_Stukov; - extern const UnitType Hero_Arcturus_Mengsk; - extern const UnitType Hero_Edmund_Duke_Tank_Mode; - extern const UnitType Hero_Edmund_Duke_Siege_Mode; - extern const UnitType Hero_Gerard_DuGalle; - extern const UnitType Hero_Gui_Montag; - extern const UnitType Hero_Hyperion; - extern const UnitType Hero_Jim_Raynor_Marine; - extern const UnitType Hero_Jim_Raynor_Vulture; - extern const UnitType Hero_Magellan; - extern const UnitType Hero_Norad_II; - extern const UnitType Hero_Samir_Duran; - extern const UnitType Hero_Sarah_Kerrigan; - extern const UnitType Hero_Tom_Kazansky; - extern const UnitType Terran_Civilian; - /// @} - /// @name Terran Buildings - /// @{ - extern const UnitType Terran_Academy; - extern const UnitType Terran_Armory; - extern const UnitType Terran_Barracks; - extern const UnitType Terran_Bunker; - extern const UnitType Terran_Command_Center; - extern const UnitType Terran_Engineering_Bay; - extern const UnitType Terran_Factory; - extern const UnitType Terran_Missile_Turret; - extern const UnitType Terran_Refinery; - extern const UnitType Terran_Science_Facility; - extern const UnitType Terran_Starport; - extern const UnitType Terran_Supply_Depot; - /// @} - /// @name Terran Addons - /// @{ - extern const UnitType Terran_Comsat_Station; - extern const UnitType Terran_Control_Tower; - extern const UnitType Terran_Covert_Ops; - extern const UnitType Terran_Machine_Shop; - extern const UnitType Terran_Nuclear_Silo; - extern const UnitType Terran_Physics_Lab; - /// @} - /// @name Terran Special Buildings - /// @{ - extern const UnitType Special_Crashed_Norad_II; - extern const UnitType Special_Ion_Cannon; - extern const UnitType Special_Power_Generator; - extern const UnitType Special_Psi_Disrupter; - /// @} - /// @name Protoss Ground Units - /// @{ - extern const UnitType Protoss_Archon; - extern const UnitType Protoss_Dark_Archon; - extern const UnitType Protoss_Dark_Templar; - extern const UnitType Protoss_Dragoon; - extern const UnitType Protoss_High_Templar; - extern const UnitType Protoss_Probe; - extern const UnitType Protoss_Reaver; - extern const UnitType Protoss_Scarab; - extern const UnitType Protoss_Zealot; - /// @} - /// @name Protoss Air Units - /// @{ - extern const UnitType Protoss_Arbiter; - extern const UnitType Protoss_Carrier; - extern const UnitType Protoss_Corsair; - extern const UnitType Protoss_Interceptor; - extern const UnitType Protoss_Observer; - extern const UnitType Protoss_Scout; - extern const UnitType Protoss_Shuttle; - /// @} - /// @name Protoss Heroes Units - /// @{ - extern const UnitType Hero_Aldaris; - extern const UnitType Hero_Artanis; - extern const UnitType Hero_Danimoth; - extern const UnitType Hero_Dark_Templar; - extern const UnitType Hero_Fenix_Dragoon; - extern const UnitType Hero_Fenix_Zealot; - extern const UnitType Hero_Gantrithor; - extern const UnitType Hero_Mojo; - extern const UnitType Hero_Raszagal; - extern const UnitType Hero_Tassadar; - extern const UnitType Hero_Tassadar_Zeratul_Archon; - extern const UnitType Hero_Warbringer; - extern const UnitType Hero_Zeratul; - /// @} - /// @name Protoss Buildings - /// @{ - extern const UnitType Protoss_Arbiter_Tribunal; - extern const UnitType Protoss_Assimilator; - extern const UnitType Protoss_Citadel_of_Adun; - extern const UnitType Protoss_Cybernetics_Core; - extern const UnitType Protoss_Fleet_Beacon; - extern const UnitType Protoss_Forge; - extern const UnitType Protoss_Gateway; - extern const UnitType Protoss_Nexus; - extern const UnitType Protoss_Observatory; - extern const UnitType Protoss_Photon_Cannon; - extern const UnitType Protoss_Pylon; - extern const UnitType Protoss_Robotics_Facility; - extern const UnitType Protoss_Robotics_Support_Bay; - extern const UnitType Protoss_Shield_Battery; - extern const UnitType Protoss_Stargate; - extern const UnitType Protoss_Templar_Archives; - /// @} - /// @name Protoss Special Buildings - /// @{ - extern const UnitType Special_Khaydarin_Crystal_Form; - extern const UnitType Special_Protoss_Temple; - extern const UnitType Special_Stasis_Cell_Prison; - extern const UnitType Special_Warp_Gate; - extern const UnitType Special_XelNaga_Temple; - /// @} - /// @name Zerg Ground Units - /// @{ - extern const UnitType Zerg_Broodling; - extern const UnitType Zerg_Defiler; - extern const UnitType Zerg_Drone; - extern const UnitType Zerg_Egg; - extern const UnitType Zerg_Hydralisk; - extern const UnitType Zerg_Infested_Terran; - extern const UnitType Zerg_Larva; - extern const UnitType Zerg_Lurker; - extern const UnitType Zerg_Lurker_Egg; - extern const UnitType Zerg_Ultralisk; - extern const UnitType Zerg_Zergling; - /// @} - /// @name Zerg Air Units - /// @{ - extern const UnitType Zerg_Cocoon; - extern const UnitType Zerg_Devourer; - extern const UnitType Zerg_Guardian; - extern const UnitType Zerg_Mutalisk; - extern const UnitType Zerg_Overlord; - extern const UnitType Zerg_Queen; - extern const UnitType Zerg_Scourge; - /// @} - /// @name Zerg Heroes - /// @{ - extern const UnitType Hero_Devouring_One; - extern const UnitType Hero_Hunter_Killer; - extern const UnitType Hero_Infested_Duran; - extern const UnitType Hero_Infested_Kerrigan; - extern const UnitType Hero_Kukulza_Guardian; - extern const UnitType Hero_Kukulza_Mutalisk; - extern const UnitType Hero_Matriarch; - extern const UnitType Hero_Torrasque; - extern const UnitType Hero_Unclean_One; - extern const UnitType Hero_Yggdrasill; - /// @} - /// @name Zerg Buildings - /// @{ - extern const UnitType Zerg_Creep_Colony; - extern const UnitType Zerg_Defiler_Mound; - extern const UnitType Zerg_Evolution_Chamber; - extern const UnitType Zerg_Extractor; - extern const UnitType Zerg_Greater_Spire; - extern const UnitType Zerg_Hatchery; - extern const UnitType Zerg_Hive; - extern const UnitType Zerg_Hydralisk_Den; - extern const UnitType Zerg_Infested_Command_Center; - extern const UnitType Zerg_Lair; - extern const UnitType Zerg_Nydus_Canal; - extern const UnitType Zerg_Queens_Nest; - extern const UnitType Zerg_Spawning_Pool; - extern const UnitType Zerg_Spire; - extern const UnitType Zerg_Spore_Colony; - extern const UnitType Zerg_Sunken_Colony; - extern const UnitType Zerg_Ultralisk_Cavern; - /// @} - /// @name Zerg Special Buildings - /// @{ - extern const UnitType Special_Cerebrate; - extern const UnitType Special_Cerebrate_Daggoth; - extern const UnitType Special_Mature_Chrysalis; - extern const UnitType Special_Overmind; - extern const UnitType Special_Overmind_Cocoon; - extern const UnitType Special_Overmind_With_Shell; - /// @} - /// @name Critters - /// @{ - extern const UnitType Critter_Bengalaas; - extern const UnitType Critter_Kakaru; - extern const UnitType Critter_Ragnasaur; - extern const UnitType Critter_Rhynadon; - extern const UnitType Critter_Scantid; - extern const UnitType Critter_Ursadon; - /// @} - /// @name Resources - /// @{ - extern const UnitType Resource_Mineral_Field; - extern const UnitType Resource_Mineral_Field_Type_2; - extern const UnitType Resource_Mineral_Field_Type_3; - extern const UnitType Resource_Vespene_Geyser; - /// @} - /// @name Spells - /// @{ - extern const UnitType Spell_Dark_Swarm; - extern const UnitType Spell_Disruption_Web; - extern const UnitType Spell_Scanner_Sweep; - /// @} - /// @name Beacons - /// @{ - extern const UnitType Special_Protoss_Beacon; - extern const UnitType Special_Protoss_Flag_Beacon; - extern const UnitType Special_Terran_Beacon; - extern const UnitType Special_Terran_Flag_Beacon; - extern const UnitType Special_Zerg_Beacon; - extern const UnitType Special_Zerg_Flag_Beacon; - /// @} - /// @name Powerups - /// @{ - extern const UnitType Powerup_Data_Disk; - extern const UnitType Powerup_Flag; - extern const UnitType Powerup_Khalis_Crystal; - extern const UnitType Powerup_Khaydarin_Crystal; - extern const UnitType Powerup_Mineral_Cluster_Type_1; - extern const UnitType Powerup_Mineral_Cluster_Type_2; - extern const UnitType Powerup_Protoss_Gas_Orb_Type_1; - extern const UnitType Powerup_Protoss_Gas_Orb_Type_2; - extern const UnitType Powerup_Psi_Emitter; - extern const UnitType Powerup_Terran_Gas_Tank_Type_1; - extern const UnitType Powerup_Terran_Gas_Tank_Type_2; - extern const UnitType Powerup_Uraj_Crystal; - extern const UnitType Powerup_Young_Chrysalis; - extern const UnitType Powerup_Zerg_Gas_Sac_Type_1; - extern const UnitType Powerup_Zerg_Gas_Sac_Type_2; - /// @} - /// @name Traps - /// @{ - extern const UnitType Special_Floor_Gun_Trap; - extern const UnitType Special_Floor_Missile_Trap; - extern const UnitType Special_Right_Wall_Flame_Trap; - extern const UnitType Special_Right_Wall_Missile_Trap; - extern const UnitType Special_Wall_Flame_Trap; - extern const UnitType Special_Wall_Missile_Trap; - /// @} - /// @name Doors - /// @{ - extern const UnitType Special_Pit_Door; - extern const UnitType Special_Right_Pit_Door; - extern const UnitType Special_Right_Upper_Level_Door; - extern const UnitType Special_Upper_Level_Door; - /// @} - /// @name Special - /// @{ - extern const UnitType Special_Cargo_Ship; - extern const UnitType Special_Floor_Hatch; - extern const UnitType Special_Independant_Starport; - extern const UnitType Special_Map_Revealer; - extern const UnitType Special_Mercenary_Gunship; - extern const UnitType Special_Start_Location; - /// @} - - extern const UnitType None; - extern const UnitType AllUnits; - extern const UnitType Men; - extern const UnitType Buildings; - extern const UnitType Factories; - extern const UnitType Unknown; - } - - static_assert(sizeof(UnitType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/Unitset.h b/bwapi4-includes/BWAPI/Unitset.h deleted file mode 100644 index af1e098..0000000 --- a/bwapi4-includes/BWAPI/Unitset.h +++ /dev/null @@ -1,186 +0,0 @@ -#pragma once -#include "SetContainer.h" -#include -#include -#include - -namespace BWAPI -{ - // Forward declarations - class UnitType; - class Regionset; - class UnitCommand; - class TechType; - - /// The Unitset is a container for a set of pointers to Unit objects. It is typically - /// used for groups of units instead of having to manage each Unit individually. - /// - /// @see Unit - class Unitset : public SetContainer> - { - public: - /// A blank Unitset containing no elements. This is typically used as a - /// return value for BWAPI interface functions that have encountered an error. - static const Unitset none; - - - /// Calculates the average of all valid Unit positions in this set. - /// - /// @returns Average Position of all units in the set. - /// - /// @see UnitInterface::getPosition - Position getPosition() const; - - /// Creates a single set containing all units that are loaded into units of this set. - /// - /// @returns The set of all loaded units. - /// - /// @see UnitInterface::getLoadedUnits - Unitset getLoadedUnits() const; - - /// Creates a single set containing all the @Interceptors of all @Carriers in this set. - /// - /// @returns The set of all @Interceptors . - /// - /// @see UnitInterface::getInterceptors - Unitset getInterceptors() const; - - /// Creates a single set containing all the @Larvae of all @Hatcheries, @Lairs, and - /// @Hives in this set. - /// - /// @returns The set of all @Larvae . - /// - /// @see UnitInterface::getLarva - Unitset getLarva() const; - - /// Sets the client info for every unit in this set. - /// - /// (optional) - /// A pointer to client information, managed by the AI module, or nullptr if client - /// information is to be cleared. - /// - /// (optional) - /// An key value for the client info mapping so that more than one piece of data can be - /// mapped to the same unit. - /// - /// - /// @see UnitInterface::setClientInfo - void setClientInfo(void *clientInfo = nullptr, int index = 0) const; - /// @overload - void setClientInfo(int clientInfo = 0, int index = 0) const; - - /// @copydoc UnitInterface::getUnitsInRadius - Unitset getUnitsInRadius(int radius, const UnitFilter &pred = nullptr) const; - - /// @copydoc UnitInterface::getClosestUnit - Unit getClosestUnit(const UnitFilter &pred = nullptr, int radius = 999999) const; - - /// @name Unit Commands - /// @{ - - /// @copydoc UnitInterface::issueCommand - bool issueCommand(UnitCommand command) const; - - /// @copydoc UnitInterface::attack - bool attack(PositionOrUnit target, bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::build - bool build(UnitType type, TilePosition target = TilePositions::None) const; - - /// @copydoc UnitInterface::buildAddon - bool buildAddon(UnitType type) const; - - /// @copydoc UnitInterface::train - bool train(UnitType type) const; - - /// @copydoc UnitInterface::morph - bool morph(UnitType type) const; - - /// @copydoc UnitInterface::setRallyPoint - bool setRallyPoint(PositionOrUnit target) const; - - /// @copydoc UnitInterface::move - bool move(Position target, bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::patrol - bool patrol(Position target, bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::holdPosition - bool holdPosition(bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::stop - bool stop(bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::follow - bool follow(Unit target, bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::gather - bool gather(Unit target, bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::returnCargo - bool returnCargo(bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::repair - bool repair(Unit target, bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::burrow - bool burrow() const; - - /// @copydoc UnitInterface::unburrow - bool unburrow() const; - - /// @copydoc UnitInterface::cloak - bool cloak() const; - - /// @copydoc UnitInterface::decloak - bool decloak() const; - - /// @copydoc UnitInterface::siege - bool siege() const; - - /// @copydoc UnitInterface::unsiege - bool unsiege() const; - - /// @copydoc UnitInterface::lift - bool lift() const; - - /// @copydoc UnitInterface::load - bool load(Unit target, bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::unloadAll(bool) - bool unloadAll(bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::unloadAll(Position,bool) - bool unloadAll(Position target, bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::rightClick - bool rightClick(PositionOrUnit target, bool shiftQueueCommand = false) const; - - /// @copydoc UnitInterface::haltConstruction - bool haltConstruction() const; - - /// @copydoc UnitInterface::cancelConstruction - bool cancelConstruction() const; - - /// @copydoc UnitInterface::cancelAddon - bool cancelAddon() const; - - /// @copydoc UnitInterface::cancelTrain - bool cancelTrain(int slot = -2) const; - - /// @copydoc UnitInterface::cancelMorph - bool cancelMorph() const; - - /// @copydoc UnitInterface::cancelResearch - bool cancelResearch() const; - - /// @copydoc UnitInterface::cancelUpgrade - bool cancelUpgrade() const; - - /// @copydoc UnitInterface::useTech - bool useTech(TechType tech, PositionOrUnit target = nullptr) const; - - ///@} - }; -} - diff --git a/bwapi4-includes/BWAPI/UpgradeType.h b/bwapi4-includes/BWAPI/UpgradeType.h deleted file mode 100644 index 7b91239..0000000 --- a/bwapi4-includes/BWAPI/UpgradeType.h +++ /dev/null @@ -1,249 +0,0 @@ -#pragma once -#include -#include - -namespace BWAPI -{ - class Race; - - /// Namespace of upgrade types. - namespace UpgradeTypes - { - /// Enumeration of upgrade types. - namespace Enum - { - /// Enumeration of upgrade types. - enum Enum - { - Terran_Infantry_Armor = 0, - Terran_Vehicle_Plating = 1, - Terran_Ship_Plating = 2, - Zerg_Carapace = 3, - Zerg_Flyer_Carapace = 4, - Protoss_Ground_Armor = 5, - Protoss_Air_Armor = 6, - Terran_Infantry_Weapons = 7, - Terran_Vehicle_Weapons = 8, - Terran_Ship_Weapons = 9, - Zerg_Melee_Attacks = 10, - Zerg_Missile_Attacks = 11, - Zerg_Flyer_Attacks = 12, - Protoss_Ground_Weapons = 13, - Protoss_Air_Weapons = 14, - Protoss_Plasma_Shields = 15, - U_238_Shells = 16, - Ion_Thrusters = 17, - - Titan_Reactor = 19, - Ocular_Implants = 20, - Moebius_Reactor = 21, - Apollo_Reactor = 22, - Colossus_Reactor = 23, - Ventral_Sacs = 24, - Antennae = 25, - Pneumatized_Carapace = 26, - Metabolic_Boost = 27, - Adrenal_Glands = 28, - Muscular_Augments = 29, - Grooved_Spines = 30, - Gamete_Meiosis = 31, - Metasynaptic_Node = 32, - Singularity_Charge = 33, - Leg_Enhancements = 34, - Scarab_Damage = 35, - Reaver_Capacity = 36, - Gravitic_Drive = 37, - Sensor_Array = 38, - Gravitic_Boosters = 39, - Khaydarin_Amulet = 40, - Apial_Sensors = 41, - Gravitic_Thrusters = 42, - Carrier_Capacity = 43, - Khaydarin_Core = 44, - - Argus_Jewel = 47, - - Argus_Talisman = 49, - - Caduceus_Reactor = 51, - Chitinous_Plating = 52, - Anabolic_Synthesis = 53, - Charon_Boosters = 54, - - Upgrade_60 = 60, - None = 61, - Unknown, - MAX - }; - } - } - - /// The upgrade type represents a passive upgrade that can be obtained with - /// UnitInterface::upgrade. - /// - /// @see UpgradeTypes - /// - /// @ingroup TypeClasses - class UpgradeType : public Type - { - public: - /// @copydoc Type::Type(int) - UpgradeType(int id = UpgradeTypes::Enum::None); - - /// Retrieves the race the upgrade is for. - /// For example, UpgradeTypes::Terran_Infantry_Armor.getRace() will return Races::Terran. - /// - /// @returns Race that this upgrade belongs to. - Race getRace() const; - - /// Returns the mineral price for the upgrade. - /// - /// (optional) - /// The next upgrade level. - /// - /// - /// @note Upgrades start at level 0. - /// - /// @returns The mineral cost of the upgrade for the given \p level. - int mineralPrice(int level = 1) const; - - /// The amount that the mineral price increases for each additional upgrade. - /// - /// @returns The mineral cost added to the upgrade after each level. - int mineralPriceFactor() const; - - /// Returns the vespene gas price for the first upgrade. - /// - /// (optional) - /// The next upgrade level. - /// - /// - /// @note Upgrades start at level 0. - /// - /// @returns The gas cost of the upgrade for the given \p level. - int gasPrice(int level = 1) const; - - /// Returns the amount that the vespene gas price increases for each additional upgrade. - /// - /// @returns The gas cost added to the upgrade after each level. - int gasPriceFactor() const; - - /// Returns the number of frames needed to research the first upgrade. - /// - /// (optional) - /// The next upgrade level. - /// - /// - /// @note Upgrades start at level 0. - /// - /// @returns The time cost of the upgrade for the given \p level. - int upgradeTime(int level = 1) const; - - /// Returns the number of frames that the upgrade time increases for each additional upgrade. - /// - /// @returns The time cost added to the upgrade after each level. - int upgradeTimeFactor() const; - - /// Returns the maximum number of times the upgrade can be researched. - /// - /// @returns Maximum number of times this upgrade can be upgraded. - int maxRepeats() const; - - /// Returns the type of unit that researches the upgrade. - /// - /// @returns The UnitType that is used to upgrade this type. - UnitType whatUpgrades() const; - - /// Returns the type of unit that is required for the upgrade. The player - /// must have at least one of these units completed in order to start upgrading this upgrade. - /// - /// (optional) - /// The next upgrade level. - /// - /// - /// @note Upgrades start at level 0. - /// - /// @returns UnitType required to obtain this upgrade. - UnitType whatsRequired(int level = 1) const; - - /// Returns the set of units that are affected by this upgrade. - /// - /// @returns Set of unit types that passively use this upgrade type. - const UnitType::set& whatUses() const; - }; - - /// @ingroup Types - namespace UpgradeTypes - { - /// Returns the set of all the UpgradeTypes. - /// - /// @returns UpgradeType::set containing all of the well-defined UpgradeTypes. - const UpgradeType::set& allUpgradeTypes(); - - /// @name Terran Upgrades - /// @{ - extern const UpgradeType Terran_Infantry_Armor; - extern const UpgradeType Terran_Vehicle_Plating; - extern const UpgradeType Terran_Ship_Plating; - extern const UpgradeType Terran_Infantry_Weapons; - extern const UpgradeType Terran_Vehicle_Weapons; - extern const UpgradeType Terran_Ship_Weapons; - extern const UpgradeType U_238_Shells; - extern const UpgradeType Ion_Thrusters; - extern const UpgradeType Titan_Reactor; - extern const UpgradeType Ocular_Implants; - extern const UpgradeType Moebius_Reactor; - extern const UpgradeType Apollo_Reactor; - extern const UpgradeType Colossus_Reactor; - extern const UpgradeType Caduceus_Reactor; - extern const UpgradeType Charon_Boosters; - /// @} - /// @name Zerg Upgrades - /// @{ - extern const UpgradeType Zerg_Carapace; - extern const UpgradeType Zerg_Flyer_Carapace; - extern const UpgradeType Zerg_Melee_Attacks; - extern const UpgradeType Zerg_Missile_Attacks; - extern const UpgradeType Zerg_Flyer_Attacks; - extern const UpgradeType Ventral_Sacs; - extern const UpgradeType Antennae; - extern const UpgradeType Pneumatized_Carapace; - extern const UpgradeType Metabolic_Boost; - extern const UpgradeType Adrenal_Glands; - extern const UpgradeType Muscular_Augments; - extern const UpgradeType Grooved_Spines; - extern const UpgradeType Gamete_Meiosis; - extern const UpgradeType Metasynaptic_Node; - extern const UpgradeType Chitinous_Plating; - extern const UpgradeType Anabolic_Synthesis; - /// @} - /// @name Protoss Upgrades - /// @{ - extern const UpgradeType Protoss_Ground_Armor; - extern const UpgradeType Protoss_Air_Armor; - extern const UpgradeType Protoss_Ground_Weapons; - extern const UpgradeType Protoss_Air_Weapons; - extern const UpgradeType Protoss_Plasma_Shields; - extern const UpgradeType Singularity_Charge; - extern const UpgradeType Leg_Enhancements; - extern const UpgradeType Scarab_Damage; - extern const UpgradeType Reaver_Capacity; - extern const UpgradeType Gravitic_Drive; - extern const UpgradeType Sensor_Array; - extern const UpgradeType Gravitic_Boosters; - extern const UpgradeType Khaydarin_Amulet; - extern const UpgradeType Apial_Sensors; - extern const UpgradeType Gravitic_Thrusters; - extern const UpgradeType Carrier_Capacity; - extern const UpgradeType Khaydarin_Core; - extern const UpgradeType Argus_Jewel; - extern const UpgradeType Argus_Talisman; - /// @} - - extern const UpgradeType Upgrade_60; - extern const UpgradeType None; - extern const UpgradeType Unknown; - } - - static_assert(sizeof(UpgradeType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/WeaponType.h b/bwapi4-includes/BWAPI/WeaponType.h deleted file mode 100644 index 03a2a82..0000000 --- a/bwapi4-includes/BWAPI/WeaponType.h +++ /dev/null @@ -1,443 +0,0 @@ -#pragma once -#include - -namespace BWAPI -{ - class TechType; - class UpgradeType; - class DamageType; - class ExplosionType; - class UnitType; - - /// namespace containing weapon types. - /// @see WeaponType - namespace WeaponTypes - { - /// Enumeration of weapon types. - /// @see WeaponType - namespace Enum - { - /// Enumeration of weapon types. - /// @see WeaponType - enum Enum - { - Gauss_Rifle = 0, - Gauss_Rifle_Jim_Raynor = 1, - C_10_Canister_Rifle = 2, - C_10_Canister_Rifle_Sarah_Kerrigan = 3, - Fragmentation_Grenade = 4, - Fragmentation_Grenade_Jim_Raynor = 5, - Spider_Mines = 6, - Twin_Autocannons = 7, - Hellfire_Missile_Pack = 8, - Twin_Autocannons_Alan_Schezar = 9, - Hellfire_Missile_Pack_Alan_Schezar = 10, - Arclite_Cannon = 11, - Arclite_Cannon_Edmund_Duke = 12, - Fusion_Cutter = 13, - - Gemini_Missiles = 15, - Burst_Lasers = 16, - Gemini_Missiles_Tom_Kazansky = 17, - Burst_Lasers_Tom_Kazansky = 18, - ATS_Laser_Battery = 19, - ATA_Laser_Battery = 20, - ATS_Laser_Battery_Hero = 21, - ATA_Laser_Battery_Hero = 22, - ATS_Laser_Battery_Hyperion = 23, - ATA_Laser_Battery_Hyperion = 24, - Flame_Thrower = 25, - Flame_Thrower_Gui_Montag = 26, - Arclite_Shock_Cannon = 27, - Arclite_Shock_Cannon_Edmund_Duke = 28, - Longbolt_Missile = 29, - Yamato_Gun = 30, - Nuclear_Strike = 31, - Lockdown = 32, - EMP_Shockwave = 33, - Irradiate = 34, - Claws = 35, - Claws_Devouring_One = 36, - Claws_Infested_Kerrigan = 37, - Needle_Spines = 38, - Needle_Spines_Hunter_Killer = 39, - Kaiser_Blades = 40, - Kaiser_Blades_Torrasque = 41, - Toxic_Spores = 42, - Spines = 43, - - Acid_Spore = 46, - Acid_Spore_Kukulza = 47, - Glave_Wurm = 48, - Glave_Wurm_Kukulza = 49, - - Seeker_Spores = 52, - Subterranean_Tentacle = 53, - Suicide_Infested_Terran = 54, - Suicide_Scourge = 55, - Parasite = 56, - Spawn_Broodlings = 57, - Ensnare = 58, - Dark_Swarm = 59, - Plague = 60, - Consume = 61, - Particle_Beam = 62, - - Psi_Blades = 64, - Psi_Blades_Fenix = 65, - Phase_Disruptor = 66, - Phase_Disruptor_Fenix = 67, - - Psi_Assault = 69, - Psionic_Shockwave = 70, - Psionic_Shockwave_TZ_Archon = 71, - - Dual_Photon_Blasters = 73, - Anti_Matter_Missiles = 74, - Dual_Photon_Blasters_Mojo = 75, - Anti_Matter_Missiles_Mojo = 76, - Phase_Disruptor_Cannon = 77, - Phase_Disruptor_Cannon_Danimoth = 78, - Pulse_Cannon = 79, - STS_Photon_Cannon = 80, - STA_Photon_Cannon = 81, - Scarab = 82, - Stasis_Field = 83, - Psionic_Storm = 84, - Warp_Blades_Zeratul = 85, - Warp_Blades_Hero = 86, - - Platform_Laser_Battery = 92, - Independant_Laser_Battery = 93, - - Twin_Autocannons_Floor_Trap = 96, - Hellfire_Missile_Pack_Wall_Trap = 97, - Flame_Thrower_Wall_Trap = 98, - Hellfire_Missile_Pack_Floor_Trap = 99, - - Neutron_Flare = 100, - Disruption_Web = 101, - Restoration = 102, - Halo_Rockets = 103, - Corrosive_Acid = 104, - Mind_Control = 105, - Feedback = 106, - Optical_Flare = 107, - Maelstrom = 108, - Subterranean_Spines = 109, - - Warp_Blades = 111, - C_10_Canister_Rifle_Samir_Duran = 112, - C_10_Canister_Rifle_Infested_Duran = 113, - Dual_Photon_Blasters_Artanis = 114, - Anti_Matter_Missiles_Artanis = 115, - C_10_Canister_Rifle_Alexei_Stukov = 116, - - None = 130, - Unknown, - MAX - }; - } - } - /// This object identifies a weapon type used by a unit to attack and deal damage. - /// Some weapon types can be upgraded while others are used for special abilities. - /// - /// @see WeaponTypes - /// @ingroup TypeClasses - class WeaponType : public Type - { - public: - /// @copydoc Type::Type(int) - WeaponType(int id = WeaponTypes::Enum::None); - - /// Retrieves the technology type that must be researched before this weapon can - /// be used. - /// - /// @returns TechType required by this weapon. - /// @retval TechTypes::None if no tech type is required to use this weapon. - /// @see TechType::getWeapon - TechType getTech() const; - - /// Retrieves the unit type that is intended to use this weapon type. - /// - /// @note There is a rare case where some hero unit types use the same weapon. - /// - /// @todo specify which types use the same weapon - /// - /// @returns The UnitType that uses this weapon. - /// @see UnitType::groundWeapon, UnitType::airWeapon - UnitType whatUses() const; - - /// Retrieves the base amount of damage that this weapon can deal per attack. - /// - /// @note That this damage amount must go through a DamageType and UnitSizeType filter - /// before it is applied to a unit. - /// - /// @returns Amount of base damage that this weapon deals. - int damageAmount() const; - - /// Determines the bonus amount of damage that this weapon type increases by for every - /// upgrade to this type. - /// - /// @see upgradeType - /// @returns Amount of damage added for every weapon upgrade. - int damageBonus() const; - - /// Retrieves the base amount of cooldown time between each attack, in frames. - /// - /// @returns The amount of base cooldown applied to the unit after an attack. - /// @see UnitInterface::getGroundWeaponCooldown, UnitInterface::getAirWeaponCooldown - int damageCooldown() const; - - /// Obtains the intended number of missiles/attacks that are used. - /// This is used to multiply with the damage amount to obtain the full amount of damage - /// for an attack. - /// - /// @returns The damage factor multiplied by the amount to obtain the total damage. - /// @see damageAmount - int damageFactor() const; - - /// Retrieves the upgrade type that increases this weapon's damage output. - /// - /// @returns The UpgradeType used to upgrade this weapon's damage. - /// @see damageBonus - UpgradeType upgradeType() const; - - /// Retrieves the damage type that this weapon applies to a unit type. - /// - /// @returns DamageType used for damage calculation. - /// @see DamageType, UnitSizeType - DamageType damageType() const; - - /// Retrieves the explosion type that indicates how the weapon deals damage. - /// - /// @returns ExplosionType identifying how damage is applied to a target location. - ExplosionType explosionType() const; - - /// Retrieves the minimum attack range of the weapon, measured in pixels. - /// This value is 0 for almost all weapon types, except for WeaponTypes::Arclite_Shock_Cannon - /// and WeaponTypes::Arclite_Shock_Cannon_Edmund_Duke. - /// - /// @returns Minimum attack range, in pixels. - int minRange() const; - - /// Retrieves the maximum attack range of the weapon, measured in pixels. - /// - /// @returns Maximum attack range, in pixels. - int maxRange() const; - - /// Retrieves the inner radius used for splash damage calculations, in pixels. - /// - /// @returns Radius of the inner splash area, in pixels. - /// - /// @todo Add damage calculation. - int innerSplashRadius() const; - - /// Retrieves the middle radius used for splash damage calculations, in pixels. - /// - /// @returns Radius of the middle splash area, in pixels. - /// - /// @todo Add damage calculation. - int medianSplashRadius() const; - - /// Retrieves the outer radius used for splash damage calculations, in pixels. - /// - /// @returns Radius of the outer splash area, in pixels. - /// - /// @todo Add damage calculation. - int outerSplashRadius() const; - - /// Checks if this weapon type can target air units. - /// - /// @returns true if this weapon type can target air units, and false otherwise. - /// @see UnitInterface::isFlying, UnitType::isFlyer - bool targetsAir() const; - - /// Checks if this weapon type can target ground units. - /// - /// @returns true if this weapon type can target ground units, and false otherwise. - /// @see UnitInterface::isFlying, UnitType::isFlyer - bool targetsGround() const; - - /// Checks if this weapon type can only target mechanical units. - /// - /// @returns true if this weapon type can only target mechanical units, and false otherwise. - /// @see targetsOrgOrMech, UnitType::isMechanical - bool targetsMechanical() const; - - /// Checks if this weapon type can only target organic units. - /// - /// @returns true if this weapon type can only target organic units, and false otherwise. - /// @see targetsOrgOrMech, UnitType::isOrganic - bool targetsOrganic() const; - - /// Checks if this weapon type cannot target structures. - /// - /// @returns true if this weapon type cannot target buildings, and false if it can. - /// @see UnitType::isBuilding - bool targetsNonBuilding() const; - - /// Checks if this weapon type cannot target robotic units. - /// - /// @returns true if this weapon type cannot target robotic units, and false if it can. - /// @see UnitType::isRobotic - bool targetsNonRobotic() const; - - /// Checks if this weapon type can target the ground. - /// - /// @note This is more for attacks like @Psi_Storm which can target a location, not to be - /// confused with attack move. - /// - /// @returns true if this weapon type can target a location, and false otherwise. - bool targetsTerrain() const; - - /// Checks if this weapon type can only target organic or mechanical units. - /// - /// @returns true if this weapon type can only target organic or mechanical units, and false otherwise. - /// @see targetsOrganic, targetsMechanical, UnitType::isOrganic, UnitType::isMechanical - bool targetsOrgOrMech() const; - - /// Checks if this weapon type can only target units owned by the same player. - /// This is used for WeaponTypes::Consume. - /// - /// @returns true if this weapon type can only target your own units, and false otherwise. - /// @see UnitInterface::getPlayer - bool targetsOwn() const; - }; - - /// @ingroup Types - namespace WeaponTypes - { - /// Retrieves the set of all defined weapon types. This is a union between - /// the normal and special weapon types. - /// - /// @returns set consisting of all defined weapon types. - /// @see normalWeaponTypes, specialWeaponTypes - const WeaponType::set& allWeaponTypes(); - - /// Retrieves the set of all defined normal weapon types. This set contains - /// all weapons that are not used for abilities. - /// - /// @returns constant set consisting of all normal weapon types. - const WeaponType::set& normalWeaponTypes(); - - /// Retrieves the set of all special weapon types. This set contains all - /// weapons that are used exclusively for special unit abilities. - /// - /// @returns constant set consisting of all special weapon types. - const WeaponType::set& specialWeaponTypes(); - - /// @name Normal Weapons - ///@{ - extern const WeaponType Gauss_Rifle; - extern const WeaponType Gauss_Rifle_Jim_Raynor; - extern const WeaponType C_10_Canister_Rifle; - extern const WeaponType C_10_Canister_Rifle_Sarah_Kerrigan; - extern const WeaponType C_10_Canister_Rifle_Samir_Duran; - extern const WeaponType C_10_Canister_Rifle_Infested_Duran; - extern const WeaponType C_10_Canister_Rifle_Alexei_Stukov; - extern const WeaponType Fragmentation_Grenade; - extern const WeaponType Fragmentation_Grenade_Jim_Raynor; - extern const WeaponType Spider_Mines; - extern const WeaponType Twin_Autocannons; - extern const WeaponType Twin_Autocannons_Alan_Schezar; - extern const WeaponType Hellfire_Missile_Pack; - extern const WeaponType Hellfire_Missile_Pack_Alan_Schezar; - extern const WeaponType Arclite_Cannon; - extern const WeaponType Arclite_Cannon_Edmund_Duke; - extern const WeaponType Fusion_Cutter; - extern const WeaponType Gemini_Missiles; - extern const WeaponType Gemini_Missiles_Tom_Kazansky; - extern const WeaponType Burst_Lasers; - extern const WeaponType Burst_Lasers_Tom_Kazansky; - extern const WeaponType ATS_Laser_Battery; - extern const WeaponType ATS_Laser_Battery_Hero; - extern const WeaponType ATS_Laser_Battery_Hyperion; - extern const WeaponType ATA_Laser_Battery; - extern const WeaponType ATA_Laser_Battery_Hero; - extern const WeaponType ATA_Laser_Battery_Hyperion; - extern const WeaponType Flame_Thrower; - extern const WeaponType Flame_Thrower_Gui_Montag; - extern const WeaponType Arclite_Shock_Cannon; - extern const WeaponType Arclite_Shock_Cannon_Edmund_Duke; - extern const WeaponType Longbolt_Missile; - extern const WeaponType Claws; - extern const WeaponType Claws_Devouring_One; - extern const WeaponType Claws_Infested_Kerrigan; - extern const WeaponType Needle_Spines; - extern const WeaponType Needle_Spines_Hunter_Killer; - extern const WeaponType Kaiser_Blades; - extern const WeaponType Kaiser_Blades_Torrasque; - extern const WeaponType Toxic_Spores; - extern const WeaponType Spines; - extern const WeaponType Acid_Spore; - extern const WeaponType Acid_Spore_Kukulza; - extern const WeaponType Glave_Wurm; - extern const WeaponType Glave_Wurm_Kukulza; - extern const WeaponType Seeker_Spores; - extern const WeaponType Subterranean_Tentacle; - extern const WeaponType Suicide_Infested_Terran; - extern const WeaponType Suicide_Scourge; - extern const WeaponType Particle_Beam; - extern const WeaponType Psi_Blades; - extern const WeaponType Psi_Blades_Fenix; - extern const WeaponType Phase_Disruptor; - extern const WeaponType Phase_Disruptor_Fenix; - extern const WeaponType Psi_Assault; - extern const WeaponType Psionic_Shockwave; - extern const WeaponType Psionic_Shockwave_TZ_Archon; - extern const WeaponType Dual_Photon_Blasters; - extern const WeaponType Dual_Photon_Blasters_Mojo; - extern const WeaponType Dual_Photon_Blasters_Artanis; - extern const WeaponType Anti_Matter_Missiles; - extern const WeaponType Anti_Matter_Missiles_Mojo; - extern const WeaponType Anti_Matter_Missiles_Artanis; - extern const WeaponType Phase_Disruptor_Cannon; - extern const WeaponType Phase_Disruptor_Cannon_Danimoth; - extern const WeaponType Pulse_Cannon; - extern const WeaponType STS_Photon_Cannon; - extern const WeaponType STA_Photon_Cannon; - extern const WeaponType Scarab; - extern const WeaponType Neutron_Flare; - extern const WeaponType Halo_Rockets; - extern const WeaponType Corrosive_Acid; - extern const WeaponType Subterranean_Spines; - extern const WeaponType Warp_Blades; - extern const WeaponType Warp_Blades_Hero; - extern const WeaponType Warp_Blades_Zeratul; - extern const WeaponType Independant_Laser_Battery; - extern const WeaponType Twin_Autocannons_Floor_Trap; - extern const WeaponType Hellfire_Missile_Pack_Wall_Trap; - extern const WeaponType Flame_Thrower_Wall_Trap; - extern const WeaponType Hellfire_Missile_Pack_Floor_Trap; - ///@} - - /// @name Special Weapons - ///@{ - extern const WeaponType Yamato_Gun; - extern const WeaponType Nuclear_Strike; - extern const WeaponType Lockdown; - extern const WeaponType EMP_Shockwave; - extern const WeaponType Irradiate; - extern const WeaponType Parasite; - extern const WeaponType Spawn_Broodlings; - extern const WeaponType Ensnare; - extern const WeaponType Dark_Swarm; - extern const WeaponType Plague; - extern const WeaponType Consume; - extern const WeaponType Stasis_Field; - extern const WeaponType Psionic_Storm; - extern const WeaponType Disruption_Web; - extern const WeaponType Restoration; - extern const WeaponType Mind_Control; - extern const WeaponType Feedback; - extern const WeaponType Optical_Flare; - extern const WeaponType Maelstrom; - ///@} - - extern const WeaponType None; - extern const WeaponType Unknown; - } - - static_assert(sizeof(WeaponType) == sizeof(int), "Expected type to resolve to primitive size."); -} diff --git a/bwapi4-includes/BWAPI/WindowsTypes.h b/bwapi4-includes/BWAPI/WindowsTypes.h deleted file mode 100644 index 9accb7c..0000000 --- a/bwapi4-includes/BWAPI/WindowsTypes.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -typedef char CHAR; -typedef short SHORT; -typedef long LONG; -typedef unsigned char BYTE; -typedef unsigned short WORD; -typedef unsigned long DWORD; -typedef int BOOL; -typedef void* HANDLE; -typedef void* PVOID; -typedef void* LPVOID; - -#ifndef WINAPI -#define WINAPI __stdcall -#endif - -#ifndef APIENTRY -#define APIENTRY WINAPI -#endif - -#ifndef DLL_PROCESS_ATTACH -#define DLL_PROCESS_ATTACH 1 -#define DLL_THREAD_ATTACH 2 -#define DLL_THREAD_DETACH 3 -#define DLL_PROCESS_DETACH 0 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif diff --git a/bwapi_bridge/bwapi_bridge.sln b/bwapi_bridge/bwapi_bridge.sln new file mode 100644 index 0000000..d91eaae --- /dev/null +++ b/bwapi_bridge/bwapi_bridge.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bwapi_bridge", "bwapi_bridge.vcxproj", "{39D67D97-150F-4D1C-9405-42A8871D40F7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {39D67D97-150F-4D1C-9405-42A8871D40F7}.Debug|Win32.ActiveCfg = Debug|Win32 + {39D67D97-150F-4D1C-9405-42A8871D40F7}.Debug|Win32.Build.0 = Debug|Win32 + {39D67D97-150F-4D1C-9405-42A8871D40F7}.Release|Win32.ActiveCfg = Release|Win32 + {39D67D97-150F-4D1C-9405-42A8871D40F7}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/bwapi_bridge/bwapi_bridge.vcxproj b/bwapi_bridge/bwapi_bridge.vcxproj new file mode 100644 index 0000000..a93ba65 --- /dev/null +++ b/bwapi_bridge/bwapi_bridge.vcxproj @@ -0,0 +1,103 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {39D67D97-150F-4D1C-9405-42A8871D40F7} + Win32Proj + bwapi_bridge + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;BWAPI_BRIDGE_EXPORTS;%(PreprocessorDefinitions) + $(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(BWTA_HOME)\include;$(BWAPI_HOME)\include + + + Windows + true + $(BWTA_HOME)\lib;$(BWAPI_HOME)\lib + BWAPId.lib;BWAPIClientd.lib;libgmp-10.lib;libmpfr-4.lib;BWTAd.lib;%(AdditionalDependencies) + + + copy $(TargetPath) $(SolutionDir)..\bwmirror\src\main\resources + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;BWAPI_BRIDGE_EXPORTS;%(PreprocessorDefinitions) + $(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;$(BWTA_HOME)\include;$(BWAPI_HOME)\include + + + Windows + true + true + true + $(BWTA_HOME)\lib;$(BWAPI_HOME)\lib + BWAPI.lib;BWAPIClient.lib;libgmp-10.lib;libmpfr-4.lib;BWTA.lib;%(AdditionalDependencies) + + + copy $(TargetPath) $(SolutionDir)..\bwmirror\src\main\resources + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bwapi_bridge/bwapi_bridge.vcxproj.filters b/bwapi_bridge/bwapi_bridge.vcxproj.filters new file mode 100644 index 0000000..e81e87a --- /dev/null +++ b/bwapi_bridge/bwapi_bridge.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + + + Source Files + + + \ No newline at end of file diff --git a/bwmirror/pom.xml b/bwmirror/pom.xml new file mode 100644 index 0000000..3ee8c36 --- /dev/null +++ b/bwmirror/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + com.github.gered + bwmirror + 2.6 + jar + + BWMirror + An API for SC:Broodwar AIs + + + + GNU Lesser General Public License v3.0 + https://www.gnu.org/licenses/lgpl.html + + + + + 1.7 + 1.7 + + + \ No newline at end of file diff --git a/bwapi4-includes/BWAPI/ArithmaticFilter.h b/bwmirror/src/main/java/.keep similarity index 100% rename from bwapi4-includes/BWAPI/ArithmaticFilter.h rename to bwmirror/src/main/java/.keep diff --git a/bwapi-data/BWTA2/0409ca0d7fe0c7f4083a70996a8f28f664d2fe37.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/0409ca0d7fe0c7f4083a70996a8f28f664d2fe37.bwta similarity index 100% rename from bwapi-data/BWTA2/0409ca0d7fe0c7f4083a70996a8f28f664d2fe37.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/0409ca0d7fe0c7f4083a70996a8f28f664d2fe37.bwta diff --git a/bwapi-data/BWTA2/1e983eb6bcfa02ef7d75bd572cb59ad3aab49285.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/1e983eb6bcfa02ef7d75bd572cb59ad3aab49285.bwta similarity index 100% rename from bwapi-data/BWTA2/1e983eb6bcfa02ef7d75bd572cb59ad3aab49285.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/1e983eb6bcfa02ef7d75bd572cb59ad3aab49285.bwta diff --git a/bwapi-data/BWTA2/2f69eaa1a73bb743934d55e7ea12186fe340e656.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/2f69eaa1a73bb743934d55e7ea12186fe340e656.bwta similarity index 100% rename from bwapi-data/BWTA2/2f69eaa1a73bb743934d55e7ea12186fe340e656.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/2f69eaa1a73bb743934d55e7ea12186fe340e656.bwta diff --git a/bwapi-data/BWTA2/450a792de0e544b51af5de578061cb8a2f020f32.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/450a792de0e544b51af5de578061cb8a2f020f32.bwta similarity index 100% rename from bwapi-data/BWTA2/450a792de0e544b51af5de578061cb8a2f020f32.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/450a792de0e544b51af5de578061cb8a2f020f32.bwta diff --git a/bwapi-data/BWTA2/4e24f217d2fe4dbfa6799bc57f74d8dc939d425b.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/4e24f217d2fe4dbfa6799bc57f74d8dc939d425b.bwta similarity index 100% rename from bwapi-data/BWTA2/4e24f217d2fe4dbfa6799bc57f74d8dc939d425b.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/4e24f217d2fe4dbfa6799bc57f74d8dc939d425b.bwta diff --git a/bwapi-data/BWTA2/6f8da3c3cc8d08d9cf882700efa049280aedca8c.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/6f8da3c3cc8d08d9cf882700efa049280aedca8c.bwta similarity index 100% rename from bwapi-data/BWTA2/6f8da3c3cc8d08d9cf882700efa049280aedca8c.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/6f8da3c3cc8d08d9cf882700efa049280aedca8c.bwta diff --git a/bwapi-data/BWTA2/9505d618c63a0959f0c0bfe21c253a2ea6e58d26.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/9505d618c63a0959f0c0bfe21c253a2ea6e58d26.bwta similarity index 100% rename from bwapi-data/BWTA2/9505d618c63a0959f0c0bfe21c253a2ea6e58d26.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/9505d618c63a0959f0c0bfe21c253a2ea6e58d26.bwta diff --git a/bwapi-data/BWTA2/9a4498a896b28d115129624f1c05322f48188fe0.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/9a4498a896b28d115129624f1c05322f48188fe0.bwta similarity index 100% rename from bwapi-data/BWTA2/9a4498a896b28d115129624f1c05322f48188fe0.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/9a4498a896b28d115129624f1c05322f48188fe0.bwta diff --git a/bwapi-data/BWTA2/9bfc271360fa5bab3707a29e1326b84d0ff58911.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/9bfc271360fa5bab3707a29e1326b84d0ff58911.bwta similarity index 100% rename from bwapi-data/BWTA2/9bfc271360fa5bab3707a29e1326b84d0ff58911.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/9bfc271360fa5bab3707a29e1326b84d0ff58911.bwta diff --git a/bwapi-data/BWTA2/a220d93efdf05a439b83546a579953c63c863ca7.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/a220d93efdf05a439b83546a579953c63c863ca7.bwta similarity index 100% rename from bwapi-data/BWTA2/a220d93efdf05a439b83546a579953c63c863ca7.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/a220d93efdf05a439b83546a579953c63c863ca7.bwta diff --git a/bwapi-data/BWTA2/af618ea3ed8a8926ca7b17619eebcb9126f0d8b1.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/af618ea3ed8a8926ca7b17619eebcb9126f0d8b1.bwta similarity index 100% rename from bwapi-data/BWTA2/af618ea3ed8a8926ca7b17619eebcb9126f0d8b1.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/af618ea3ed8a8926ca7b17619eebcb9126f0d8b1.bwta diff --git a/bwapi-data/BWTA2/c8386b87051f6773f6b2681b0e8318244aa086a6.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/c8386b87051f6773f6b2681b0e8318244aa086a6.bwta similarity index 100% rename from bwapi-data/BWTA2/c8386b87051f6773f6b2681b0e8318244aa086a6.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/c8386b87051f6773f6b2681b0e8318244aa086a6.bwta diff --git a/bwapi-data/BWTA2/de2ada75fbc741cfa261ee467bf6416b10f9e301.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/de2ada75fbc741cfa261ee467bf6416b10f9e301.bwta similarity index 100% rename from bwapi-data/BWTA2/de2ada75fbc741cfa261ee467bf6416b10f9e301.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/de2ada75fbc741cfa261ee467bf6416b10f9e301.bwta diff --git a/bwapi-data/BWTA2/df21ac8f19f805e1e0d4e9aa9484969528195d9f.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/df21ac8f19f805e1e0d4e9aa9484969528195d9f.bwta similarity index 100% rename from bwapi-data/BWTA2/df21ac8f19f805e1e0d4e9aa9484969528195d9f.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/df21ac8f19f805e1e0d4e9aa9484969528195d9f.bwta diff --git a/bwapi-data/BWTA2/e47775e171fe3f67cc2946825f00a6993b5a415e.bwta b/bwmirror/src/main/resources/bwapi-data/BWTA2/e47775e171fe3f67cc2946825f00a6993b5a415e.bwta similarity index 100% rename from bwapi-data/BWTA2/e47775e171fe3f67cc2946825f00a6993b5a415e.bwta rename to bwmirror/src/main/resources/bwapi-data/BWTA2/e47775e171fe3f67cc2946825f00a6993b5a415e.bwta diff --git a/bwmirror/src/main/resources/libgmp-10.dll b/bwmirror/src/main/resources/libgmp-10.dll new file mode 100644 index 0000000..387656c Binary files /dev/null and b/bwmirror/src/main/resources/libgmp-10.dll differ diff --git a/bwmirror/src/main/resources/libmpfr-4.dll b/bwmirror/src/main/resources/libmpfr-4.dll new file mode 100644 index 0000000..73a0c80 Binary files /dev/null and b/bwmirror/src/main/resources/libmpfr-4.dll differ diff --git a/src/test/api/TestBot1.java b/bwmirror/src/test/java/bwmirror/TestBot.java similarity index 98% rename from src/test/api/TestBot1.java rename to bwmirror/src/test/java/bwmirror/TestBot.java index 6a3659c..7d6d57a 100644 --- a/src/test/api/TestBot1.java +++ b/bwmirror/src/test/java/bwmirror/TestBot.java @@ -1,4 +1,4 @@ -package test.api; +package bwmirror; import bwapi.*; import bwapi.Text.Size.Enum; @@ -15,7 +15,7 @@ import java.util.List; * Time: 14:55 */ -public class TestBot1 { +public class TestBot { public void run() { @@ -143,6 +143,6 @@ public class TestBot1 { } public static void main(String... args) { - new TestBot1().run(); + new TestBot().run(); } } diff --git a/bwta2-c/BWTA.h b/bwta2-c/BWTA.h deleted file mode 100644 index 9bc15bd..0000000 --- a/bwta2-c/BWTA.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include -namespace BWTA -{ - void readMap(); - void analyze(); - void computeDistanceTransform(); - void balanceAnalysis(); - void cleanMemory(); - - int getMaxDistanceTransform(); - RectangleArray* getDistanceTransformMap(); - - const std::set& getRegions(); - const std::set& getChokepoints(); - const std::set& getBaseLocations(); - const std::set& getStartLocations(); - const std::set& getUnwalkablePolygons(); - - BaseLocation* getStartLocation(BWAPI::Player player); - - Region* getRegion(int x, int y); - Region* getRegion(BWAPI::TilePosition tileposition); - Region* getRegion(BWAPI::Position position); - - Chokepoint* getNearestChokepoint(int x, int y); - Chokepoint* getNearestChokepoint(BWAPI::TilePosition tileposition); - Chokepoint* getNearestChokepoint(BWAPI::Position position); - - BaseLocation* getNearestBaseLocation(int x, int y); - BaseLocation* getNearestBaseLocation(BWAPI::TilePosition tileposition); - BaseLocation* getNearestBaseLocation(BWAPI::Position position); - - Polygon* getNearestUnwalkablePolygon(int x, int y); - Polygon* getNearestUnwalkablePolygon(BWAPI::TilePosition tileposition); - BWAPI::Position getNearestUnwalkablePosition(BWAPI::Position position); - - bool isConnected(int x1, int y1, int x2, int y2); - bool isConnected(BWAPI::TilePosition a, BWAPI::TilePosition b); - - double getGroundDistance(BWAPI::TilePosition start, BWAPI::TilePosition end); - std::pair getNearestTilePosition(BWAPI::TilePosition start, const std::set& targets); - std::map getGroundDistances(BWAPI::TilePosition start, const std::set& targets); - void getGroundDistanceMap(BWAPI::TilePosition start, RectangleArray& distanceMap); - void getGroundWalkDistanceMap(int walkx, int walky, RectangleArray& distanceMap); - std::vector getShortestPath(BWAPI::TilePosition start, BWAPI::TilePosition end); - std::vector getShortestPath(BWAPI::TilePosition start, const std::set& targets); - - // HPA* implementation - void buildChokeNodes(); - std::list getShortestPath2(BWAPI::TilePosition start, BWAPI::TilePosition target); - int getGroundDistance2(BWAPI::TilePosition start, BWAPI::TilePosition end); - -} \ No newline at end of file diff --git a/bwta2-c/BWTA/BaseLocation.h b/bwta2-c/BWTA/BaseLocation.h deleted file mode 100644 index fa33e45..0000000 --- a/bwta2-c/BWTA/BaseLocation.h +++ /dev/null @@ -1,29 +0,0 @@ - #pragma once -#include -namespace BWTA -{ - class Region; - class BaseLocation - { - public: - virtual ~BaseLocation(){}; - virtual BWAPI::Position getPosition() const = 0; - virtual BWAPI::TilePosition getTilePosition() const = 0; - - virtual Region* getRegion() const = 0; - - virtual int minerals() const = 0; - virtual int gas() const = 0; - - virtual const BWAPI::Unitset &getMinerals() = 0; - virtual const BWAPI::Unitset &getStaticMinerals() const = 0; - virtual const BWAPI::Unitset &getGeysers() const = 0; - - virtual double getGroundDistance(BaseLocation* other) const = 0; - virtual double getAirDistance(BaseLocation* other) const = 0; - - virtual bool isIsland() const = 0; - virtual bool isMineralOnly() const = 0; - virtual bool isStartLocation() const = 0; - }; -} \ No newline at end of file diff --git a/bwta2-c/BWTA/Chokepoint.h b/bwta2-c/BWTA/Chokepoint.h deleted file mode 100644 index 34e42f1..0000000 --- a/bwta2-c/BWTA/Chokepoint.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once -#include -#include -namespace BWTA -{ - class Region; - class Chokepoint - { - public: - virtual ~Chokepoint(){}; - virtual const std::pair& getRegions() const = 0; - virtual const std::pair& getSides() const = 0; - virtual BWAPI::Position getCenter() const = 0; - virtual double getWidth() const = 0; - }; -} \ No newline at end of file diff --git a/bwta2-c/BWTA/Polygon.h b/bwta2-c/BWTA/Polygon.h deleted file mode 100644 index d65ca16..0000000 --- a/bwta2-c/BWTA/Polygon.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include -#include -namespace BWTA -{ - class Polygon : public std::vector - { - public: - Polygon(); - Polygon(const Polygon& b); - double getArea() const; - double getPerimeter() const; - BWAPI::Position getCenter() const; - bool isInside(BWAPI::Position p) const; - BWAPI::Position getNearestPoint(BWAPI::Position p) const; - const std::vector& getHoles() const; - std::vector holes; - }; -} \ No newline at end of file diff --git a/bwta2-c/BWTA/RectangleArray.h b/bwta2-c/BWTA/RectangleArray.h deleted file mode 100644 index 01cfcc6..0000000 --- a/bwta2-c/BWTA/RectangleArray.h +++ /dev/null @@ -1,283 +0,0 @@ -#pragma once - -namespace BWTA -{ - /** - * Template used for work with dynamically initialized array with dimension 2. - */ - template - class RectangleArray - { - public : - /** - * Creates the array with the specified proportions. - * @param width Width of the new array. - * @param height Height of the new array. - */ - RectangleArray(unsigned int width = 1, unsigned int height = 1, Type* data = NULL); - /** Copy constructor */ - RectangleArray(const RectangleArray& rectangleArray); - /** Assignment operator */ - const RectangleArray& operator=(const RectangleArray& rectangleArray); - /** Destroys the array and deletes all content of array. */ - ~RectangleArray(void); - /** - * Gets the width of the array. - * @return width of the array. - */ - unsigned int getWidth(void) const; - /** - * Gets the height of the array. - * @return height of the array. - */ - unsigned int getHeight(void) const; - /** - * Gets item of the array on the specified position. - * @param x horizontal index of the array position. - * @param y vertical index of the array position. - * @return item on the specified position. - */ - Type getItem(unsigned int x, unsigned int y); - Type getItemSafe(unsigned int x, unsigned int y); - inline Type* operator[](int i) { return this->getColumn(i); } - inline Type const * const operator[](int i) const {return this->getColumn(i); } - /** - * Sets item of the array on the specified position. - * @param x horizontal index of the array position. - * @param y vertical index of the array position. - * @param item new value of the field. - */ - void setItem(unsigned int x, unsigned int y, Type *item); - void resize(unsigned int width, unsigned int height); - void saveToFile(const std::string& fileName); - /** Sets all fields of the array to the specified value */ - void setTo(const Type& value); - void setBorderTo(const Type& value); - /** Set a rectangle area of the array to the specified values */ - void setRectangleTo(unsigned int xLeft, unsigned int yTop, unsigned int xRight, unsigned int yBottom, const Type& value); - private : - bool owner; - /** width of array */ - unsigned int width; - /** height of array */ - unsigned int height; - /** Array data, stored as linear array of size width*height */ - Type *data; - /** Pointers to begins of lines*/ - Type **columns; - /** - * Gets data item on the specified index - * @param index index of the data to be returned. - */ - Type getData(unsigned int index); - /** - * Gets the pointer in data to the beginning of line with the specified - * index. - * @param index index of the line. - */ - Type *getColumn(unsigned int index); - /** - * Gets the pointer in data to the beginning of line with the specified - * index. - * @param index index of the line. - */ - const Type *getColumn(unsigned int index) const; - /** - * Sets the width of the array. - * @param width New width of the array. - */ - void setWidth(unsigned int width); - /** - * Sets the height of the array. - * @param height New height of the array. - */ - void setHeight(unsigned int height); - }; - //---------------------------------------------- CONSTRUCTOR ----------------------------------------------- - template - RectangleArray::RectangleArray(unsigned int width, unsigned int height, Type* data) - { - this->setWidth(width); - this->setHeight(height); - this->owner = (data == NULL); - if (this->owner) - this->data = new Type[this->getWidth()*this->getHeight()]; - else - this->data = data; - - columns = new Type*[this->getWidth()]; - unsigned int i = 0; - for (unsigned int position = 0;i < width; i ++,position += height) - columns[i] = &this->data[position]; - } - //-------------------------------------------- COPY CONSTRUCTOR -------------------------------------------- - template - RectangleArray::RectangleArray(const RectangleArray& rectangleArray) - :owner(true) - { - this->setWidth(rectangleArray.getWidth()); - this->setHeight(rectangleArray.getHeight()); - this->data = new Type[this->getWidth()*this->getHeight()]; - columns = new Type*[this->getWidth()]; - - unsigned int i = 0; - for (unsigned int position = 0;i < width; i ++,position += height) - columns[i] = &data[position]; - memcpy(this->data, rectangleArray.data, sizeof(Type)*this->getWidth()*this->getHeight()); - } - //------------------------------------------ ASSIGNMENT OPERATOR ------------------------------------------- - template - const RectangleArray& RectangleArray::operator=(const RectangleArray& rectangleArray) - { - this->setWidth(rectangleArray.getWidth()); - this->setHeight(rectangleArray.getHeight()); - this->owner = true; - this->data = new Type[this->getWidth()*this->getHeight()]; - columns = new Type*[this->getWidth()]; - - unsigned int i = 0; - for (unsigned int position = 0; i < width; i++, position += height) - columns[i] = &data[position]; - memcpy(this->data, rectangleArray.data, sizeof(Type)*this->getWidth()*this->getHeight()); - return *this; - } - //----------------------------------------------- DESTRUCTOR ----------------------------------------------- - template - RectangleArray::~RectangleArray(void) - { - delete [] columns; - if (this->owner) - delete [] data; - } - //----------------------------------------------- GET WIDTH ------------------------------------------------ - template - unsigned int RectangleArray::getWidth(void) const - { - return this->width; - } - //----------------------------------------------- SET WIDTH ------------------------------------------------ - template - void RectangleArray::setWidth(unsigned int width) - { - this->width = width; - } - //----------------------------------------------- GET HEIGHT ----------------------------------------------- - template - unsigned int RectangleArray::getHeight(void) const - { - return this->height; - } - //----------------------------------------------- SET HEIGHT ----------------------------------------------- - template - void RectangleArray::setHeight(unsigned int height) - { - this->height = height; - } - //------------------------------------------------ GET ITEM ------------------------------------------------ - template - Type RectangleArray::getItem(unsigned int x, unsigned int y) - { - return this->getColumn(x)[y]; - } - //------------------------------------------------ GET ITEM ------------------------------------------------ - template - Type RectangleArray::getItemSafe(unsigned int x, unsigned int y) - { - if (x<0 || y<0 || x>=this->width || y>=this->height) - { - return (Type)NULL; - } - return this->getColumn(x)[y]; - } - //------------------------------------------------ SET ITEM ------------------------------------------------ - template - void RectangleArray::setItem(unsigned int x, unsigned int y, Type* item) - { - this->getColumn(x)[y] = item; - } - //------------------------------------------------ GET LINE ------------------------------------------------ - template - Type* RectangleArray::getColumn(unsigned int index) - { - return columns[index]; - } - //------------------------------------------------ GET LINE ------------------------------------------------ - template - const Type* RectangleArray::getColumn(unsigned int index) const - { - return columns[index]; - } - //------------------------------------------------- RESIZE ------------------------------------------------- - template - void RectangleArray::resize(unsigned int width, unsigned int height) - { - if (this->getWidth() == width && - this->getHeight() == height) - return; - - delete [] this->columns; - delete [] this->data; - - this->setWidth(width); - this->setHeight(height); - - this->data = new Type[this->width * this->height]; - - this->columns = new Type*[this->width]; - unsigned int i = 0; - for (unsigned int position = 0;i < this->width; i ++,position += this->height) - columns[i] = &data[position]; - } - //---------------------------------------------- SAVE TO FILE ---------------------------------------------- - template - void RectangleArray::saveToFile(const std::string& fileName) - { - std::ofstream outputFile(fileName); - if (!outputFile) - exit(1); - - for (unsigned int y = 0; y < this->getHeight(); ++y) { - for (unsigned int x = 0; x < this->getWidth(); ++x) { - outputFile << this->getColumn(x)[y]; - } - outputFile << std::endl; - } - outputFile.close(); - } - //------------------------------------------------- SET TO ------------------------------------------------- - template - void RectangleArray::setTo(const Type& value) - { - for (unsigned int i = 0; i < this->getWidth()*this->getHeight(); i++) - this->data[i] = value; - } - //--------------------------------------------- SET BORDER TO ---------------------------------------------- - template - void RectangleArray::setBorderTo(const Type& value) - { - for (unsigned int i = 0; i < this->width; i++) - { - this->getColumn(i)[0] = value; - this->getColumn(i)[this->height - 1] = value; - } - for (unsigned int i = 0; i < this->height; i++) - { - this->getColumn(0)[i] = value; - this->getColumn(this->width - 1)[i] = value; - } - } - //------------------------------------------- SET RECTANGLE TO --------------------------------------------- - template - void RectangleArray::setRectangleTo(unsigned int xLeft, unsigned int yTop, unsigned int xRight, unsigned int yBottom, const Type& value) { - xLeft = std::max(xLeft,0); - yTop = std::max(yTop,0); - xRight = std::min(xRight,this->width-1); - yBottom = std::min(yBottom,this->height-1); - for (unsigned int x = xLeft; x <= xRight; x++) { - for (unsigned int y = yTop; y <= yBottom; y++) { - this->getColumn(x)[y] = value; - } - } - } - //---------------------------------------------------------------------------------------------------------- -} \ No newline at end of file diff --git a/bwta2-c/BWTA/Region.h b/bwta2-c/BWTA/Region.h deleted file mode 100644 index 3d4a6dc..0000000 --- a/bwta2-c/BWTA/Region.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include -#include -#include -namespace BWTA -{ - class Chokepoint; - class BaseLocation; - class Region - { - public: - virtual ~Region() {}; - virtual const Polygon& getPolygon() const = 0; - virtual const BWAPI::Position& getCenter() const = 0; - virtual const std::set& getChokepoints() const = 0; - virtual const std::set& getBaseLocations() const = 0; - virtual bool isReachable(Region* region) const = 0; - virtual const std::set& getReachableRegions() const = 0; - virtual const int getMaxDistance() const = 0; - }; -} \ No newline at end of file diff --git a/c4/impl.cpp b/c4/impl.cpp deleted file mode 100644 index 49e6a27..0000000 --- a/c4/impl.cpp +++ /dev/null @@ -1,8878 +0,0 @@ -#include "../concat_header4.h" -#include -#include -#include -#include -#include -#include -#include - -using namespace BWAPI; - -std::map tableBulletType; -std::map tableColor; -std::map tableDamageType; -std::map tableError; -std::map tableExplosionType; -std::map tableGameType; -std::map tableOrder; -std::map tablePlayerType; -std::map tableRace; -std::map tableTechType; -std::map tableUnitCommandType; -std::map tableUnitSizeType; -std::map tableUnitType; -std::map tableUpgradeType; -std::map tableWeaponType; - -using namespace std; - -map clsCache; -map>, jmethodID> staticMethodCache; -map>, jmethodID> methodCache; -map>, jfieldID> fieldCache; - - -jclass FindCachedClass(JNIEnv * env, string name){ - if(clsCache.find(name) == clsCache.end()){ - clsCache.insert(pair(name, (jclass)env->NewGlobalRef(env->FindClass(name.c_str())))); - } - return clsCache.find(name)->second; -}; - -jmethodID FindCachedMethodStatic(JNIEnv * env, jclass clz, string name, string signature){ - pair> clsNameSig(clz, pair(name, signature)); - if(staticMethodCache.find(clsNameSig) == staticMethodCache.end()){ - staticMethodCache.insert(pair>, jmethodID> (clsNameSig, env->GetStaticMethodID(clz, name.c_str(), signature.c_str()))); - } - return staticMethodCache.find(clsNameSig)->second; -}; - -jmethodID FindCachedMethod(JNIEnv * env, jclass clz, string name, string signature){ - pair> clsNameSig(clz, pair(name, signature)); - if(methodCache.find(clsNameSig) == methodCache.end()){ - methodCache.insert(pair>, jmethodID>(clsNameSig, env->GetMethodID(clz, name.c_str(), signature.c_str()))); - } - return methodCache.find(clsNameSig)->second; -}; - -jfieldID FindCachedField(JNIEnv * env, jclass clz, string name, string signature){ - pair> clsNameSig(clz, pair(name, signature)); - if(fieldCache.find(clsNameSig) == fieldCache.end()){ - fieldCache.insert(pair>, jfieldID>(clsNameSig, env->GetFieldID(clz, name.c_str(), signature.c_str()))); - } - return fieldCache.find(clsNameSig)->second; -}; - -using namespace BWAPI; - -PositionOrUnit convertPositionOrUnit(JNIEnv * env, jobject obj){ - jclass clz = FindCachedClass(env, "bwapi/PositionOrUnit"); - jmethodID typeMethodId = FindCachedMethod(env, clz, "isUnit", "()Z"); - bool isUnit = (bool)env->CallBooleanMethod(obj, typeMethodId); - if(isUnit){ - jobject unitObj = env->CallObjectMethod(obj, FindCachedMethod(env, clz, "getUnit", "()Lbwapi/Unit;")); - Unit unit = (Unit)env->GetLongField(unitObj, FindCachedField(env, env->GetObjectClass(unitObj), "pointer", "J")); - return PositionOrUnit(unit); - } - jobject posObj = env->CallObjectMethod(obj, FindCachedMethod(env, clz, "getPosition", "()Lbwapi/Position;")); - Position position((int)env->GetIntField(posObj, FindCachedField(env, env->GetObjectClass(posObj), "x", "I")), (int)env->GetIntField(posObj, FindCachedField(env, env->GetObjectClass(posObj), "y", "I"))); - return PositionOrUnit(position); -} - - -UnitCommand convertUnitCommand(JNIEnv * env, jobject obj){ jclass clz = FindCachedClass(env, "bwapi/UnitCommand"); - jobject unitObj = env->CallObjectMethod(obj, FindCachedMethod(env, clz, "getUnit", "()Lbwapi/Unit;")); - Unit unit = (Unit)env->GetLongField(unitObj, FindCachedField(env, env->GetObjectClass(unitObj), "pointer", "J")); - jobject targetObj = env->CallObjectMethod(obj, FindCachedMethod(env, clz, "getTarget", "()Lbwapi/Unit;")); - Unit target = (Unit)env->GetLongField(targetObj, FindCachedField(env, env->GetObjectClass(targetObj), "pointer", "J")); - jobject typeObj = env->CallObjectMethod(obj, FindCachedMethod(env, clz, "getUnitCommandType", "()Lbwapi/UnitCommandType;")); - UnitCommandType type = *(UnitCommandType*)env->GetLongField(typeObj, FindCachedField(env, env->GetObjectClass(typeObj), "pointer", "J")); - int extra = (int)env->GetIntField(obj, FindCachedField(env, clz, "extra", "I")); - int x = (int)env->GetIntField(obj, FindCachedField(env, clz, "x", "I")); - int y = (int)env->GetIntField(obj, FindCachedField(env, clz, "y", "I")); - return UnitCommand(unit, type, target, x, y, extra); -} - - -int resolveUnitCommandExtra(UnitCommand& command){ - if(command.getUnitType() != UnitTypes::None){ return command.getUnitType().getID();} - if(command.getTechType() != TechTypes::None){ return command.getTechType().getID();} - if(command.getUpgradeType() != UpgradeTypes::None){ return command.getUpgradeType().getID();} - if(command.getSlot() != -1){ return command.extra;} - return command.isQueued(); -} - - -JNIEXPORT jint JNICALL Java_bwapi_Bullet_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -return x_bullet->getID(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Bullet_exists_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -return x_bullet->exists(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Bullet_getPlayer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -jlong resptr = (jlong)x_bullet->getPlayer(); -jclass retcls = FindCachedClass(env, "bwapi/Player"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Player;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Bullet_getType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -jlong resptr = (jlong)x_bullet->getType(); -jclass retcls = FindCachedClass(env, "bwapi/BulletType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/BulletType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Bullet_getSource_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -jlong resptr = (jlong)x_bullet->getSource(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Bullet_getPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -Position cresult = x_bullet->getPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jdouble JNICALL Java_bwapi_Bullet_getAngle_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -return x_bullet->getAngle(); -} -JNIEXPORT jdouble JNICALL Java_bwapi_Bullet_getVelocityX_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -return x_bullet->getVelocityX(); -} -JNIEXPORT jdouble JNICALL Java_bwapi_Bullet_getVelocityY_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -return x_bullet->getVelocityY(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Bullet_getTarget_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -jlong resptr = (jlong)x_bullet->getTarget(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Bullet_getTargetPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -Position cresult = x_bullet->getTargetPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jint JNICALL Java_bwapi_Bullet_getRemoveTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -return x_bullet->getRemoveTimer(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Bullet_isVisible_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Bullet x_bullet = (Bullet)pointer; -return x_bullet->isVisible(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Bullet_isVisible_1native__JLbwapi_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Bullet x_bullet = (Bullet)pointer; -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -return x_bullet->isVisible(player); -} -JNIEXPORT jstring JNICALL Java_bwapi_BulletType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -BulletType* x_bulletType = (BulletType*)pointer; -return env->NewStringUTF(x_bulletType->toString().c_str()); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Client_isConnected_1native(JNIEnv * env, jobject obj, jlong pointer){ -Client* x_client = (Client*)pointer; -return x_client->isConnected(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Client_connect_1native(JNIEnv * env, jobject obj, jlong pointer){ -Client* x_client = (Client*)pointer; -return x_client->connect(); -} -JNIEXPORT void JNICALL Java_bwapi_Client_disconnect_1native(JNIEnv * env, jobject obj, jlong pointer){ -Client* x_client = (Client*)pointer; -x_client->disconnect(); -} -JNIEXPORT void JNICALL Java_bwapi_Client_update_1native(JNIEnv * env, jobject obj, jlong pointer){ -Client* x_client = (Client*)pointer; -x_client->update(); -} -JNIEXPORT jstring JNICALL Java_bwapi_DamageType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -DamageType* x_damageType = (DamageType*)pointer; -return env->NewStringUTF(x_damageType->toString().c_str()); -} -JNIEXPORT jstring JNICALL Java_bwapi_Error_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -Error* x_error = (Error*)pointer; -return env->NewStringUTF(x_error->toString().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_Event_getType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Event* x_evt = (Event*)pointer; -jlong resptr = (jlong)x_evt->getType(); -jclass retcls = FindCachedClass(env, "bwapi/Enum"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Enum;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Event_getPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Event* x_evt = (Event*)pointer; -Position cresult = x_evt->getPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jstring JNICALL Java_bwapi_Event_getText_1native(JNIEnv * env, jobject obj, jlong pointer){ -Event* x_evt = (Event*)pointer; -return env->NewStringUTF(x_evt->getText().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_Event_getUnit_1native(JNIEnv * env, jobject obj, jlong pointer){ -Event* x_evt = (Event*)pointer; -jlong resptr = (jlong)x_evt->getUnit(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Event_getPlayer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Event* x_evt = (Event*)pointer; -jlong resptr = (jlong)x_evt->getPlayer(); -jclass retcls = FindCachedClass(env, "bwapi/Player"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Player;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Event_isWinner_1native(JNIEnv * env, jobject obj, jlong pointer){ -Event* x_evt = (Event*)pointer; -return x_evt->isWinner(); -} -JNIEXPORT jstring JNICALL Java_bwapi_ExplosionType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -ExplosionType* x_explosionType = (ExplosionType*)pointer; -return env->NewStringUTF(x_explosionType->toString().c_str()); -} -JNIEXPORT jint JNICALL Java_bwapi_Force_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Force x_force = (Force)pointer; -return x_force->getID(); -} -JNIEXPORT jstring JNICALL Java_bwapi_Force_getName_1native(JNIEnv * env, jobject obj, jlong pointer){ -Force x_force = (Force)pointer; -return env->NewStringUTF(x_force->getName().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_Force_getPlayers_1native(JNIEnv * env, jobject obj, jlong pointer){ -Force x_force = (Force)pointer; -Playerset cresult = x_force->getPlayers(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Player"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Player;"); -for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Player elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Forceset_getPlayers_1native(JNIEnv * env, jobject obj, jlong pointer){ -Forceset* x_forceset = (Forceset*)pointer; -Playerset cresult = x_forceset->getPlayers(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Player"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Player;"); -for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Player elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getForces_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Forceset cresult = x_game->getForces(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Force"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Force;"); -for(Forceset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Force elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getPlayers_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Playerset cresult = x_game->getPlayers(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Player"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Player;"); -for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Player elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getAllUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getAllUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getMinerals(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getGeysers_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getGeysers(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getNeutralUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getNeutralUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getStaticMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getStaticMinerals(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getStaticGeysers_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getStaticGeysers(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getStaticNeutralUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getStaticNeutralUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getBullets_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Bulletset cresult = x_game->getBullets(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Bullet"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Bullet;"); -for(Bulletset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Bullet elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getNukeDots_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -std::deque cresult = x_game->getNukeDots(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Position"); -jmethodID elemConsID = FindCachedMethod(env, elemClass, "", "(II)V"); -for(std::deque::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Position elem_ptr = *it; -jobject elem = env->NewObject(elemClass, elemConsID, elem_ptr.x, elem_ptr.y); -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getForce_1native(JNIEnv * env, jobject obj, jlong pointer, jint forceID){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getForce(forceID); -jclass retcls = FindCachedClass(env, "bwapi/Force"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Force;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getPlayer_1native(JNIEnv * env, jobject obj, jlong pointer, jint playerID){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getPlayer(playerID); -jclass retcls = FindCachedClass(env, "bwapi/Player"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Player;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getUnit_1native(JNIEnv * env, jobject obj, jlong pointer, jint unitID){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getUnit(unitID); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_indexToUnit_1native(JNIEnv * env, jobject obj, jlong pointer, jint unitIndex){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->indexToUnit(unitIndex); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getRegion_1native(JNIEnv * env, jobject obj, jlong pointer, jint regionID){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getRegion(regionID); -jclass retcls = FindCachedClass(env, "bwapi/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getGameType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)tableGameType.find(x_game->getGameType().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/GameType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/GameType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getLatency_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getLatency(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getFrameCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getFrameCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getReplayFrameCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getReplayFrameCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getFPS_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getFPS(); -} -JNIEXPORT jdouble JNICALL Java_bwapi_Game_getAverageFPS_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getAverageFPS(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getMousePosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Position cresult = x_game->getMousePosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_getMouseState_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_button){ -Game* x_game = (Game*)pointer; -MouseButton button = (MouseButton)(int)env->GetIntField(p_button, FindCachedField(env, env->GetObjectClass(p_button), "value", "I")); -return x_game->getMouseState(button); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_getKeyState_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_key){ -Game* x_game = (Game*)pointer; -Key key = (Key)(int)env->GetIntField(p_key, FindCachedField(env, env->GetObjectClass(p_key), "value", "I")); -return x_game->getKeyState(key); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getScreenPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Position cresult = x_game->getScreenPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT void JNICALL Java_bwapi_Game_setScreenPosition_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y){ -Game* x_game = (Game*)pointer; -x_game->setScreenPosition(x, y); -} -JNIEXPORT void JNICALL Java_bwapi_Game_setScreenPosition_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -x_game->setScreenPosition(p); -} -JNIEXPORT void JNICALL Java_bwapi_Game_pingMinimap_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y){ -Game* x_game = (Game*)pointer; -x_game->pingMinimap(x, y); -} -JNIEXPORT void JNICALL Java_bwapi_Game_pingMinimap_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -x_game->pingMinimap(p); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isFlagEnabled_1native(JNIEnv * env, jobject obj, jlong pointer, jint flag){ -Game* x_game = (Game*)pointer; -return x_game->isFlagEnabled(flag); -} -JNIEXPORT void JNICALL Java_bwapi_Game_enableFlag_1native(JNIEnv * env, jobject obj, jlong pointer, jint flag){ -Game* x_game = (Game*)pointer; -x_game->enableFlag(flag); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getUnitsOnTile_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getUnitsOnTile(tileX, tileY); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getUnitsOnTile_1native__JLbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tile){ -Game* x_game = (Game*)pointer; -TilePosition tile((int)env->GetIntField(p_tile, FindCachedField(env, env->GetObjectClass(p_tile), "x", "I")), (int)env->GetIntField(p_tile, FindCachedField(env, env->GetObjectClass(p_tile), "y", "I"))); -Unitset cresult = x_game->getUnitsOnTile(tile); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getUnitsInRectangle_1native__JIIII(JNIEnv * env, jobject obj, jlong pointer, jint left, jint top, jint right, jint bottom){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getUnitsInRectangle(left, top, right, bottom); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getUnitsInRectangle_1native__JLbwapi_Position_2Lbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_topLeft, jobject p_bottomRight){ -Game* x_game = (Game*)pointer; -Position topLeft((int)env->GetIntField(p_topLeft, FindCachedField(env, env->GetObjectClass(p_topLeft), "x", "I")), (int)env->GetIntField(p_topLeft, FindCachedField(env, env->GetObjectClass(p_topLeft), "y", "I"))); -Position bottomRight((int)env->GetIntField(p_bottomRight, FindCachedField(env, env->GetObjectClass(p_bottomRight), "x", "I")), (int)env->GetIntField(p_bottomRight, FindCachedField(env, env->GetObjectClass(p_bottomRight), "y", "I"))); -Unitset cresult = x_game->getUnitsInRectangle(topLeft, bottomRight); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getUnitsInRadius_1native__JIII(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint radius){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getUnitsInRadius(x, y, radius); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getUnitsInRadius_1native__JLbwapi_Position_2I(JNIEnv * env, jobject obj, jlong pointer, jobject p_center, jint radius){ -Game* x_game = (Game*)pointer; -Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); -Unitset cresult = x_game->getUnitsInRadius(center, radius); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getLastError_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)tableError.find(x_game->getLastError().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/Error"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Error;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setLastError_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->setLastError(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setLastError_1native__JLbwapi_Error_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_e){ -Game* x_game = (Game*)pointer; -Error* e = (Error*)env->GetLongField(p_e, FindCachedField(env, env->GetObjectClass(p_e), "pointer", "J")); -return x_game->setLastError(*e); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_mapWidth_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->mapWidth(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_mapHeight_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->mapHeight(); -} -JNIEXPORT jstring JNICALL Java_bwapi_Game_mapFileName_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return env->NewStringUTF(x_game->mapFileName().c_str()); -} -JNIEXPORT jstring JNICALL Java_bwapi_Game_mapPathName_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return env->NewStringUTF(x_game->mapPathName().c_str()); -} -JNIEXPORT jstring JNICALL Java_bwapi_Game_mapName_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return env->NewStringUTF(x_game->mapName().c_str()); -} -JNIEXPORT jstring JNICALL Java_bwapi_Game_mapHash_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return env->NewStringUTF(x_game->mapHash().c_str()); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isWalkable_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint walkX, jint walkY){ -Game* x_game = (Game*)pointer; -return x_game->isWalkable(walkX, walkY); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isWalkable_1native__JLbwapi_WalkPosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ -Game* x_game = (Game*)pointer; -WalkPosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->isWalkable(position); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getGroundHeight_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY){ -Game* x_game = (Game*)pointer; -return x_game->getGroundHeight(tileX, tileY); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getGroundHeight_1native__JLbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->getGroundHeight(position); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isBuildable_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY){ -Game* x_game = (Game*)pointer; -return x_game->isBuildable(tileX, tileY); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isBuildable_1native__JIIZ(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY, jboolean includeBuildings){ -Game* x_game = (Game*)pointer; -return x_game->isBuildable(tileX, tileY, (bool)includeBuildings); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isBuildable_1native__JLbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->isBuildable(position); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isBuildable_1native__JLbwapi_TilePosition_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jboolean includeBuildings){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->isBuildable(position, (bool)includeBuildings); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isVisible_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY){ -Game* x_game = (Game*)pointer; -return x_game->isVisible(tileX, tileY); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isVisible_1native__JLbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->isVisible(position); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isExplored_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY){ -Game* x_game = (Game*)pointer; -return x_game->isExplored(tileX, tileY); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isExplored_1native__JLbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->isExplored(position); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasCreep_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY){ -Game* x_game = (Game*)pointer; -return x_game->hasCreep(tileX, tileY); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasCreep_1native__JLbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->hasCreep(position); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPowerPrecise_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y){ -Game* x_game = (Game*)pointer; -return x_game->hasPowerPrecise(x, y); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPowerPrecise_1native__JIILbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jobject p_unitType){ -Game* x_game = (Game*)pointer; -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPowerPrecise(x, y, *unitType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPowerPrecise_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ -Game* x_game = (Game*)pointer; -Position position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->hasPowerPrecise(position); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPowerPrecise_1native__JLbwapi_Position_2Lbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_unitType){ -Game* x_game = (Game*)pointer; -Position position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPowerPrecise(position, *unitType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPower_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY){ -Game* x_game = (Game*)pointer; -return x_game->hasPower(tileX, tileY); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPower_1native__JIILbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY, jobject p_unitType){ -Game* x_game = (Game*)pointer; -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPower(tileX, tileY, *unitType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPower_1native__JLbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->hasPower(position); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPower_1native__JLbwapi_TilePosition_2Lbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_unitType){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPower(position, *unitType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPower_1native__JIIII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY, jint tileWidth, jint tileHeight){ -Game* x_game = (Game*)pointer; -return x_game->hasPower(tileX, tileY, tileWidth, tileHeight); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPower_1native__JIIIILbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY, jint tileWidth, jint tileHeight, jobject p_unitType){ -Game* x_game = (Game*)pointer; -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPower(tileX, tileY, tileWidth, tileHeight, *unitType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPower_1native__JLbwapi_TilePosition_2II(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jint tileWidth, jint tileHeight){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_game->hasPower(position, tileWidth, tileHeight); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPower_1native__JLbwapi_TilePosition_2IILbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jint tileWidth, jint tileHeight, jobject p_unitType){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPower(position, tileWidth, tileHeight, *unitType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canBuildHere_1native__JLbwapi_TilePosition_2Lbwapi_UnitType_2Lbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_type, jobject p_builder){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit builder = (Unit)env->GetLongField(p_builder, FindCachedField(env, env->GetObjectClass(p_builder), "pointer", "J")); -return x_game->canBuildHere(position, *type, builder); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canBuildHere_1native__JLbwapi_TilePosition_2Lbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_type){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_game->canBuildHere(position, *type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canBuildHere_1native__JLbwapi_TilePosition_2Lbwapi_UnitType_2Lbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_type, jobject p_builder, jboolean checkExplored){ -Game* x_game = (Game*)pointer; -TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit builder = (Unit)env->GetLongField(p_builder, FindCachedField(env, env->GetObjectClass(p_builder), "pointer", "J")); -return x_game->canBuildHere(position, *type, builder, (bool)checkExplored); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canMake_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_game->canMake(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canMake_1native__JLbwapi_UnitType_2Lbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_builder){ -Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit builder = (Unit)env->GetLongField(p_builder, FindCachedField(env, env->GetObjectClass(p_builder), "pointer", "J")); -return x_game->canMake(*type, builder); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canResearch_1native__JLbwapi_TechType_2Lbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_unit){ -Game* x_game = (Game*)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_game->canResearch(*type, unit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canResearch_1native__JLbwapi_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Game* x_game = (Game*)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_game->canResearch(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canResearch_1native__JLbwapi_TechType_2Lbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_unit, jboolean checkCanIssueCommandType){ -Game* x_game = (Game*)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_game->canResearch(*type, unit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canUpgrade_1native__JLbwapi_UpgradeType_2Lbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_unit){ -Game* x_game = (Game*)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_game->canUpgrade(*type, unit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canUpgrade_1native__JLbwapi_UpgradeType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Game* x_game = (Game*)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_game->canUpgrade(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_canUpgrade_1native__JLbwapi_UpgradeType_2Lbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_unit, jboolean checkCanIssueCommandType){ -Game* x_game = (Game*)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_game->canUpgrade(*type, unit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getStartLocations_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -std::deque cresult = x_game->getStartLocations(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID elemConsID = FindCachedMethod(env, elemClass, "", "(II)V"); -for(std::deque::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const TilePosition elem_ptr = *it; -jobject elem = env->NewObject(elemClass, elemConsID, elem_ptr.x, elem_ptr.y); -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT void JNICALL Java_bwapi_Game_printf_1native(JNIEnv * env, jobject obj, jlong pointer, jstring cstr_format){ -Game* x_game = (Game*)pointer; -x_game->printf(std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_sendText_1native(JNIEnv * env, jobject obj, jlong pointer, jstring cstr_format){ -Game* x_game = (Game*)pointer; -x_game->sendText(std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_sendTextEx_1native(JNIEnv * env, jobject obj, jlong pointer, jboolean toAllies, jstring cstr_format){ -Game* x_game = (Game*)pointer; -x_game->sendTextEx((bool)toAllies, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isInGame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->isInGame(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isMultiplayer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->isMultiplayer(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isBattleNet_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->isBattleNet(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isPaused_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->isPaused(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isReplay_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->isReplay(); -} -JNIEXPORT void JNICALL Java_bwapi_Game_pauseGame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -x_game->pauseGame(); -} -JNIEXPORT void JNICALL Java_bwapi_Game_resumeGame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -x_game->resumeGame(); -} -JNIEXPORT void JNICALL Java_bwapi_Game_leaveGame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -x_game->leaveGame(); -} -JNIEXPORT void JNICALL Java_bwapi_Game_restartGame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -x_game->restartGame(); -} -JNIEXPORT void JNICALL Java_bwapi_Game_setLocalSpeed_1native(JNIEnv * env, jobject obj, jlong pointer, jint speed){ -Game* x_game = (Game*)pointer; -x_game->setLocalSpeed(speed); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_issueCommand_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_units, jobject p_command){ -Game* x_game = (Game*)pointer; -Unitset units; -jclass colClass = env->GetObjectClass(p_units); -jmethodID sizeMethodId = FindCachedMethod(env, colClass, "size", "()I"); -jmethodID getMethodId = FindCachedMethod(env, colClass, "get", "(I)Ljava/lang/Object;"); -int size = (int)env->CallIntMethod(p_units, sizeMethodId); -for( int i = 0; i < size; i++ ) { -jobject jobj = env->CallObjectMethod(p_units,getMethodId); -units.insert((Unit)env->GetLongField(jobj, FindCachedField(env, env->GetObjectClass(jobj), "pointer", "J"))); -} -UnitCommand command(convertUnitCommand(env, p_command )); -return x_game->issueCommand(units, command); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getSelectedUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Unitset cresult = x_game->getSelectedUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_self_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->self(); -jclass retcls = FindCachedClass(env, "bwapi/Player"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Player;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_enemy_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->enemy(); -jclass retcls = FindCachedClass(env, "bwapi/Player"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Player;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_neutral_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->neutral(); -jclass retcls = FindCachedClass(env, "bwapi/Player"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Player;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_allies_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Playerset cresult = x_game->allies(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Player"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Player;"); -for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Player elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_enemies_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Playerset cresult = x_game->enemies(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Player"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Player;"); -for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Player elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_observers_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Playerset cresult = x_game->observers(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Player"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Player;"); -for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Player elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT void JNICALL Java_bwapi_Game_setTextSize_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -x_game->setTextSize(); -} -JNIEXPORT void JNICALL Java_bwapi_Game_setTextSize_1native__JLbwapi_Text_Size_Enum_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_size){ -Game* x_game = (Game*)pointer; -Text::Size::Enum size = (Text::Size::Enum)(int)env->GetIntField(p_size, FindCachedField(env, env->GetObjectClass(p_size), "value", "I")); -x_game->setTextSize(size); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawText_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jstring cstr_format){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -x_game->drawText(ctype, x, y, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTextMap_1native__JIILjava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jstring cstr_format){ -Game* x_game = (Game*)pointer; -x_game->drawTextMap(x, y, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTextMap_1native__JLbwapi_Position_2Ljava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jstring cstr_format){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -x_game->drawTextMap(p, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTextMouse_1native__JIILjava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jstring cstr_format){ -Game* x_game = (Game*)pointer; -x_game->drawTextMouse(x, y, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTextMouse_1native__JLbwapi_Position_2Ljava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jstring cstr_format){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -x_game->drawTextMouse(p, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTextScreen_1native__JIILjava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jstring cstr_format){ -Game* x_game = (Game*)pointer; -x_game->drawTextScreen(x, y, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTextScreen_1native__JLbwapi_Position_2Ljava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jstring cstr_format){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -x_game->drawTextScreen(p, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBox_1native__JLbwapi_CoordinateType_Enum_2IIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint left, jint top, jint right, jint bottom, jobject p_color){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBox(ctype, left, top, right, bottom, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBox_1native__JLbwapi_CoordinateType_Enum_2IIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint left, jint top, jint right, jint bottom, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBox(ctype, left, top, right, bottom, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxMap_1native__JIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint left, jint top, jint right, jint bottom, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxMap(left, top, right, bottom, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxMap_1native__JIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint left, jint top, jint right, jint bottom, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxMap(left, top, right, bottom, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxMap_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_leftTop, jobject p_rightBottom, jobject p_color){ -Game* x_game = (Game*)pointer; -Position leftTop((int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "x", "I")), (int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "y", "I"))); -Position rightBottom((int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "x", "I")), (int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxMap(leftTop, rightBottom, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxMap_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_leftTop, jobject p_rightBottom, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position leftTop((int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "x", "I")), (int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "y", "I"))); -Position rightBottom((int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "x", "I")), (int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxMap(leftTop, rightBottom, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxMouse_1native__JIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint left, jint top, jint right, jint bottom, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxMouse(left, top, right, bottom, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxMouse_1native__JIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint left, jint top, jint right, jint bottom, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxMouse(left, top, right, bottom, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxMouse_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_leftTop, jobject p_rightBottom, jobject p_color){ -Game* x_game = (Game*)pointer; -Position leftTop((int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "x", "I")), (int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "y", "I"))); -Position rightBottom((int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "x", "I")), (int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxMouse(leftTop, rightBottom, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxMouse_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_leftTop, jobject p_rightBottom, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position leftTop((int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "x", "I")), (int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "y", "I"))); -Position rightBottom((int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "x", "I")), (int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxMouse(leftTop, rightBottom, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxScreen_1native__JIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint left, jint top, jint right, jint bottom, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxScreen(left, top, right, bottom, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxScreen_1native__JIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint left, jint top, jint right, jint bottom, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxScreen(left, top, right, bottom, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxScreen_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_leftTop, jobject p_rightBottom, jobject p_color){ -Game* x_game = (Game*)pointer; -Position leftTop((int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "x", "I")), (int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "y", "I"))); -Position rightBottom((int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "x", "I")), (int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxScreen(leftTop, rightBottom, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawBoxScreen_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_leftTop, jobject p_rightBottom, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position leftTop((int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "x", "I")), (int)env->GetIntField(p_leftTop, FindCachedField(env, env->GetObjectClass(p_leftTop), "y", "I"))); -Position rightBottom((int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "x", "I")), (int)env->GetIntField(p_rightBottom, FindCachedField(env, env->GetObjectClass(p_rightBottom), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawBoxScreen(leftTop, rightBottom, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangle_1native__JLbwapi_CoordinateType_Enum_2IIIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangle(ctype, ax, ay, bx, by, cx, cy, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangle_1native__JLbwapi_CoordinateType_Enum_2IIIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangle(ctype, ax, ay, bx, by, cx, cy, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleMap_1native__JIIIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleMap(ax, ay, bx, by, cx, cy, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleMap_1native__JIIIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleMap(ax, ay, bx, by, cx, cy, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleMap_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_a, jobject p_b, jobject p_c, jobject p_color){ -Game* x_game = (Game*)pointer; -Position a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -Position b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -Position c((int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "x", "I")), (int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleMap(a, b, c, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleMap_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_a, jobject p_b, jobject p_c, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -Position b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -Position c((int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "x", "I")), (int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleMap(a, b, c, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleMouse_1native__JIIIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleMouse(ax, ay, bx, by, cx, cy, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleMouse_1native__JIIIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleMouse(ax, ay, bx, by, cx, cy, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleMouse_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_a, jobject p_b, jobject p_c, jobject p_color){ -Game* x_game = (Game*)pointer; -Position a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -Position b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -Position c((int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "x", "I")), (int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleMouse(a, b, c, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleMouse_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_a, jobject p_b, jobject p_c, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -Position b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -Position c((int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "x", "I")), (int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleMouse(a, b, c, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleScreen_1native__JIIIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleScreen(ax, ay, bx, by, cx, cy, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleScreen_1native__JIIIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleScreen(ax, ay, bx, by, cx, cy, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleScreen_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_a, jobject p_b, jobject p_c, jobject p_color){ -Game* x_game = (Game*)pointer; -Position a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -Position b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -Position c((int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "x", "I")), (int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleScreen(a, b, c, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawTriangleScreen_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_a, jobject p_b, jobject p_c, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -Position b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -Position c((int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "x", "I")), (int)env->GetIntField(p_c, FindCachedField(env, env->GetObjectClass(p_c), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawTriangleScreen(a, b, c, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircle_1native__JLbwapi_CoordinateType_Enum_2IIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jint radius, jobject p_color){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircle(ctype, x, y, radius, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircle_1native__JLbwapi_CoordinateType_Enum_2IIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jint radius, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircle(ctype, x, y, radius, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleMap_1native__JIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint radius, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleMap(x, y, radius, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleMap_1native__JIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint radius, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleMap(x, y, radius, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleMap_1native__JLbwapi_Position_2ILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint radius, jobject p_color){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleMap(p, radius, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleMap_1native__JLbwapi_Position_2ILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint radius, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleMap(p, radius, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleMouse_1native__JIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint radius, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleMouse(x, y, radius, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleMouse_1native__JIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint radius, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleMouse(x, y, radius, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleMouse_1native__JLbwapi_Position_2ILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint radius, jobject p_color){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleMouse(p, radius, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleMouse_1native__JLbwapi_Position_2ILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint radius, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleMouse(p, radius, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleScreen_1native__JIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint radius, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleScreen(x, y, radius, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleScreen_1native__JIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint radius, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleScreen(x, y, radius, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleScreen_1native__JLbwapi_Position_2ILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint radius, jobject p_color){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleScreen(p, radius, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawCircleScreen_1native__JLbwapi_Position_2ILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint radius, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawCircleScreen(p, radius, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipse_1native__JLbwapi_CoordinateType_Enum_2IIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jint xrad, jint yrad, jobject p_color){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipse(ctype, x, y, xrad, yrad, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipse_1native__JLbwapi_CoordinateType_Enum_2IIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jint xrad, jint yrad, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipse(ctype, x, y, xrad, yrad, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseMap_1native__JIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint xrad, jint yrad, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseMap(x, y, xrad, yrad, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseMap_1native__JIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint xrad, jint yrad, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseMap(x, y, xrad, yrad, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseMap_1native__JLbwapi_Position_2IILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint xrad, jint yrad, jobject p_color){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseMap(p, xrad, yrad, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseMap_1native__JLbwapi_Position_2IILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint xrad, jint yrad, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseMap(p, xrad, yrad, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseMouse_1native__JIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint xrad, jint yrad, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseMouse(x, y, xrad, yrad, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseMouse_1native__JIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint xrad, jint yrad, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseMouse(x, y, xrad, yrad, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseMouse_1native__JLbwapi_Position_2IILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint xrad, jint yrad, jobject p_color){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseMouse(p, xrad, yrad, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseMouse_1native__JLbwapi_Position_2IILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint xrad, jint yrad, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseMouse(p, xrad, yrad, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseScreen_1native__JIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint xrad, jint yrad, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseScreen(x, y, xrad, yrad, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseScreen_1native__JIIIILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint xrad, jint yrad, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseScreen(x, y, xrad, yrad, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseScreen_1native__JLbwapi_Position_2IILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint xrad, jint yrad, jobject p_color){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseScreen(p, xrad, yrad, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawEllipseScreen_1native__JLbwapi_Position_2IILbwapi_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jint xrad, jint yrad, jobject p_color, jboolean isSolid){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawEllipseScreen(p, xrad, yrad, color, (bool)isSolid); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawDot_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jobject p_color){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawDot(ctype, x, y, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawDotMap_1native__JIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawDotMap(x, y, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawDotMap_1native__JLbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jobject p_color){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawDotMap(p, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawDotMouse_1native__JIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawDotMouse(x, y, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawDotMouse_1native__JLbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jobject p_color){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawDotMouse(p, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawDotScreen_1native__JIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawDotScreen(x, y, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawDotScreen_1native__JLbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jobject p_color){ -Game* x_game = (Game*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawDotScreen(p, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawLine_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x1, jint y1, jint x2, jint y2, jobject p_color){ -Game* x_game = (Game*)pointer; -CoordinateType::Enum ctype = (CoordinateType::Enum)(int)env->GetIntField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "value", "I")); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawLine(ctype, x1, y1, x2, y2, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawLineMap_1native__JIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x1, jint y1, jint x2, jint y2, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawLineMap(x1, y1, x2, y2, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawLineMap_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_a, jobject p_b, jobject p_color){ -Game* x_game = (Game*)pointer; -Position a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -Position b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawLineMap(a, b, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawLineMouse_1native__JIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x1, jint y1, jint x2, jint y2, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawLineMouse(x1, y1, x2, y2, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawLineMouse_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_a, jobject p_b, jobject p_color){ -Game* x_game = (Game*)pointer; -Position a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -Position b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawLineMouse(a, b, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawLineScreen_1native__JIIIILbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jint x1, jint y1, jint x2, jint y2, jobject p_color){ -Game* x_game = (Game*)pointer; -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawLineScreen(x1, y1, x2, y2, color); -} -JNIEXPORT void JNICALL Java_bwapi_Game_drawLineScreen_1native__JLbwapi_Position_2Lbwapi_Position_2Lbwapi_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_a, jobject p_b, jobject p_color){ -Game* x_game = (Game*)pointer; -Position a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -Position b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); -x_game->drawLineScreen(a, b, color); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getLatencyFrames_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getLatencyFrames(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getLatencyTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getLatencyTime(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getRemainingLatencyFrames_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getRemainingLatencyFrames(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getRemainingLatencyTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getRemainingLatencyTime(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getRevision_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getRevision(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isDebug_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->isDebug(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isLatComEnabled_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->isLatComEnabled(); -} -JNIEXPORT void JNICALL Java_bwapi_Game_setLatCom_1native(JNIEnv * env, jobject obj, jlong pointer, jboolean isEnabled){ -Game* x_game = (Game*)pointer; -x_game->setLatCom((bool)isEnabled); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_isGUIEnabled_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->isGUIEnabled(); -} -JNIEXPORT void JNICALL Java_bwapi_Game_setGUI_1native(JNIEnv * env, jobject obj, jlong pointer, jboolean enabled){ -Game* x_game = (Game*)pointer; -x_game->setGUI((bool)enabled); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getInstanceNumber_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getInstanceNumber(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getAPM_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getAPM(); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getAPM_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean includeSelects){ -Game* x_game = (Game*)pointer; -return x_game->getAPM((bool)includeSelects); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setMap_1native(JNIEnv * env, jobject obj, jlong pointer, jstring cstr_mapFileName){ -Game* x_game = (Game*)pointer; -return x_game->setMap(std::string(env->GetStringUTFChars(cstr_mapFileName, NULL)).c_str()); -} -JNIEXPORT void JNICALL Java_bwapi_Game_setFrameSkip_1native(JNIEnv * env, jobject obj, jlong pointer, jint frameSkip){ -Game* x_game = (Game*)pointer; -x_game->setFrameSkip(frameSkip); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_hasPath_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_source, jobject p_destination){ -Game* x_game = (Game*)pointer; -Position source((int)env->GetIntField(p_source, FindCachedField(env, env->GetObjectClass(p_source), "x", "I")), (int)env->GetIntField(p_source, FindCachedField(env, env->GetObjectClass(p_source), "y", "I"))); -Position destination((int)env->GetIntField(p_destination, FindCachedField(env, env->GetObjectClass(p_destination), "x", "I")), (int)env->GetIntField(p_destination, FindCachedField(env, env->GetObjectClass(p_destination), "y", "I"))); -return x_game->hasPath(source, destination); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setAlliance_1native__JLbwapi_Player_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_player, jboolean allied){ -Game* x_game = (Game*)pointer; -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -return x_game->setAlliance(player, (bool)allied); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setAlliance_1native__JLbwapi_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Game* x_game = (Game*)pointer; -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -return x_game->setAlliance(player); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setAlliance_1native__JLbwapi_Player_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_player, jboolean allied, jboolean alliedVictory){ -Game* x_game = (Game*)pointer; -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -return x_game->setAlliance(player, (bool)allied, (bool)alliedVictory); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setVision_1native__JLbwapi_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Game* x_game = (Game*)pointer; -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -return x_game->setVision(player); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setVision_1native__JLbwapi_Player_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_player, jboolean enabled){ -Game* x_game = (Game*)pointer; -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -return x_game->setVision(player, (bool)enabled); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_elapsedTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->elapsedTime(); -} -JNIEXPORT void JNICALL Java_bwapi_Game_setCommandOptimizationLevel_1native(JNIEnv * env, jobject obj, jlong pointer, jint level){ -Game* x_game = (Game*)pointer; -x_game->setCommandOptimizationLevel(level); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_countdownTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->countdownTimer(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getAllRegions_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -Regionset cresult = x_game->getAllRegions(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Region"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Region;"); -for(Regionset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Region elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getRegionAt_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y){ -Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getRegionAt(x, y); -jclass retcls = FindCachedClass(env, "bwapi/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getRegionAt_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ -Game* x_game = (Game*)pointer; -Position position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -jlong resptr = (jlong)x_game->getRegionAt(position); -jclass retcls = FindCachedClass(env, "bwapi/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getLastEventTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->getLastEventTime(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setRevealAll_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Game* x_game = (Game*)pointer; -return x_game->setRevealAll(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Game_setRevealAll_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean reveal){ -Game* x_game = (Game*)pointer; -return x_game->setRevealAll((bool)reveal); -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getBuildLocation_1native__JLbwapi_UnitType_2Lbwapi_TilePosition_2I(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_desiredPosition, jint maxRange){ -Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -TilePosition desiredPosition((int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "x", "I")), (int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "y", "I"))); -TilePosition cresult = x_game->getBuildLocation(*type, desiredPosition, maxRange); -jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getBuildLocation_1native__JLbwapi_UnitType_2Lbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_desiredPosition){ -Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -TilePosition desiredPosition((int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "x", "I")), (int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "y", "I"))); -TilePosition cresult = x_game->getBuildLocation(*type, desiredPosition); -jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Game_getBuildLocation_1native__JLbwapi_UnitType_2Lbwapi_TilePosition_2IZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_desiredPosition, jint maxRange, jboolean creep){ -Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -TilePosition desiredPosition((int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "x", "I")), (int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "y", "I"))); -TilePosition cresult = x_game->getBuildLocation(*type, desiredPosition, maxRange, (bool)creep); -jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getDamageFrom_1native__JLbwapi_UnitType_2Lbwapi_UnitType_2Lbwapi_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_fromType, jobject p_toType, jobject p_fromPlayer){ -Game* x_game = (Game*)pointer; -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -Player fromPlayer = (Player)env->GetLongField(p_fromPlayer, FindCachedField(env, env->GetObjectClass(p_fromPlayer), "pointer", "J")); -return x_game->getDamageFrom(*fromType, *toType, fromPlayer); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getDamageFrom_1native__JLbwapi_UnitType_2Lbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_fromType, jobject p_toType){ -Game* x_game = (Game*)pointer; -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -return x_game->getDamageFrom(*fromType, *toType); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getDamageFrom_1native__JLbwapi_UnitType_2Lbwapi_UnitType_2Lbwapi_Player_2Lbwapi_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_fromType, jobject p_toType, jobject p_fromPlayer, jobject p_toPlayer){ -Game* x_game = (Game*)pointer; -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -Player fromPlayer = (Player)env->GetLongField(p_fromPlayer, FindCachedField(env, env->GetObjectClass(p_fromPlayer), "pointer", "J")); -Player toPlayer = (Player)env->GetLongField(p_toPlayer, FindCachedField(env, env->GetObjectClass(p_toPlayer), "pointer", "J")); -return x_game->getDamageFrom(*fromType, *toType, fromPlayer, toPlayer); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getDamageTo_1native__JLbwapi_UnitType_2Lbwapi_UnitType_2Lbwapi_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_toType, jobject p_fromType, jobject p_toPlayer){ -Game* x_game = (Game*)pointer; -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -Player toPlayer = (Player)env->GetLongField(p_toPlayer, FindCachedField(env, env->GetObjectClass(p_toPlayer), "pointer", "J")); -return x_game->getDamageTo(*toType, *fromType, toPlayer); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getDamageTo_1native__JLbwapi_UnitType_2Lbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_toType, jobject p_fromType){ -Game* x_game = (Game*)pointer; -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -return x_game->getDamageTo(*toType, *fromType); -} -JNIEXPORT jint JNICALL Java_bwapi_Game_getDamageTo_1native__JLbwapi_UnitType_2Lbwapi_UnitType_2Lbwapi_Player_2Lbwapi_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_toType, jobject p_fromType, jobject p_toPlayer, jobject p_fromPlayer){ -Game* x_game = (Game*)pointer; -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -Player toPlayer = (Player)env->GetLongField(p_toPlayer, FindCachedField(env, env->GetObjectClass(p_toPlayer), "pointer", "J")); -Player fromPlayer = (Player)env->GetLongField(p_fromPlayer, FindCachedField(env, env->GetObjectClass(p_fromPlayer), "pointer", "J")); -return x_game->getDamageTo(*toType, *fromType, toPlayer, fromPlayer); -} -JNIEXPORT jstring JNICALL Java_bwapi_GameType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -GameType* x_gameType = (GameType*)pointer; -return env->NewStringUTF(x_gameType->toString().c_str()); -} -JNIEXPORT jstring JNICALL Java_bwapi_Order_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -Order* x_order = (Order*)pointer; -return env->NewStringUTF(x_order->toString().c_str()); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->getID(); -} -JNIEXPORT jstring JNICALL Java_bwapi_Player_getName_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return env->NewStringUTF(x_player->getName().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_Player_getUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -Unitset cresult = x_player->getUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Player_getRace_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -jlong resptr = (jlong)tableRace.find(x_player->getRace().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/Race"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Race;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Player_getType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -jlong resptr = (jlong)tablePlayerType.find(x_player->getType().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/PlayerType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/PlayerType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Player_getForce_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -jlong resptr = (jlong)x_player->getForce(); -jclass retcls = FindCachedClass(env, "bwapi/Force"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Force;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isAlly_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Player x_player = (Player)pointer; -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -return x_player->isAlly(player); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isEnemy_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Player x_player = (Player)pointer; -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -return x_player->isEnemy(player); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isNeutral_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->isNeutral(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Player_getStartLocation_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -TilePosition cresult = x_player->getStartLocation(); -jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isVictorious_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->isVictorious(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isDefeated_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->isDefeated(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_leftGame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->leftGame(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_minerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->minerals(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_gas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->gas(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_gatheredMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->gatheredMinerals(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_gatheredGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->gatheredGas(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_repairedMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->repairedMinerals(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_repairedGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->repairedGas(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_refundedMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->refundedMinerals(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_refundedGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->refundedGas(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_spentMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->spentMinerals(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_spentGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->spentGas(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_supplyTotal_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->supplyTotal(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_supplyTotal_1native__JLbwapi_Race_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_race){ -Player x_player = (Player)pointer; -Race* race = (Race*)env->GetLongField(p_race, FindCachedField(env, env->GetObjectClass(p_race), "pointer", "J")); -return x_player->supplyTotal(*race); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_supplyUsed_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->supplyUsed(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_supplyUsed_1native__JLbwapi_Race_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_race){ -Player x_player = (Player)pointer; -Race* race = (Race*)env->GetLongField(p_race, FindCachedField(env, env->GetObjectClass(p_race), "pointer", "J")); -return x_player->supplyUsed(*race); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_allUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->allUnitCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_allUnitCount_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->allUnitCount(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_visibleUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->visibleUnitCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_visibleUnitCount_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->visibleUnitCount(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_completedUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->completedUnitCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_completedUnitCount_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->completedUnitCount(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_incompleteUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->incompleteUnitCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_incompleteUnitCount_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->incompleteUnitCount(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_deadUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->deadUnitCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_deadUnitCount_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->deadUnitCount(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_killedUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->killedUnitCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_killedUnitCount_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->killedUnitCount(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_getUpgradeLevel_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_upgrade){ -Player x_player = (Player)pointer; -UpgradeType* upgrade = (UpgradeType*)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); -return x_player->getUpgradeLevel(*upgrade); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_hasResearched_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Player x_player = (Player)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_player->hasResearched(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isResearching_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Player x_player = (Player)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_player->isResearching(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isUpgrading_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_upgrade){ -Player x_player = (Player)pointer; -UpgradeType* upgrade = (UpgradeType*)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); -return x_player->isUpgrading(*upgrade); -} -JNIEXPORT jobject JNICALL Java_bwapi_Player_getColor_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -Color cresult = x_player->getColor(); -jclass retcls = FindCachedClass(env, "bwapi/Color"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(III)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.red(), cresult.green(), cresult.blue()); -return result; -} -JNIEXPORT jchar JNICALL Java_bwapi_Player_getTextColor_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->getTextColor(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_maxEnergy_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->maxEnergy(*unit); -} -JNIEXPORT jdouble JNICALL Java_bwapi_Player_topSpeed_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->topSpeed(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_weaponMaxRange_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_weapon){ -Player x_player = (Player)pointer; -WeaponType* weapon = (WeaponType*)env->GetLongField(p_weapon, FindCachedField(env, env->GetObjectClass(p_weapon), "pointer", "J")); -return x_player->weaponMaxRange(*weapon); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_sightRange_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->sightRange(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_weaponDamageCooldown_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->weaponDamageCooldown(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_armor_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->armor(*unit); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_damage_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_wpn){ -Player x_player = (Player)pointer; -WeaponType* wpn = (WeaponType*)env->GetLongField(p_wpn, FindCachedField(env, env->GetObjectClass(p_wpn), "pointer", "J")); -return x_player->damage(*wpn); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_getUnitScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->getUnitScore(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_getKillScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->getKillScore(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_getBuildingScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->getBuildingScore(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_getRazingScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->getRazingScore(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_getCustomScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->getCustomScore(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isObserver_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player x_player = (Player)pointer; -return x_player->isObserver(); -} -JNIEXPORT jint JNICALL Java_bwapi_Player_getMaxUpgradeLevel_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_upgrade){ -Player x_player = (Player)pointer; -UpgradeType* upgrade = (UpgradeType*)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); -return x_player->getMaxUpgradeLevel(*upgrade); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isResearchAvailable_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Player x_player = (Player)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_player->isResearchAvailable(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_isUnitAvailable_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->isUnitAvailable(*unit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_hasUnitTypeRequirement_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->hasUnitTypeRequirement(*unit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Player_hasUnitTypeRequirement_1native__JLbwapi_UnitType_2I(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit, jint amount){ -Player x_player = (Player)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->hasUnitTypeRequirement(*unit, amount); -} -JNIEXPORT jobject JNICALL Java_bwapi_Playerset_getUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Playerset* x_playerset = (Playerset*)pointer; -Unitset cresult = x_playerset->getUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT void JNICALL Java_bwapi_Playerset_setAlliance_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean allies){ -Playerset* x_playerset = (Playerset*)pointer; -x_playerset->setAlliance((bool)allies); -} -JNIEXPORT void JNICALL Java_bwapi_Playerset_setAlliance_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Playerset* x_playerset = (Playerset*)pointer; -x_playerset->setAlliance(); -} -JNIEXPORT void JNICALL Java_bwapi_Playerset_setAlliance_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean allies, jboolean alliedVictory){ -Playerset* x_playerset = (Playerset*)pointer; -x_playerset->setAlliance((bool)allies, (bool)alliedVictory); -} -JNIEXPORT jstring JNICALL Java_bwapi_PlayerType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -PlayerType* x_playerType = (PlayerType*)pointer; -return env->NewStringUTF(x_playerType->toString().c_str()); -} -JNIEXPORT jboolean JNICALL Java_bwapi_PlayerType_isLobbyType_1native(JNIEnv * env, jobject obj, jlong pointer){ -PlayerType* x_playerType = (PlayerType*)pointer; -return x_playerType->isLobbyType(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_PlayerType_isGameType_1native(JNIEnv * env, jobject obj, jlong pointer){ -PlayerType* x_playerType = (PlayerType*)pointer; -return x_playerType->isGameType(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Position_isValid(JNIEnv * env, jobject obj){ -Position x_position((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -return x_position.isValid(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Position_makeValid(JNIEnv * env, jobject obj){ -Position x_position((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -Position cresult = x_position.makeValid(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jint JNICALL Java_bwapi_Position_getApproxDistance(JNIEnv * env, jobject obj, jobject p_position){ -Position x_position((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -Position position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_position.getApproxDistance(position); -} -JNIEXPORT jdouble JNICALL Java_bwapi_Position_getLength(JNIEnv * env, jobject obj){ -Position x_position((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -return x_position.getLength(); -} -JNIEXPORT jstring JNICALL Java_bwapi_Race_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -Race* x_race = (Race*)pointer; -return env->NewStringUTF(x_race->toString().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_Race_getWorker_1native(JNIEnv * env, jobject obj, jlong pointer){ -Race* x_race = (Race*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_race->getWorker().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Race_getCenter_1native(JNIEnv * env, jobject obj, jlong pointer){ -Race* x_race = (Race*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_race->getCenter().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Race_getRefinery_1native(JNIEnv * env, jobject obj, jlong pointer){ -Race* x_race = (Race*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_race->getRefinery().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Race_getTransport_1native(JNIEnv * env, jobject obj, jlong pointer){ -Race* x_race = (Race*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_race->getTransport().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Race_getSupplyProvider_1native(JNIEnv * env, jobject obj, jlong pointer){ -Race* x_race = (Race*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_race->getSupplyProvider().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_Region_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -return x_region->getID(); -} -JNIEXPORT jint JNICALL Java_bwapi_Region_getRegionGroupID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -return x_region->getRegionGroupID(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Region_getCenter_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -Position cresult = x_region->getCenter(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jboolean JNICALL Java_bwapi_Region_isHigherGround_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -return x_region->isHigherGround(); -} -JNIEXPORT jint JNICALL Java_bwapi_Region_getDefensePriority_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -return x_region->getDefensePriority(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Region_isAccessible_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -return x_region->isAccessible(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Region_getNeighbors_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -Regionset cresult = x_region->getNeighbors(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Region"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Region;"); -for(Regionset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Region elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jint JNICALL Java_bwapi_Region_getBoundsLeft_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -return x_region->getBoundsLeft(); -} -JNIEXPORT jint JNICALL Java_bwapi_Region_getBoundsTop_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -return x_region->getBoundsTop(); -} -JNIEXPORT jint JNICALL Java_bwapi_Region_getBoundsRight_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -return x_region->getBoundsRight(); -} -JNIEXPORT jint JNICALL Java_bwapi_Region_getBoundsBottom_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -return x_region->getBoundsBottom(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Region_getClosestAccessibleRegion_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -jlong resptr = (jlong)x_region->getClosestAccessibleRegion(); -jclass retcls = FindCachedClass(env, "bwapi/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Region_getClosestInaccessibleRegion_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -jlong resptr = (jlong)x_region->getClosestInaccessibleRegion(); -jclass retcls = FindCachedClass(env, "bwapi/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_Region_getDistance_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_other){ -Region x_region = (Region)pointer; -Region other = (Region)env->GetLongField(p_other, FindCachedField(env, env->GetObjectClass(p_other), "pointer", "J")); -return x_region->getDistance(other); -} -JNIEXPORT jobject JNICALL Java_bwapi_Region_getUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region x_region = (Region)pointer; -Unitset cresult = x_region->getUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Regionset_getCenter_1native(JNIEnv * env, jobject obj, jlong pointer){ -Regionset* x_regionset = (Regionset*)pointer; -Position cresult = x_regionset->getCenter(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Regionset_getUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Regionset* x_regionset = (Regionset*)pointer; -Unitset cresult = x_regionset->getUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jstring JNICALL Java_bwapi_TechType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -return env->NewStringUTF(x_techType->toString().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_TechType_getRace_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -jlong resptr = (jlong)tableRace.find(x_techType->getRace().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/Race"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Race;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_TechType_mineralPrice_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -return x_techType->mineralPrice(); -} -JNIEXPORT jint JNICALL Java_bwapi_TechType_gasPrice_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -return x_techType->gasPrice(); -} -JNIEXPORT jint JNICALL Java_bwapi_TechType_researchTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -return x_techType->researchTime(); -} -JNIEXPORT jint JNICALL Java_bwapi_TechType_energyCost_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -return x_techType->energyCost(); -} -JNIEXPORT jobject JNICALL Java_bwapi_TechType_whatResearches_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_techType->whatResearches().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_TechType_getWeapon_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -jlong resptr = (jlong)tableWeaponType.find(x_techType->getWeapon().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/WeaponType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/WeaponType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jboolean JNICALL Java_bwapi_TechType_targetsUnit_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -return x_techType->targetsUnit(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_TechType_targetsPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -return x_techType->targetsPosition(); -} -JNIEXPORT jobject JNICALL Java_bwapi_TechType_getOrder_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -jlong resptr = (jlong)tableOrder.find(x_techType->getOrder().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/Order"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Order;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_TechType_requiredUnit_1native(JNIEnv * env, jobject obj, jlong pointer){ -TechType* x_techType = (TechType*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_techType->requiredUnit().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jboolean JNICALL Java_bwapi_TilePosition_isValid(JNIEnv * env, jobject obj){ -TilePosition x_tilePosition((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -return x_tilePosition.isValid(); -} -JNIEXPORT jobject JNICALL Java_bwapi_TilePosition_makeValid(JNIEnv * env, jobject obj){ -TilePosition x_tilePosition((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -TilePosition cresult = x_tilePosition.makeValid(); -jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jdouble JNICALL Java_bwapi_TilePosition_getLength(JNIEnv * env, jobject obj){ -TilePosition x_tilePosition((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -return x_tilePosition.getLength(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getID(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_exists_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->exists(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getReplayID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getReplayID(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getPlayer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getPlayer(); -jclass retcls = FindCachedClass(env, "bwapi/Player"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Player;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)tableUnitType.find(x_unit->getType().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -Position cresult = x_unit->getPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getTilePosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -TilePosition cresult = x_unit->getTilePosition(); -jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jdouble JNICALL Java_bwapi_Unit_getAngle_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getAngle(); -} -JNIEXPORT jdouble JNICALL Java_bwapi_Unit_getVelocityX_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getVelocityX(); -} -JNIEXPORT jdouble JNICALL Java_bwapi_Unit_getVelocityY_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getVelocityY(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getRegion_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getRegion(); -jclass retcls = FindCachedClass(env, "bwapi/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getLeft_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getLeft(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getTop_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getTop(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getRight_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getRight(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getBottom_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getBottom(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getHitPoints_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getHitPoints(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getShields_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getShields(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getEnergy_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getEnergy(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getResources_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getResources(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getResourceGroup_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getResourceGroup(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getDistance_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->getDistance(target); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getDistance_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->getDistance(target); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getDistance_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->getDistance(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_hasPath_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->hasPath(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_hasPath_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->hasPath(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_hasPath_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->hasPath(target); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getLastCommandFrame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getLastCommandFrame(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getLastCommand_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -UnitCommand cresult = x_unit->getLastCommand(); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getLastAttackingPlayer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getLastAttackingPlayer(); -jclass retcls = FindCachedClass(env, "bwapi/Player"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Player;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getInitialType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)tableUnitType.find(x_unit->getInitialType().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getInitialPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -Position cresult = x_unit->getInitialPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getInitialTilePosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -TilePosition cresult = x_unit->getInitialTilePosition(); -jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getInitialHitPoints_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getInitialHitPoints(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getInitialResources_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getInitialResources(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getKillCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getKillCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getAcidSporeCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getAcidSporeCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getInterceptorCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getInterceptorCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getScarabCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getScarabCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getSpiderMineCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getSpiderMineCount(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getGroundWeaponCooldown_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getGroundWeaponCooldown(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getAirWeaponCooldown_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getAirWeaponCooldown(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getSpellCooldown_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getSpellCooldown(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getDefenseMatrixPoints_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getDefenseMatrixPoints(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getDefenseMatrixTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getDefenseMatrixTimer(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getEnsnareTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getEnsnareTimer(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getIrradiateTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getIrradiateTimer(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getLockdownTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getLockdownTimer(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getMaelstromTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getMaelstromTimer(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getOrderTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getOrderTimer(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getPlagueTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getPlagueTimer(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getRemoveTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getRemoveTimer(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getStasisTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getStasisTimer(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getStimTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getStimTimer(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getBuildType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)tableUnitType.find(x_unit->getBuildType().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getTrainingQueue_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -std::deque cresult = x_unit->getTrainingQueue(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/UnitType"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/UnitType;"); -for(std::deque::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const UnitType* elem_ptr = tableUnitType.find((*it).getID())->second; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getTech_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)tableTechType.find(x_unit->getTech().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/TechType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/TechType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getUpgrade_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)tableUpgradeType.find(x_unit->getUpgrade().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UpgradeType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UpgradeType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getRemainingBuildTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getRemainingBuildTime(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getRemainingTrainTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getRemainingTrainTime(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getRemainingResearchTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getRemainingResearchTime(); -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getRemainingUpgradeTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getRemainingUpgradeTime(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getBuildUnit_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getBuildUnit(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getTarget_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getTarget(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getTargetPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -Position cresult = x_unit->getTargetPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getOrder_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)tableOrder.find(x_unit->getOrder().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/Order"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Order;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getSecondaryOrder_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)tableOrder.find(x_unit->getSecondaryOrder().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/Order"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Order;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getOrderTarget_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getOrderTarget(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getOrderTargetPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -Position cresult = x_unit->getOrderTargetPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getRallyPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -Position cresult = x_unit->getRallyPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getRallyUnit_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getRallyUnit(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getAddon_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getAddon(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getNydusExit_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getNydusExit(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getPowerUp_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getPowerUp(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getTransport_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getTransport(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getLoadedUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -Unitset cresult = x_unit->getLoadedUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jint JNICALL Java_bwapi_Unit_getSpaceRemaining_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->getSpaceRemaining(); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getCarrier_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getCarrier(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getInterceptors_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -Unitset cresult = x_unit->getInterceptors(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getHatchery_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -jlong resptr = (jlong)x_unit->getHatchery(); -jclass retcls = FindCachedClass(env, "bwapi/Unit"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Unit;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getLarva_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -Unitset cresult = x_unit->getLarva(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getUnitsInRadius_1native(JNIEnv * env, jobject obj, jlong pointer, jint radius){ -Unit x_unit = (Unit)pointer; -Unitset cresult = x_unit->getUnitsInRadius(radius); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unit_getUnitsInWeaponRange_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_weapon){ -Unit x_unit = (Unit)pointer; -WeaponType* weapon = (WeaponType*)env->GetLongField(p_weapon, FindCachedField(env, env->GetObjectClass(p_weapon), "pointer", "J")); -Unitset cresult = x_unit->getUnitsInWeaponRange(*weapon); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_hasNuke_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->hasNuke(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isAccelerating_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isAccelerating(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isAttacking_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isAttacking(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isAttackFrame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isAttackFrame(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isBeingConstructed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isBeingConstructed(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isBeingGathered_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isBeingGathered(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isBeingHealed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isBeingHealed(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isBlind_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isBlind(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isBraking_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isBraking(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isBurrowed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isBurrowed(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isCarryingGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isCarryingGas(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isCarryingMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isCarryingMinerals(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isCloaked_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isCloaked(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isCompleted_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isCompleted(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isConstructing_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isConstructing(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isDefenseMatrixed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isDefenseMatrixed(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isDetected_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isDetected(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isEnsnared_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isEnsnared(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isFlying_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isFlying(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isFollowing_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isFollowing(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isGatheringGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isGatheringGas(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isGatheringMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isGatheringMinerals(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isHallucination_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isHallucination(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isHoldingPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isHoldingPosition(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isIdle_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isIdle(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isInterruptible_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isInterruptible(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isInvincible_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isInvincible(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isInWeaponRange_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->isInWeaponRange(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isIrradiated_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isIrradiated(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isLifted_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isLifted(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isLoaded_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isLoaded(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isLockedDown_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isLockedDown(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isMaelstrommed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isMaelstrommed(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isMorphing_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isMorphing(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isMoving_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isMoving(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isParasited_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isParasited(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isPatrolling_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isPatrolling(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isPlagued_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isPlagued(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isRepairing_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isRepairing(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isResearching_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isResearching(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isSelected_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isSelected(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isSieged_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isSieged(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isStartingAttack_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isStartingAttack(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isStasised_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isStasised(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isStimmed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isStimmed(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isStuck_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isStuck(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isTraining_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isTraining(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isUnderAttack_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isUnderAttack(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isUnderDarkSwarm_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isUnderDarkSwarm(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isUnderDisruptionWeb_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isUnderDisruptionWeb(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isUnderStorm_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isUnderStorm(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isPowered_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isPowered(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isUpgrading_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isUpgrading(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isVisible_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isVisible(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isVisible_1native__JLbwapi_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Unit x_unit = (Unit)pointer; -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -return x_unit->isVisible(player); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_isTargetable_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->isTargetable(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_issueCommand_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_command){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->issueCommand(command); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_attack_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->attack(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_attack_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->attack(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_attack_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->attack(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_attack_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->attack(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_attack_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->attack(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_attack_1native__JLbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->attack(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_build_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit x_unit = (Unit)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->build(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_build_1native__JLbwapi_UnitType_2Lbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_target){ -Unit x_unit = (Unit)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->build(*type, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_buildAddon_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit x_unit = (Unit)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->buildAddon(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_train_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->train(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_train_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit x_unit = (Unit)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->train(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_morph_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit x_unit = (Unit)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->morph(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_research_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->research(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_upgrade_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_upgrade){ -Unit x_unit = (Unit)pointer; -UpgradeType* upgrade = (UpgradeType*)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); -return x_unit->upgrade(*upgrade); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_setRallyPoint_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->setRallyPoint(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_setRallyPoint_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->setRallyPoint(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_setRallyPoint_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->setRallyPoint(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_move_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->move(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_move_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->move(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_patrol_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->patrol(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_patrol_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->patrol(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_holdPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->holdPosition(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_holdPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -return x_unit->holdPosition((bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_stop_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->stop(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_stop_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -return x_unit->stop((bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_follow_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->follow(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_follow_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->follow(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_gather_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->gather(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_gather_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->gather(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_returnCargo_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->returnCargo(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_returnCargo_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -return x_unit->returnCargo((bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_repair_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->repair(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_repair_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->repair(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_burrow_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->burrow(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_unburrow_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->unburrow(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_cloak_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->cloak(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_decloak_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->decloak(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_siege_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->siege(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_unsiege_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->unsiege(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_lift_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->lift(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_land_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->land(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_load_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->load(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_load_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->load(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_unload_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->unload(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_unloadAll_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->unloadAll(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_unloadAll_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -return x_unit->unloadAll((bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_unloadAll_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->unloadAll(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_unloadAll_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->unloadAll(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_rightClick_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->rightClick(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_rightClick_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->rightClick(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_rightClick_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->rightClick(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_rightClick_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->rightClick(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_rightClick_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->rightClick(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_rightClick_1native__JLbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->rightClick(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_haltConstruction_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->haltConstruction(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_cancelConstruction_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->cancelConstruction(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_cancelAddon_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->cancelAddon(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_cancelTrain_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->cancelTrain(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_cancelTrain_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint slot){ -Unit x_unit = (Unit)pointer; -return x_unit->cancelTrain(slot); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_cancelMorph_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->cancelMorph(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_cancelResearch_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->cancelResearch(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_cancelUpgrade_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->cancelUpgrade(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_useTech_1native__JLbwapi_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->useTech(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_useTech_1native__JLbwapi_TechType_2Lbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->useTech(*tech, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_useTech_1native__JLbwapi_TechType_2Lbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->useTech(*tech, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_useTech_1native__JLbwapi_TechType_2Lbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->useTech(*tech, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_placeCOP_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->placeCOP(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommand_1native__JLbwapi_UnitCommand_2ZZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanBuildUnitType, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommand_1native__JLbwapi_UnitCommand_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanBuildUnitType, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommand_1native__JLbwapi_UnitCommand_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanBuildUnitType){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommand_1native__JLbwapi_UnitCommand_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommand_1native__JLbwapi_UnitCommand_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommand_1native__JLbwapi_UnitCommand_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_command){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommand(command); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommand_1native__JLbwapi_UnitCommand_2ZZZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanBuildUnitType, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandGrouped_1native__JLbwapi_UnitCommand_2ZZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandGrouped_1native__JLbwapi_UnitCommand_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandGrouped_1native__JLbwapi_UnitCommand_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandGrouped_1native__JLbwapi_UnitCommand_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandGrouped_1native__JLbwapi_UnitCommand_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandGrouped_1native__JLbwapi_UnitCommand_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_command){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommandGrouped(command); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandGrouped_1native__JLbwapi_UnitCommand_2ZZZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCommand_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCommand(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCommandGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCommandGrouped(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCommandGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCommandGrouped((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandType_1native__JLbwapi_UnitCommandType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct){ -Unit x_unit = (Unit)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); -return x_unit->canIssueCommandType(*ct); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandType_1native__JLbwapi_UnitCommandType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); -return x_unit->canIssueCommandType(*ct, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandTypeGrouped_1native__JLbwapi_UnitCommandType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); -return x_unit->canIssueCommandTypeGrouped(*ct, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandTypeGrouped_1native__JLbwapi_UnitCommandType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct){ -Unit x_unit = (Unit)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); -return x_unit->canIssueCommandTypeGrouped(*ct); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canIssueCommandTypeGrouped_1native__JLbwapi_UnitCommandType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); -return x_unit->canIssueCommandTypeGrouped(*ct, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canTargetUnit_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canTargetUnit(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canTargetUnit_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canTargetUnit(targetUnit, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttack(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttack((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canAttack(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canAttack(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canAttack(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canAttack(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canAttack(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canAttack(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canAttack(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canAttack(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canAttack(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_Position_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canAttack(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canAttack(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttack_1native__JLbwapi_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canAttack(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackGrouped((bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackGrouped(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Position_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canAttackGrouped(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canAttackGrouped(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canAttackGrouped(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Position_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackGrouped_1native__JLbwapi_PositionOrUnit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackMove_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackMove(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackMove_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackMove((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackMoveGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackMoveGrouped((bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackMoveGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackMoveGrouped(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackMoveGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackMoveGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnit_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackUnit(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnit_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackUnit((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnit_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canAttackUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnit_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canAttackUnit(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnit_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canAttackUnit(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnit_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canAttackUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnitGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackUnitGrouped((bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnitGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackUnitGrouped(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnitGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canAttackUnitGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnitGrouped_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canAttackUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnitGrouped_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canAttackUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnitGrouped_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canAttackUnitGrouped(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnitGrouped_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canAttackUnitGrouped(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canAttackUnitGrouped_1native__JLbwapi_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canAttackUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuild_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canBuild(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuild_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canBuild((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuild_1native__JLbwapi_UnitType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuild(*uType, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuild_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuild(*uType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuild_1native__JLbwapi_UnitType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuild(*uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuild_1native__JLbwapi_UnitType_2Lbwapi_TilePosition_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jobject p_tilePos, jboolean checkTargetUnitType, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -TilePosition tilePos((int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "x", "I")), (int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "y", "I"))); -return x_unit->canBuild(*uType, tilePos, (bool)checkTargetUnitType, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuild_1native__JLbwapi_UnitType_2Lbwapi_TilePosition_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jobject p_tilePos, jboolean checkTargetUnitType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -TilePosition tilePos((int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "x", "I")), (int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "y", "I"))); -return x_unit->canBuild(*uType, tilePos, (bool)checkTargetUnitType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuild_1native__JLbwapi_UnitType_2Lbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jobject p_tilePos){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -TilePosition tilePos((int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "x", "I")), (int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "y", "I"))); -return x_unit->canBuild(*uType, tilePos); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuild_1native__JLbwapi_UnitType_2Lbwapi_TilePosition_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jobject p_tilePos, jboolean checkTargetUnitType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -TilePosition tilePos((int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "x", "I")), (int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "y", "I"))); -return x_unit->canBuild(*uType, tilePos, (bool)checkTargetUnitType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuildAddon_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canBuildAddon(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuildAddon_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canBuildAddon((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuildAddon_1native__JLbwapi_UnitType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuildAddon(*uType, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuildAddon_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuildAddon(*uType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBuildAddon_1native__JLbwapi_UnitType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuildAddon(*uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canTrain_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canTrain(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canTrain_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canTrain((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canTrain_1native__JLbwapi_UnitType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canTrain(*uType, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canTrain_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canTrain(*uType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canTrain_1native__JLbwapi_UnitType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canTrain(*uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMorph_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canMorph(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMorph_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canMorph((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMorph_1native__JLbwapi_UnitType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canMorph(*uType, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMorph_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canMorph(*uType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMorph_1native__JLbwapi_UnitType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canMorph(*uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canResearch_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canResearch(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canResearch_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canResearch((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canResearch_1native__JLbwapi_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit x_unit = (Unit)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->canResearch(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canResearch_1native__JLbwapi_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->canResearch(*type, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUpgrade_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canUpgrade(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUpgrade_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canUpgrade((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUpgrade_1native__JLbwapi_UpgradeType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit x_unit = (Unit)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->canUpgrade(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUpgrade_1native__JLbwapi_UpgradeType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->canUpgrade(*type, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canSetRallyPoint(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canSetRallyPoint((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canSetRallyPoint(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canSetRallyPoint(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canSetRallyPoint(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_Position_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPoint_1native__JLbwapi_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canSetRallyPosition(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canSetRallyPosition((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyUnit_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canSetRallyUnit(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyUnit_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canSetRallyUnit((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyUnit_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canSetRallyUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyUnit_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canSetRallyUnit(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyUnit_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canSetRallyUnit(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSetRallyUnit_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canSetRallyUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMove_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canMove(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMove_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canMove((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMoveGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -return x_unit->canMoveGrouped((bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMoveGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canMoveGrouped(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canMoveGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canMoveGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPatrol_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canPatrol(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPatrol_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canPatrol((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPatrolGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -return x_unit->canPatrolGrouped((bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPatrolGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canPatrolGrouped(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPatrolGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canPatrolGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canFollow_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canFollow(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canFollow_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canFollow((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canFollow_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canFollow(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canFollow_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canFollow(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canFollow_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canFollow(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canFollow_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canFollow(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canGather_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canGather(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canGather_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canGather((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canGather_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canGather(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canGather_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canGather(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canGather_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canGather(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canGather_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canGather(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canReturnCargo_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canReturnCargo(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canReturnCargo_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canReturnCargo((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canHoldPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canHoldPosition(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canHoldPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canHoldPosition((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canStop_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canStop(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canStop_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canStop((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRepair_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canRepair(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRepair_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canRepair((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRepair_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRepair(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRepair_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRepair(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRepair_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRepair(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRepair_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRepair(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBurrow_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canBurrow(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canBurrow_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canBurrow((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnburrow_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnburrow(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnburrow_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnburrow((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCloak_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCloak(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCloak_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCloak((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canDecloak_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canDecloak(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canDecloak_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canDecloak((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSiege_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canSiege(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canSiege_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canSiege((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnsiege_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnsiege(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnsiege_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnsiege((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLift_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canLift(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLift_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canLift((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLand_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canLand(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLand_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canLand((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLand_1native__JLbwapi_TilePosition_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canLand(target, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLand_1native__JLbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canLand(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLand_1native__JLbwapi_TilePosition_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canLand(target, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLoad_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canLoad(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLoad_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canLoad((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLoad_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canLoad(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLoad_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canLoad(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLoad_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canLoad(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canLoad_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canLoad(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadWithOrWithoutTarget_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnloadWithOrWithoutTarget(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadWithOrWithoutTarget_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnloadWithOrWithoutTarget((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAtPosition_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); -return x_unit->canUnloadAtPosition(targDropPos, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAtPosition_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos){ -Unit x_unit = (Unit)pointer; -Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); -return x_unit->canUnloadAtPosition(targDropPos); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAtPosition_1native__JLbwapi_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); -return x_unit->canUnloadAtPosition(targDropPos, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnload_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnload(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnload_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnload((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnload_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkPosition, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUnload(targetUnit, (bool)checkCanTargetUnit, (bool)checkPosition, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnload_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkPosition){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUnload(targetUnit, (bool)checkCanTargetUnit, (bool)checkPosition); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnload_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUnload(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnload_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUnload(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnload_1native__JLbwapi_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkPosition, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUnload(targetUnit, (bool)checkCanTargetUnit, (bool)checkPosition, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAll_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnloadAll(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAll_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnloadAll((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAllPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnloadAllPosition(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAllPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canUnloadAllPosition((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAllPosition_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); -return x_unit->canUnloadAllPosition(targDropPos, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAllPosition_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos){ -Unit x_unit = (Unit)pointer; -Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); -return x_unit->canUnloadAllPosition(targDropPos); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUnloadAllPosition_1native__JLbwapi_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); -return x_unit->canUnloadAllPosition(targDropPos, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClick(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClick((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canRightClick(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canRightClick(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canRightClick(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canRightClick(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canRightClick(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canRightClick(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canRightClick(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canRightClick(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canRightClick(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_Position_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canRightClick(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canRightClick(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClick_1native__JLbwapi_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canRightClick(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickGrouped((bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickGrouped(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Position_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canRightClickGrouped(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canRightClickGrouped(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canRightClickGrouped(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Position_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickGrouped_1native__JLbwapi_PositionOrUnit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickPosition(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickPosition((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickPositionGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickPositionGrouped((bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickPositionGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickPositionGrouped(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickPositionGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickPositionGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnit_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickUnit(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnit_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickUnit((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnit_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRightClickUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnit_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRightClickUnit(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnit_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRightClickUnit(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnit_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRightClickUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnitGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickUnitGrouped((bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnitGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickUnitGrouped(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnitGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canRightClickUnitGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnitGrouped_1native__JLbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRightClickUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnitGrouped_1native__JLbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRightClickUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnitGrouped_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRightClickUnitGrouped(targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnitGrouped_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRightClickUnitGrouped(targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canRightClickUnitGrouped_1native__JLbwapi_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canRightClickUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canHaltConstruction_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canHaltConstruction(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canHaltConstruction_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canHaltConstruction((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelConstruction_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelConstruction(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelConstruction_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelConstruction((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelAddon_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelAddon(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelAddon_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelAddon((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelTrain_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelTrain(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelTrain_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelTrain((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelTrainSlot_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelTrainSlot(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelTrainSlot_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelTrainSlot((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelTrainSlot_1native__JIZ(JNIEnv * env, jobject obj, jlong pointer, jint slot, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelTrainSlot(slot, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelTrainSlot_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint slot){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelTrainSlot(slot); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelTrainSlot_1native__JIZZ(JNIEnv * env, jobject obj, jlong pointer, jint slot, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelTrainSlot(slot, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelMorph_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelMorph(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelMorph_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelMorph((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelResearch_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelResearch(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelResearch_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelResearch((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelUpgrade_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelUpgrade(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canCancelUpgrade_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canCancelUpgrade((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechWithOrWithoutTarget_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canUseTechWithOrWithoutTarget(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechWithOrWithoutTarget_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canUseTechWithOrWithoutTarget((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechWithOrWithoutTarget_1native__JLbwapi_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithOrWithoutTarget(*tech, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechWithOrWithoutTarget_1native__JLbwapi_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithOrWithoutTarget(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechWithOrWithoutTarget_1native__JLbwapi_TechType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithOrWithoutTarget(*tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Position_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTech(*tech, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canUseTech(*tech, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTech(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Position_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTech_1native__JLbwapi_TechType_2Lbwapi_PositionOrUnit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechWithoutTarget_1native__JLbwapi_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithoutTarget(*tech, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechWithoutTarget_1native__JLbwapi_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithoutTarget(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechWithoutTarget_1native__JLbwapi_TechType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithoutTarget(*tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechUnit_1native__JLbwapi_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechUnit_1native__JLbwapi_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechUnit(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechUnit_1native__JLbwapi_TechType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechUnit_1native__JLbwapi_TechType_2Lbwapi_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkTargetsUnits, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit, (bool)checkCanTargetUnit, (bool)checkTargetsUnits, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechUnit_1native__JLbwapi_TechType_2Lbwapi_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkTargetsUnits){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit, (bool)checkCanTargetUnit, (bool)checkTargetsUnits); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechUnit_1native__JLbwapi_TechType_2Lbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit, (bool)checkCanTargetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechUnit_1native__JLbwapi_TechType_2Lbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechUnit_1native__JLbwapi_TechType_2Lbwapi_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkTargetsUnits, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit, (bool)checkCanTargetUnit, (bool)checkTargetsUnits, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechPosition_1native__JLbwapi_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechPosition(*tech, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechPosition_1native__JLbwapi_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechPosition(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechPosition_1native__JLbwapi_TechType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechPosition(*tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechPosition_1native__JLbwapi_TechType_2Lbwapi_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkTargetsPositions, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTechPosition(*tech, target, (bool)checkTargetsPositions, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechPosition_1native__JLbwapi_TechType_2Lbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkTargetsPositions){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTechPosition(*tech, target, (bool)checkTargetsPositions); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechPosition_1native__JLbwapi_TechType_2Lbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTechPosition(*tech, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canUseTechPosition_1native__JLbwapi_TechType_2Lbwapi_Position_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkTargetsPositions, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTechPosition(*tech, target, (bool)checkTargetsPositions, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPlaceCOP_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit x_unit = (Unit)pointer; -return x_unit->canPlaceCOP(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPlaceCOP_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -return x_unit->canPlaceCOP((bool)checkCommandibility); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPlaceCOP_1native__JLbwapi_TilePosition_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanIssueCommandType){ -Unit x_unit = (Unit)pointer; -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canPlaceCOP(target, (bool)checkCanIssueCommandType); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPlaceCOP_1native__JLbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit x_unit = (Unit)pointer; -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canPlaceCOP(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unit_canPlaceCOP_1native__JLbwapi_TilePosition_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit x_unit = (Unit)pointer; -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canPlaceCOP(target, (bool)checkCanIssueCommandType, (bool)checkCommandibility); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_attack__Lbwapi_Unit_2Lbwapi_PositionOrUnit_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -UnitCommand cresult = UnitCommand::attack(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_attack__Lbwapi_Unit_2Lbwapi_PositionOrUnit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -UnitCommand cresult = UnitCommand::attack(unit, target, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_build(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jobject p_type){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -UnitCommand cresult = UnitCommand::build(unit, target, *type); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_buildAddon(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_type){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -UnitCommand cresult = UnitCommand::buildAddon(unit, *type); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_train(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_type){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -UnitCommand cresult = UnitCommand::train(unit, *type); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_morph(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_type){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -UnitCommand cresult = UnitCommand::morph(unit, *type); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_research(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_tech){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -UnitCommand cresult = UnitCommand::research(unit, *tech); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_upgrade(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_upgrade){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UpgradeType* upgrade = (UpgradeType*)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); -UnitCommand cresult = UnitCommand::upgrade(unit, *upgrade); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_setRallyPoint(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -UnitCommand cresult = UnitCommand::setRallyPoint(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_move__Lbwapi_Unit_2Lbwapi_Position_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -UnitCommand cresult = UnitCommand::move(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_move__Lbwapi_Unit_2Lbwapi_Position_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -UnitCommand cresult = UnitCommand::move(unit, target, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_patrol__Lbwapi_Unit_2Lbwapi_Position_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -UnitCommand cresult = UnitCommand::patrol(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_patrol__Lbwapi_Unit_2Lbwapi_Position_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -UnitCommand cresult = UnitCommand::patrol(unit, target, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_holdPosition__Lbwapi_Unit_2(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::holdPosition(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_holdPosition__Lbwapi_Unit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::holdPosition(unit, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_stop__Lbwapi_Unit_2(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::stop(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_stop__Lbwapi_Unit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::stop(unit, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_follow__Lbwapi_Unit_2Lbwapi_Unit_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -UnitCommand cresult = UnitCommand::follow(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_follow__Lbwapi_Unit_2Lbwapi_Unit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -UnitCommand cresult = UnitCommand::follow(unit, target, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_gather__Lbwapi_Unit_2Lbwapi_Unit_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -UnitCommand cresult = UnitCommand::gather(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_gather__Lbwapi_Unit_2Lbwapi_Unit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -UnitCommand cresult = UnitCommand::gather(unit, target, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_returnCargo__Lbwapi_Unit_2(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::returnCargo(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_returnCargo__Lbwapi_Unit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::returnCargo(unit, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_repair__Lbwapi_Unit_2Lbwapi_Unit_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -UnitCommand cresult = UnitCommand::repair(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_repair__Lbwapi_Unit_2Lbwapi_Unit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -UnitCommand cresult = UnitCommand::repair(unit, target, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_burrow(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::burrow(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_unburrow(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::unburrow(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_cloak(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::cloak(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_decloak(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::decloak(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_siege(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::siege(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_unsiege(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::unsiege(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_lift(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::lift(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_land(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -UnitCommand cresult = UnitCommand::land(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_load__Lbwapi_Unit_2Lbwapi_Unit_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -UnitCommand cresult = UnitCommand::load(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_load__Lbwapi_Unit_2Lbwapi_Unit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -UnitCommand cresult = UnitCommand::load(unit, target, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_unload(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -UnitCommand cresult = UnitCommand::unload(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_unloadAll__Lbwapi_Unit_2(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::unloadAll(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_unloadAll__Lbwapi_Unit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::unloadAll(unit, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_unloadAll__Lbwapi_Unit_2Lbwapi_Position_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -UnitCommand cresult = UnitCommand::unloadAll(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_unloadAll__Lbwapi_Unit_2Lbwapi_Position_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -UnitCommand cresult = UnitCommand::unloadAll(unit, target, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_rightClick__Lbwapi_Unit_2Lbwapi_PositionOrUnit_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -UnitCommand cresult = UnitCommand::rightClick(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_rightClick__Lbwapi_Unit_2Lbwapi_PositionOrUnit_2Z(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target, jboolean shiftQueueCommand){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -UnitCommand cresult = UnitCommand::rightClick(unit, target, (bool)shiftQueueCommand); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_haltConstruction(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::haltConstruction(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_cancelConstruction(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::cancelConstruction(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_cancelAddon(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::cancelAddon(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_cancelTrain__Lbwapi_Unit_2(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::cancelTrain(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_cancelTrain__Lbwapi_Unit_2I(JNIEnv * env, jclass jclz, jobject p_unit, jint slot){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::cancelTrain(unit, slot); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_cancelMorph(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::cancelMorph(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_cancelResearch(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::cancelResearch(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_cancelUpgrade(JNIEnv * env, jclass jclz, jobject p_unit){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -UnitCommand cresult = UnitCommand::cancelUpgrade(unit); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_useTech__Lbwapi_Unit_2Lbwapi_TechType_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_tech){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -UnitCommand cresult = UnitCommand::useTech(unit, *tech); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_useTech__Lbwapi_Unit_2Lbwapi_TechType_2Lbwapi_PositionOrUnit_2(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_tech, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -UnitCommand cresult = UnitCommand::useTech(unit, *tech, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitCommand_placeCOP(JNIEnv * env, jclass jclz, jobject p_unit, jobject p_target){ -Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -UnitCommand cresult = UnitCommand::placeCOP(unit, target); -jclass retcls = FindCachedClass(env, "bwapi/UnitCommand"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Lbwapi/Unit;Lbwapi/UnitCommandType;Lbwapi/Unit;III)V"); -jobject result = env->NewObject(retcls, retConsID, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getUnit()) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/UnitCommandType"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/UnitCommandType"), "get", "(J)Lbwapi/UnitCommandType;"), (jlong)tableUnitCommandType.find(cresult.getType().getID())->second ) -, env->CallStaticObjectMethod(FindCachedClass(env, "bwapi/Unit"), FindCachedMethodStatic(env, FindCachedClass(env, "bwapi/Unit"), "get", "(J)Lbwapi/Unit;"), cresult.getTarget()) -, cresult.getTargetPosition().x -, cresult.getTargetPosition().y -, resolveUnitCommandExtra(cresult)); -return result; -} -JNIEXPORT jstring JNICALL Java_bwapi_UnitCommandType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitCommandType* x_unitCommandType = (UnitCommandType*)pointer; -return env->NewStringUTF(x_unitCommandType->toString().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_Unitset_getPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -Position cresult = x_unitset->getPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unitset_getLoadedUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -Unitset cresult = x_unitset->getLoadedUnits(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unitset_getInterceptors_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -Unitset cresult = x_unitset->getInterceptors(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unitset_getLarva_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -Unitset cresult = x_unitset->getLarva(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_Unitset_getUnitsInRadius_1native(JNIEnv * env, jobject obj, jlong pointer, jint radius){ -Unitset* x_unitset = (Unitset*)pointer; -Unitset cresult = x_unitset->getUnitsInRadius(radius); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_issueCommand_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_command){ -Unitset* x_unitset = (Unitset*)pointer; -UnitCommand command(convertUnitCommand(env, p_command )); -return x_unitset->issueCommand(command); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_attack_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->attack(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_attack_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->attack(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_attack_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unitset->attack(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_attack_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->attack(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_attack_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->attack(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_attack_1native__JLbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unitset->attack(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_build_1native__JLbwapi_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unitset->build(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_build_1native__JLbwapi_UnitType_2Lbwapi_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->build(*type, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_buildAddon_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unitset->buildAddon(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_train_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unitset->train(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_morph_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unitset->morph(*type); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_setRallyPoint_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->setRallyPoint(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_setRallyPoint_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->setRallyPoint(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_setRallyPoint_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unitset->setRallyPoint(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_move_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->move(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_move_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->move(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_patrol_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->patrol(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_patrol_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->patrol(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_holdPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->holdPosition(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_holdPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->holdPosition((bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_stop_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->stop(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_stop_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->stop((bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_follow_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->follow(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_follow_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->follow(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_gather_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->gather(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_gather_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->gather(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_returnCargo_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->returnCargo(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_returnCargo_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->returnCargo((bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_repair_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->repair(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_repair_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->repair(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_burrow_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->burrow(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_unburrow_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->unburrow(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_cloak_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->cloak(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_decloak_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->decloak(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_siege_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->siege(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_unsiege_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->unsiege(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_lift_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->lift(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_load_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->load(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_load_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->load(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_unloadAll_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->unloadAll(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_unloadAll_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->unloadAll((bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_unloadAll_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->unloadAll(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_unloadAll_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->unloadAll(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_rightClick_1native__JLbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->rightClick(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_rightClick_1native__JLbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->rightClick(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_rightClick_1native__JLbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unitset->rightClick(target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_rightClick_1native__JLbwapi_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->rightClick(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_rightClick_1native__JLbwapi_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->rightClick(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_rightClick_1native__JLbwapi_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unitset->rightClick(target, (bool)shiftQueueCommand); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_haltConstruction_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->haltConstruction(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_cancelConstruction_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->cancelConstruction(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_cancelAddon_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->cancelAddon(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_cancelTrain_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->cancelTrain(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_cancelTrain_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint slot){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->cancelTrain(slot); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_cancelMorph_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->cancelMorph(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_cancelResearch_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->cancelResearch(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_cancelUpgrade_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unitset* x_unitset = (Unitset*)pointer; -return x_unitset->cancelUpgrade(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_useTech_1native__JLbwapi_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unitset* x_unitset = (Unitset*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unitset->useTech(*tech); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_useTech_1native__JLbwapi_TechType_2Lbwapi_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->useTech(*tech, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_useTech_1native__JLbwapi_TechType_2Lbwapi_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->useTech(*tech, target); -} -JNIEXPORT jboolean JNICALL Java_bwapi_Unitset_useTech_1native__JLbwapi_TechType_2Lbwapi_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unitset* x_unitset = (Unitset*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit target(convertPositionOrUnit(env, p_target )); -return x_unitset->useTech(*tech, target); -} -JNIEXPORT jstring JNICALL Java_bwapi_UnitSizeType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitSizeType* x_unitSizeType = (UnitSizeType*)pointer; -return env->NewStringUTF(x_unitSizeType->toString().c_str()); -} -JNIEXPORT jstring JNICALL Java_bwapi_UnitType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return env->NewStringUTF(x_unitType->toString().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_getRace_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -jlong resptr = (jlong)tableRace.find(x_unitType->getRace().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/Race"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Race;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_whatBuilds_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -std::pair cresult = x_unitType->whatBuilds(); -jclass firstElemClass = FindCachedClass(env, "bwapi/UnitType"); -jmethodID firstGetMethodID = FindCachedMethodStatic(env, firstElemClass, "get", "(J)Lbwapi/UnitType;"); -jclass secondElemClass = FindCachedClass(env, "java/lang/Integer"); -jmethodID secondElemConsID = FindCachedMethod(env, secondElemClass, "", "(I)V"); -const UnitType* first_elem_ptr = tableUnitType.find((cresult.first).getID())->second; -jobject first = env->CallStaticObjectMethod(firstElemClass, firstGetMethodID, (jlong)first_elem_ptr) ; -const int second_elem_ptr = cresult.second; -jobject second = env->NewObject(secondElemClass, secondElemConsID, second_elem_ptr); -jclass retcls = FindCachedClass(env, "bwapi/Pair"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Ljava/lang/Object;Ljava/lang/Object;)V"); -jobject result = env->NewObject(retcls, retConsID, first, second); -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_requiredUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -std::map cresult = x_unitType->requiredUnits(); -jclass listCls = FindCachedClass(env, "java/util/HashMap"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); -jclass keyElemClass = FindCachedClass(env, "bwapi/UnitType"); -jmethodID keyGetMethodID = FindCachedMethodStatic(env, keyElemClass, "get", "(J)Lbwapi/UnitType;"); -jclass valueElemClass = FindCachedClass(env, "java/lang/Integer"); -jmethodID valueElemConsID = FindCachedMethod(env, valueElemClass, "", "(I)V"); -for(std::map::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const UnitType* key_elem_ptr = tableUnitType.find((it->first).getID())->second; -jobject keyElem = env->CallStaticObjectMethod(keyElemClass, keyGetMethodID, (jlong)key_elem_ptr) ; -const int value_elem_ptr = (it->second); -jobject valueElem = env->NewObject(valueElemClass, valueElemConsID, value_elem_ptr); -env->CallVoidMethod(result, addMethodID, keyElem, valueElem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_requiredTech_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -jlong resptr = (jlong)tableTechType.find(x_unitType->requiredTech().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/TechType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/TechType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_cloakingTech_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -jlong resptr = (jlong)tableTechType.find(x_unitType->cloakingTech().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/TechType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/TechType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_abilities_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -SetContainer cresult = x_unitType->abilities(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/TechType"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/TechType;"); -for(SetContainer::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const TechType* elem_ptr = tableTechType.find((*it).getID())->second; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_upgrades_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -SetContainer cresult = x_unitType->upgrades(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/UpgradeType"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/UpgradeType;"); -for(SetContainer::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const UpgradeType* elem_ptr = tableUpgradeType.find((*it).getID())->second; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_armorUpgrade_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -jlong resptr = (jlong)tableUpgradeType.find(x_unitType->armorUpgrade().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UpgradeType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UpgradeType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_maxHitPoints_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->maxHitPoints(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_maxShields_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->maxShields(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_maxEnergy_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->maxEnergy(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_armor_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->armor(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_mineralPrice_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->mineralPrice(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_gasPrice_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->gasPrice(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_buildTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->buildTime(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_supplyRequired_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->supplyRequired(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_supplyProvided_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->supplyProvided(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_spaceRequired_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->spaceRequired(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_spaceProvided_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->spaceProvided(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_buildScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->buildScore(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_destroyScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->destroyScore(); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_size_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -jlong resptr = (jlong)x_unitType->size(); -jclass retcls = FindCachedClass(env, "bwapi/UnitSizeType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitSizeType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_tileWidth_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->tileWidth(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_tileHeight_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->tileHeight(); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_tileSize_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -TilePosition cresult = x_unitType->tileSize(); -jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_dimensionLeft_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->dimensionLeft(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_dimensionUp_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->dimensionUp(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_dimensionRight_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->dimensionRight(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_dimensionDown_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->dimensionDown(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_width_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->width(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_height_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->height(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_seekRange_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->seekRange(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_sightRange_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->sightRange(); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_groundWeapon_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -jlong resptr = (jlong)tableWeaponType.find(x_unitType->groundWeapon().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/WeaponType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/WeaponType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_maxGroundHits_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->maxGroundHits(); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_airWeapon_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -jlong resptr = (jlong)tableWeaponType.find(x_unitType->airWeapon().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/WeaponType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/WeaponType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_maxAirHits_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->maxAirHits(); -} -JNIEXPORT jdouble JNICALL Java_bwapi_UnitType_topSpeed_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->topSpeed(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_acceleration_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->acceleration(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_haltDistance_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->haltDistance(); -} -JNIEXPORT jint JNICALL Java_bwapi_UnitType_turnRadius_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->turnRadius(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_canProduce_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->canProduce(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_canAttack_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->canAttack(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_canMove_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->canMove(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isFlyer_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isFlyer(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_regeneratesHP_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->regeneratesHP(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isSpellcaster_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isSpellcaster(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_hasPermanentCloak_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->hasPermanentCloak(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isInvincible_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isInvincible(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isOrganic_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isOrganic(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isMechanical_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isMechanical(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isRobotic_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isRobotic(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isDetector_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isDetector(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isResourceContainer_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isResourceContainer(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isResourceDepot_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isResourceDepot(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isRefinery_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isRefinery(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isWorker_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isWorker(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_requiresPsi_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->requiresPsi(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_requiresCreep_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->requiresCreep(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isTwoUnitsInOneEgg_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isTwoUnitsInOneEgg(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isBurrowable_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isBurrowable(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isCloakable_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isCloakable(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isBuilding_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isBuilding(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isAddon_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isAddon(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isFlyingBuilding_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isFlyingBuilding(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isNeutral_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isNeutral(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isHero_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isHero(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isPowerup_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isPowerup(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isBeacon_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isBeacon(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isFlagBeacon_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isFlagBeacon(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isSpecialBuilding_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isSpecialBuilding(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isSpell_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isSpell(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_producesCreep_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->producesCreep(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_producesLarva_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->producesLarva(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isMineralField_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isMineralField(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_isCritter_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->isCritter(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_UnitType_canBuildAddon_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -return x_unitType->canBuildAddon(); -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_researchesWhat_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -SetContainer cresult = x_unitType->researchesWhat(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/TechType"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/TechType;"); -for(SetContainer::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const TechType* elem_ptr = tableTechType.find((*it).getID())->second; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwapi_UnitType_upgradesWhat_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitType* x_unitType = (UnitType*)pointer; -SetContainer cresult = x_unitType->upgradesWhat(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/UpgradeType"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/UpgradeType;"); -for(SetContainer::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const UpgradeType* elem_ptr = tableUpgradeType.find((*it).getID())->second; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jstring JNICALL Java_bwapi_UpgradeType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return env->NewStringUTF(x_upgradeType->toString().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_UpgradeType_getRace_1native(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -jlong resptr = (jlong)tableRace.find(x_upgradeType->getRace().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/Race"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/Race;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_mineralPrice_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->mineralPrice(); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_mineralPrice_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint level){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->mineralPrice(level); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_mineralPriceFactor_1native(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->mineralPriceFactor(); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_gasPrice_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->gasPrice(); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_gasPrice_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint level){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->gasPrice(level); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_gasPriceFactor_1native(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->gasPriceFactor(); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_upgradeTime_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->upgradeTime(); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_upgradeTime_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint level){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->upgradeTime(level); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_upgradeTimeFactor_1native(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->upgradeTimeFactor(); -} -JNIEXPORT jint JNICALL Java_bwapi_UpgradeType_maxRepeats_1native(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -return x_upgradeType->maxRepeats(); -} -JNIEXPORT jobject JNICALL Java_bwapi_UpgradeType_whatUpgrades_1native(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_upgradeType->whatUpgrades().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_UpgradeType_whatsRequired_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_upgradeType->whatsRequired().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_UpgradeType_whatsRequired_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint level){ -UpgradeType* x_upgradeType = (UpgradeType*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_upgradeType->whatsRequired(level).getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WalkPosition_isValid(JNIEnv * env, jobject obj){ -WalkPosition x_walkPosition((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -return x_walkPosition.isValid(); -} -JNIEXPORT jobject JNICALL Java_bwapi_WalkPosition_makeValid(JNIEnv * env, jobject obj){ -WalkPosition x_walkPosition((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -WalkPosition cresult = x_walkPosition.makeValid(); -jclass retcls = FindCachedClass(env, "bwapi/WalkPosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jint JNICALL Java_bwapi_WalkPosition_getApproxDistance(JNIEnv * env, jobject obj, jobject p_position){ -WalkPosition x_walkPosition((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -WalkPosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -return x_walkPosition.getApproxDistance(position); -} -JNIEXPORT jdouble JNICALL Java_bwapi_WalkPosition_getLength(JNIEnv * env, jobject obj){ -WalkPosition x_walkPosition((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); -return x_walkPosition.getLength(); -} -JNIEXPORT jstring JNICALL Java_bwapi_WeaponType_toString_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return env->NewStringUTF(x_weaponType->toString().c_str()); -} -JNIEXPORT jobject JNICALL Java_bwapi_WeaponType_getTech_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -jlong resptr = (jlong)tableTechType.find(x_weaponType->getTech().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/TechType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/TechType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_WeaponType_whatUses_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -jlong resptr = (jlong)tableUnitType.find(x_weaponType->whatUses().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UnitType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UnitType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_WeaponType_damageAmount_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->damageAmount(); -} -JNIEXPORT jint JNICALL Java_bwapi_WeaponType_damageBonus_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->damageBonus(); -} -JNIEXPORT jint JNICALL Java_bwapi_WeaponType_damageCooldown_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->damageCooldown(); -} -JNIEXPORT jint JNICALL Java_bwapi_WeaponType_damageFactor_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->damageFactor(); -} -JNIEXPORT jobject JNICALL Java_bwapi_WeaponType_upgradeType_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -jlong resptr = (jlong)tableUpgradeType.find(x_weaponType->upgradeType().getID())->second; -jclass retcls = FindCachedClass(env, "bwapi/UpgradeType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/UpgradeType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_WeaponType_damageType_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -jlong resptr = (jlong)x_weaponType->damageType(); -jclass retcls = FindCachedClass(env, "bwapi/DamageType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/DamageType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwapi_WeaponType_explosionType_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -jlong resptr = (jlong)x_weaponType->explosionType(); -jclass retcls = FindCachedClass(env, "bwapi/ExplosionType"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi/ExplosionType;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwapi_WeaponType_minRange_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->minRange(); -} -JNIEXPORT jint JNICALL Java_bwapi_WeaponType_maxRange_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->maxRange(); -} -JNIEXPORT jint JNICALL Java_bwapi_WeaponType_innerSplashRadius_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->innerSplashRadius(); -} -JNIEXPORT jint JNICALL Java_bwapi_WeaponType_medianSplashRadius_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->medianSplashRadius(); -} -JNIEXPORT jint JNICALL Java_bwapi_WeaponType_outerSplashRadius_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->outerSplashRadius(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WeaponType_targetsAir_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->targetsAir(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WeaponType_targetsGround_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->targetsGround(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WeaponType_targetsMechanical_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->targetsMechanical(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WeaponType_targetsOrganic_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->targetsOrganic(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WeaponType_targetsNonBuilding_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->targetsNonBuilding(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WeaponType_targetsNonRobotic_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->targetsNonRobotic(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WeaponType_targetsTerrain_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->targetsTerrain(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WeaponType_targetsOrgOrMech_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->targetsOrgOrMech(); -} -JNIEXPORT jboolean JNICALL Java_bwapi_WeaponType_targetsOwn_1native(JNIEnv * env, jobject obj, jlong pointer){ -WeaponType* x_weaponType = (WeaponType*)pointer; -return x_weaponType->targetsOwn(); -} -JNIEXPORT jobject JNICALL Java_bwta_BaseLocation_getPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -Position cresult = x_baseLocation->getPosition(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BaseLocation_getTilePosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -TilePosition cresult = x_baseLocation->getTilePosition(); -jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BaseLocation_getRegion_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -jlong resptr = (jlong)x_baseLocation->getRegion(); -jclass retcls = FindCachedClass(env, "bwta/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jint JNICALL Java_bwta_BaseLocation_minerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -return x_baseLocation->minerals(); -} -JNIEXPORT jint JNICALL Java_bwta_BaseLocation_gas_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -return x_baseLocation->gas(); -} -JNIEXPORT jobject JNICALL Java_bwta_BaseLocation_getMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -Unitset cresult = x_baseLocation->getMinerals(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BaseLocation_getStaticMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -Unitset cresult = x_baseLocation->getStaticMinerals(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BaseLocation_getGeysers_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -Unitset cresult = x_baseLocation->getGeysers(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Unit"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi/Unit;"); -for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Unit elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jdouble JNICALL Java_bwta_BaseLocation_getGroundDistance_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_other){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -BWTA::BaseLocation* other = (BWTA::BaseLocation*)env->GetLongField(p_other, FindCachedField(env, env->GetObjectClass(p_other), "pointer", "J")); -return x_baseLocation->getGroundDistance(other); -} -JNIEXPORT jdouble JNICALL Java_bwta_BaseLocation_getAirDistance_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_other){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -BWTA::BaseLocation* other = (BWTA::BaseLocation*)env->GetLongField(p_other, FindCachedField(env, env->GetObjectClass(p_other), "pointer", "J")); -return x_baseLocation->getAirDistance(other); -} -JNIEXPORT jboolean JNICALL Java_bwta_BaseLocation_isIsland_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -return x_baseLocation->isIsland(); -} -JNIEXPORT jboolean JNICALL Java_bwta_BaseLocation_isMineralOnly_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -return x_baseLocation->isMineralOnly(); -} -JNIEXPORT jboolean JNICALL Java_bwta_BaseLocation_isStartLocation_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::BaseLocation* x_baseLocation = (BWTA::BaseLocation*)pointer; -return x_baseLocation->isStartLocation(); -} -JNIEXPORT void JNICALL Java_bwta_BWTA_readMap(JNIEnv * env, jclass jclz){ -BWTA::readMap(); -} -JNIEXPORT void JNICALL Java_bwta_BWTA_analyze(JNIEnv * env, jclass jclz){ -BWTA::analyze(); -} -JNIEXPORT void JNICALL Java_bwta_BWTA_computeDistanceTransform(JNIEnv * env, jclass jclz){ -BWTA::computeDistanceTransform(); -} -JNIEXPORT void JNICALL Java_bwta_BWTA_balanceAnalysis(JNIEnv * env, jclass jclz){ -BWTA::balanceAnalysis(); -} -JNIEXPORT void JNICALL Java_bwta_BWTA_cleanMemory(JNIEnv * env, jclass jclz){ -BWTA::cleanMemory(); -} -JNIEXPORT jint JNICALL Java_bwta_BWTA_getMaxDistanceTransform(JNIEnv * env, jclass jclz){ -return BWTA::getMaxDistanceTransform(); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getRegions(JNIEnv * env, jclass jclz){ -std::set cresult = BWTA::getRegions(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwta/Region"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwta/Region;"); -for(std::set::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const BWTA::Region* elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getChokepoints(JNIEnv * env, jclass jclz){ -std::set cresult = BWTA::getChokepoints(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwta/Chokepoint"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwta/Chokepoint;"); -for(std::set::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const BWTA::Chokepoint* elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getBaseLocations(JNIEnv * env, jclass jclz){ -std::set cresult = BWTA::getBaseLocations(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwta/BaseLocation"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwta/BaseLocation;"); -for(std::set::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const BWTA::BaseLocation* elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getStartLocations(JNIEnv * env, jclass jclz){ -std::set cresult = BWTA::getStartLocations(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwta/BaseLocation"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwta/BaseLocation;"); -for(std::set::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const BWTA::BaseLocation* elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getUnwalkablePolygons(JNIEnv * env, jclass jclz){ -std::set cresult = BWTA::getUnwalkablePolygons(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwta/Polygon"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwta/Polygon;"); -for(std::set::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const BWTA::Polygon* elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getStartLocation(JNIEnv * env, jclass jclz, jobject p_player){ -Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); -jlong resptr = (jlong)BWTA::getStartLocation(player); -jclass retcls = FindCachedClass(env, "bwta/BaseLocation"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/BaseLocation;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getRegion__II(JNIEnv * env, jclass jclz, jint x, jint y){ -jlong resptr = (jlong)BWTA::getRegion(x, y); -jclass retcls = FindCachedClass(env, "bwta/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getRegion__Lbwapi_TilePosition_2(JNIEnv * env, jclass jclz, jobject p_tileposition){ -TilePosition tileposition((int)env->GetIntField(p_tileposition, FindCachedField(env, env->GetObjectClass(p_tileposition), "x", "I")), (int)env->GetIntField(p_tileposition, FindCachedField(env, env->GetObjectClass(p_tileposition), "y", "I"))); -jlong resptr = (jlong)BWTA::getRegion(tileposition); -jclass retcls = FindCachedClass(env, "bwta/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getRegion__Lbwapi_Position_2(JNIEnv * env, jclass jclz, jobject p_position){ -Position position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -jlong resptr = (jlong)BWTA::getRegion(position); -jclass retcls = FindCachedClass(env, "bwta/Region"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Region;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestChokepoint__II(JNIEnv * env, jclass jclz, jint x, jint y){ -jlong resptr = (jlong)BWTA::getNearestChokepoint(x, y); -jclass retcls = FindCachedClass(env, "bwta/Chokepoint"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Chokepoint;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestChokepoint__Lbwapi_TilePosition_2(JNIEnv * env, jclass jclz, jobject p_tileposition){ -TilePosition tileposition((int)env->GetIntField(p_tileposition, FindCachedField(env, env->GetObjectClass(p_tileposition), "x", "I")), (int)env->GetIntField(p_tileposition, FindCachedField(env, env->GetObjectClass(p_tileposition), "y", "I"))); -jlong resptr = (jlong)BWTA::getNearestChokepoint(tileposition); -jclass retcls = FindCachedClass(env, "bwta/Chokepoint"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Chokepoint;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestChokepoint__Lbwapi_Position_2(JNIEnv * env, jclass jclz, jobject p_position){ -Position position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -jlong resptr = (jlong)BWTA::getNearestChokepoint(position); -jclass retcls = FindCachedClass(env, "bwta/Chokepoint"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Chokepoint;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestBaseLocation__II(JNIEnv * env, jclass jclz, jint x, jint y){ -jlong resptr = (jlong)BWTA::getNearestBaseLocation(x, y); -jclass retcls = FindCachedClass(env, "bwta/BaseLocation"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/BaseLocation;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestBaseLocation__Lbwapi_TilePosition_2(JNIEnv * env, jclass jclz, jobject p_tileposition){ -TilePosition tileposition((int)env->GetIntField(p_tileposition, FindCachedField(env, env->GetObjectClass(p_tileposition), "x", "I")), (int)env->GetIntField(p_tileposition, FindCachedField(env, env->GetObjectClass(p_tileposition), "y", "I"))); -jlong resptr = (jlong)BWTA::getNearestBaseLocation(tileposition); -jclass retcls = FindCachedClass(env, "bwta/BaseLocation"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/BaseLocation;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestBaseLocation__Lbwapi_Position_2(JNIEnv * env, jclass jclz, jobject p_position){ -Position position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -jlong resptr = (jlong)BWTA::getNearestBaseLocation(position); -jclass retcls = FindCachedClass(env, "bwta/BaseLocation"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/BaseLocation;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestUnwalkablePolygon__II(JNIEnv * env, jclass jclz, jint x, jint y){ -jlong resptr = (jlong)BWTA::getNearestUnwalkablePolygon(x, y); -jclass retcls = FindCachedClass(env, "bwta/Polygon"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Polygon;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestUnwalkablePolygon__Lbwapi_TilePosition_2(JNIEnv * env, jclass jclz, jobject p_tileposition){ -TilePosition tileposition((int)env->GetIntField(p_tileposition, FindCachedField(env, env->GetObjectClass(p_tileposition), "x", "I")), (int)env->GetIntField(p_tileposition, FindCachedField(env, env->GetObjectClass(p_tileposition), "y", "I"))); -jlong resptr = (jlong)BWTA::getNearestUnwalkablePolygon(tileposition); -jclass retcls = FindCachedClass(env, "bwta/Polygon"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Polygon;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestUnwalkablePosition(JNIEnv * env, jclass jclz, jobject p_position){ -Position position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -Position cresult = BWTA::getNearestUnwalkablePosition(position); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jboolean JNICALL Java_bwta_BWTA_isConnected__IIII(JNIEnv * env, jclass jclz, jint x1, jint y1, jint x2, jint y2){ -return BWTA::isConnected(x1, y1, x2, y2); -} -JNIEXPORT jboolean JNICALL Java_bwta_BWTA_isConnected__Lbwapi_TilePosition_2Lbwapi_TilePosition_2(JNIEnv * env, jclass jclz, jobject p_a, jobject p_b){ -TilePosition a((int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "x", "I")), (int)env->GetIntField(p_a, FindCachedField(env, env->GetObjectClass(p_a), "y", "I"))); -TilePosition b((int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "x", "I")), (int)env->GetIntField(p_b, FindCachedField(env, env->GetObjectClass(p_b), "y", "I"))); -return BWTA::isConnected(a, b); -} -JNIEXPORT jdouble JNICALL Java_bwta_BWTA_getGroundDistance(JNIEnv * env, jclass jclz, jobject p_start, jobject p_end){ -TilePosition start((int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "x", "I")), (int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "y", "I"))); -TilePosition end((int)env->GetIntField(p_end, FindCachedField(env, env->GetObjectClass(p_end), "x", "I")), (int)env->GetIntField(p_end, FindCachedField(env, env->GetObjectClass(p_end), "y", "I"))); -return BWTA::getGroundDistance(start, end); -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getNearestTilePosition(JNIEnv * env, jclass jclz, jobject p_start, jobject p_targets){ -TilePosition start((int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "x", "I")), (int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "y", "I"))); -std::set targets; -jclass colClass = env->GetObjectClass(p_targets); -jmethodID sizeMethodId = FindCachedMethod(env, colClass, "size", "()I"); -jmethodID getMethodId = FindCachedMethod(env, colClass, "get", "(I)Ljava/lang/Object;"); -int size = (int)env->CallIntMethod(p_targets, sizeMethodId); -for( int i = 0; i < size; i++ ) { -jobject p_cObj = env->CallObjectMethod(p_targets,getMethodId); -TilePosition cObj((int)env->GetIntField(p_cObj, FindCachedField(env, env->GetObjectClass(p_cObj), "x", "I")), (int)env->GetIntField(p_cObj, FindCachedField(env, env->GetObjectClass(p_cObj), "y", "I"))); -targets.insert(cObj); -} -std::pair cresult = BWTA::getNearestTilePosition(start, targets); -jclass firstElemClass = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID firstElemConsID = FindCachedMethod(env, firstElemClass, "", "(II)V"); -jclass secondElemClass = FindCachedClass(env, "java/lang/Double"); -jmethodID secondElemConsID = FindCachedMethod(env, secondElemClass, "", "(D)V"); -const TilePosition first_elem_ptr = cresult.first; -jobject first = env->NewObject(firstElemClass, firstElemConsID, first_elem_ptr.x, first_elem_ptr.y); -const double second_elem_ptr = cresult.second; -jobject second = env->NewObject(secondElemClass, secondElemConsID,second_elem_ptr); -jclass retcls = FindCachedClass(env, "bwapi/Pair"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Ljava/lang/Object;Ljava/lang/Object;)V"); -jobject result = env->NewObject(retcls, retConsID, first, second); -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getGroundDistances(JNIEnv * env, jclass jclz, jobject p_start, jobject p_targets){ -TilePosition start((int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "x", "I")), (int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "y", "I"))); -std::set targets; -jclass colClass = env->GetObjectClass(p_targets); -jmethodID sizeMethodId = FindCachedMethod(env, colClass, "size", "()I"); -jmethodID getMethodId = FindCachedMethod(env, colClass, "get", "(I)Ljava/lang/Object;"); -int size = (int)env->CallIntMethod(p_targets, sizeMethodId); -for( int i = 0; i < size; i++ ) { -jobject p_cObj = env->CallObjectMethod(p_targets,getMethodId); -TilePosition cObj((int)env->GetIntField(p_cObj, FindCachedField(env, env->GetObjectClass(p_cObj), "x", "I")), (int)env->GetIntField(p_cObj, FindCachedField(env, env->GetObjectClass(p_cObj), "y", "I"))); -targets.insert(cObj); -} -std::map cresult = BWTA::getGroundDistances(start, targets); -jclass listCls = FindCachedClass(env, "java/util/HashMap"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); -jclass keyElemClass = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID keyElemConsID = FindCachedMethod(env, keyElemClass, "", "(II)V"); -jclass valueElemClass = FindCachedClass(env, "java/lang/Double"); -jmethodID valueElemConsID = FindCachedMethod(env, valueElemClass, "", "(D)V"); -for(std::map::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const TilePosition key_elem_ptr = (it->first); -jobject keyElem = env->NewObject(keyElemClass, keyElemConsID, key_elem_ptr.x, key_elem_ptr.y); -const double value_elem_ptr = (it->second); -jobject valueElem = env->NewObject(valueElemClass, valueElemConsID,value_elem_ptr); -env->CallVoidMethod(result, addMethodID, keyElem, valueElem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getShortestPath__Lbwapi_TilePosition_2Lbwapi_TilePosition_2(JNIEnv * env, jclass jclz, jobject p_start, jobject p_end){ -TilePosition start((int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "x", "I")), (int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "y", "I"))); -TilePosition end((int)env->GetIntField(p_end, FindCachedField(env, env->GetObjectClass(p_end), "x", "I")), (int)env->GetIntField(p_end, FindCachedField(env, env->GetObjectClass(p_end), "y", "I"))); -std::vector cresult = BWTA::getShortestPath(start, end); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID elemConsID = FindCachedMethod(env, elemClass, "", "(II)V"); -for(std::vector::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const TilePosition elem_ptr = *it; -jobject elem = env->NewObject(elemClass, elemConsID, elem_ptr.x, elem_ptr.y); -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_BWTA_getShortestPath__Lbwapi_TilePosition_2Ljava_util_List_2(JNIEnv * env, jclass jclz, jobject p_start, jobject p_targets){ -TilePosition start((int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "x", "I")), (int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "y", "I"))); -std::set targets; -jclass colClass = env->GetObjectClass(p_targets); -jmethodID sizeMethodId = FindCachedMethod(env, colClass, "size", "()I"); -jmethodID getMethodId = FindCachedMethod(env, colClass, "get", "(I)Ljava/lang/Object;"); -int size = (int)env->CallIntMethod(p_targets, sizeMethodId); -for( int i = 0; i < size; i++ ) { -jobject p_cObj = env->CallObjectMethod(p_targets,getMethodId); -TilePosition cObj((int)env->GetIntField(p_cObj, FindCachedField(env, env->GetObjectClass(p_cObj), "x", "I")), (int)env->GetIntField(p_cObj, FindCachedField(env, env->GetObjectClass(p_cObj), "y", "I"))); -targets.insert(cObj); -} -std::vector cresult = BWTA::getShortestPath(start, targets); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/TilePosition"); -jmethodID elemConsID = FindCachedMethod(env, elemClass, "", "(II)V"); -for(std::vector::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const TilePosition elem_ptr = *it; -jobject elem = env->NewObject(elemClass, elemConsID, elem_ptr.x, elem_ptr.y); -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT void JNICALL Java_bwta_BWTA_buildChokeNodes(JNIEnv * env, jclass jclz){ -BWTA::buildChokeNodes(); -} -JNIEXPORT jint JNICALL Java_bwta_BWTA_getGroundDistance2(JNIEnv * env, jclass jclz, jobject p_start, jobject p_end){ -TilePosition start((int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "x", "I")), (int)env->GetIntField(p_start, FindCachedField(env, env->GetObjectClass(p_start), "y", "I"))); -TilePosition end((int)env->GetIntField(p_end, FindCachedField(env, env->GetObjectClass(p_end), "x", "I")), (int)env->GetIntField(p_end, FindCachedField(env, env->GetObjectClass(p_end), "y", "I"))); -return BWTA::getGroundDistance2(start, end); -} -JNIEXPORT jobject JNICALL Java_bwta_Chokepoint_getRegions_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Chokepoint* x_chokepoint = (BWTA::Chokepoint*)pointer; -std::pair cresult = x_chokepoint->getRegions(); -jclass firstElemClass = FindCachedClass(env, "bwta/Region"); -jmethodID firstGetMethodID = FindCachedMethodStatic(env, firstElemClass, "get", "(J)Lbwta/Region;"); -jclass secondElemClass = FindCachedClass(env, "bwta/Region"); -jmethodID secondGetMethodID = FindCachedMethodStatic(env, secondElemClass, "get", "(J)Lbwta/Region;"); -const BWTA::Region* first_elem_ptr = cresult.first; -jobject first = env->CallStaticObjectMethod(firstElemClass, firstGetMethodID, (jlong)first_elem_ptr) ; -const BWTA::Region* second_elem_ptr = cresult.second; -jobject second = env->CallStaticObjectMethod(secondElemClass, secondGetMethodID, (jlong)second_elem_ptr) ; -jclass retcls = FindCachedClass(env, "bwapi/Pair"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Ljava/lang/Object;Ljava/lang/Object;)V"); -jobject result = env->NewObject(retcls, retConsID, first, second); -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_Chokepoint_getSides_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Chokepoint* x_chokepoint = (BWTA::Chokepoint*)pointer; -std::pair cresult = x_chokepoint->getSides(); -jclass firstElemClass = FindCachedClass(env, "bwapi/Position"); -jmethodID firstElemConsID = FindCachedMethod(env, firstElemClass, "", "(II)V"); -jclass secondElemClass = FindCachedClass(env, "bwapi/Position"); -jmethodID secondElemConsID = FindCachedMethod(env, secondElemClass, "", "(II)V"); -const Position first_elem_ptr = cresult.first; -jobject first = env->NewObject(firstElemClass, firstElemConsID, first_elem_ptr.x, first_elem_ptr.y); -const Position second_elem_ptr = cresult.second; -jobject second = env->NewObject(secondElemClass, secondElemConsID, second_elem_ptr.x, second_elem_ptr.y); -jclass retcls = FindCachedClass(env, "bwapi/Pair"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(Ljava/lang/Object;Ljava/lang/Object;)V"); -jobject result = env->NewObject(retcls, retConsID, first, second); -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_Chokepoint_getCenter_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Chokepoint* x_chokepoint = (BWTA::Chokepoint*)pointer; -Position cresult = x_chokepoint->getCenter(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jdouble JNICALL Java_bwta_Chokepoint_getWidth_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Chokepoint* x_chokepoint = (BWTA::Chokepoint*)pointer; -return x_chokepoint->getWidth(); -} -JNIEXPORT jdouble JNICALL Java_bwta_Polygon_getArea_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Polygon* x_polygon = (BWTA::Polygon*)pointer; -return x_polygon->getArea(); -} -JNIEXPORT jdouble JNICALL Java_bwta_Polygon_getPerimeter_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Polygon* x_polygon = (BWTA::Polygon*)pointer; -return x_polygon->getPerimeter(); -} -JNIEXPORT jobject JNICALL Java_bwta_Polygon_getCenter_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Polygon* x_polygon = (BWTA::Polygon*)pointer; -Position cresult = x_polygon->getCenter(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jboolean JNICALL Java_bwta_Polygon_isInside_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_p){ -BWTA::Polygon* x_polygon = (BWTA::Polygon*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -return x_polygon->isInside(p); -} -JNIEXPORT jobject JNICALL Java_bwta_Polygon_getNearestPoint_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_p){ -BWTA::Polygon* x_polygon = (BWTA::Polygon*)pointer; -Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); -Position cresult = x_polygon->getNearestPoint(p); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_Polygon_getHoles_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Polygon* x_polygon = (BWTA::Polygon*)pointer; -std::vector cresult = x_polygon->getHoles(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwta/Polygon"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwta/Polygon;"); -for(std::vector::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const BWTA::Polygon* elem_ptr = &*it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_Polygon_getPoints_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Polygon* x_polygon = (BWTA::Polygon*)pointer; -std::vector cresult = *x_polygon; -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwapi/Position"); -jmethodID elemConsID = FindCachedMethod(env, elemClass, "", "(II)V"); -for(std::vector::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const Position elem_ptr = *it; -jobject elem = env->NewObject(elemClass, elemConsID, elem_ptr.x, elem_ptr.y); -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_Region_getPolygon_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Region* x_region = (BWTA::Region*)pointer; -jlong resptr = (jlong)&x_region->getPolygon(); -jclass retcls = FindCachedClass(env, "bwta/Polygon"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwta/Polygon;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); -} -JNIEXPORT jobject JNICALL Java_bwta_Region_getCenter_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Region* x_region = (BWTA::Region*)pointer; -Position cresult = x_region->getCenter(); -jclass retcls = FindCachedClass(env, "bwapi/Position"); -jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_Region_getChokepoints_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Region* x_region = (BWTA::Region*)pointer; -std::set cresult = x_region->getChokepoints(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwta/Chokepoint"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwta/Chokepoint;"); -for(std::set::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const BWTA::Chokepoint* elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jobject JNICALL Java_bwta_Region_getBaseLocations_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Region* x_region = (BWTA::Region*)pointer; -std::set cresult = x_region->getBaseLocations(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwta/BaseLocation"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwta/BaseLocation;"); -for(std::set::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const BWTA::BaseLocation* elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jboolean JNICALL Java_bwta_Region_isReachable_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_region){ -BWTA::Region* x_region = (BWTA::Region*)pointer; -BWTA::Region* region = (BWTA::Region*)env->GetLongField(p_region, FindCachedField(env, env->GetObjectClass(p_region), "pointer", "J")); -return x_region->isReachable(region); -} -JNIEXPORT jobject JNICALL Java_bwta_Region_getReachableRegions_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Region* x_region = (BWTA::Region*)pointer; -std::set cresult = x_region->getReachableRegions(); -jclass listCls = FindCachedClass(env, "java/util/ArrayList"); -jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); -jobject result = env->NewObject(listCls, listConsID); -jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); -jclass elemClass = FindCachedClass(env, "bwta/Region"); -jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwta/Region;"); -for(std::set::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){ -const BWTA::Region* elem_ptr = *it; -jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; -env->CallVoidMethod(result, addMethodID, elem); -} -return result; -} -JNIEXPORT jint JNICALL Java_bwta_Region_getMaxDistance_1native(JNIEnv * env, jobject obj, jlong pointer){ -BWTA::Region* x_region = (BWTA::Region*)pointer; -return x_region->getMaxDistance(); -} -void reconnect() -{ - while (!BWAPIClient.connect()) { - std::this_thread::sleep_for(std::chrono::milliseconds{ 1000 }); - } -} - - - -void flushPrint(const char * text){ - printf(text); - fflush(stdout); -} - -void println(const char * text){ - printf(text); - flushPrint("\n"); -} - -JNIEXPORT void JNICALL Java_bwapi_Mirror_startGame(JNIEnv * env, jobject obj){ -jclass cls; -jmethodID getId; -jobject cst; -cls = env->FindClass("Lbwapi/BulletType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/BulletType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Melee", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Melee)); -tableBulletType.insert(std::pair(BulletTypes::Melee.getID(), &BulletTypes::Melee)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fusion_Cutter_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Fusion_Cutter_Hit)); -tableBulletType.insert(std::pair(BulletTypes::Fusion_Cutter_Hit.getID(), &BulletTypes::Fusion_Cutter_Hit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gauss_Rifle_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Gauss_Rifle_Hit)); -tableBulletType.insert(std::pair(BulletTypes::Gauss_Rifle_Hit.getID(), &BulletTypes::Gauss_Rifle_Hit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::C_10_Canister_Rifle_Hit)); -tableBulletType.insert(std::pair(BulletTypes::C_10_Canister_Rifle_Hit.getID(), &BulletTypes::C_10_Canister_Rifle_Hit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gemini_Missiles", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Gemini_Missiles)); -tableBulletType.insert(std::pair(BulletTypes::Gemini_Missiles.getID(), &BulletTypes::Gemini_Missiles)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fragmentation_Grenade", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Fragmentation_Grenade)); -tableBulletType.insert(std::pair(BulletTypes::Fragmentation_Grenade.getID(), &BulletTypes::Fragmentation_Grenade)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Longbolt_Missile", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Longbolt_Missile)); -tableBulletType.insert(std::pair(BulletTypes::Longbolt_Missile.getID(), &BulletTypes::Longbolt_Missile)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATS_ATA_Laser_Battery", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::ATS_ATA_Laser_Battery)); -tableBulletType.insert(std::pair(BulletTypes::ATS_ATA_Laser_Battery.getID(), &BulletTypes::ATS_ATA_Laser_Battery)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burst_Lasers", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Burst_Lasers)); -tableBulletType.insert(std::pair(BulletTypes::Burst_Lasers.getID(), &BulletTypes::Burst_Lasers)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Shock_Cannon_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Arclite_Shock_Cannon_Hit)); -tableBulletType.insert(std::pair(BulletTypes::Arclite_Shock_Cannon_Hit.getID(), &BulletTypes::Arclite_Shock_Cannon_Hit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EMP_Missile", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::EMP_Missile)); -tableBulletType.insert(std::pair(BulletTypes::EMP_Missile.getID(), &BulletTypes::EMP_Missile)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dual_Photon_Blasters_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Dual_Photon_Blasters_Hit)); -tableBulletType.insert(std::pair(BulletTypes::Dual_Photon_Blasters_Hit.getID(), &BulletTypes::Dual_Photon_Blasters_Hit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Particle_Beam_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Particle_Beam_Hit)); -tableBulletType.insert(std::pair(BulletTypes::Particle_Beam_Hit.getID(), &BulletTypes::Particle_Beam_Hit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anti_Matter_Missile", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Anti_Matter_Missile)); -tableBulletType.insert(std::pair(BulletTypes::Anti_Matter_Missile.getID(), &BulletTypes::Anti_Matter_Missile)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Pulse_Cannon", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Pulse_Cannon)); -tableBulletType.insert(std::pair(BulletTypes::Pulse_Cannon.getID(), &BulletTypes::Pulse_Cannon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Shockwave_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Psionic_Shockwave_Hit)); -tableBulletType.insert(std::pair(BulletTypes::Psionic_Shockwave_Hit.getID(), &BulletTypes::Psionic_Shockwave_Hit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Storm", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Psionic_Storm)); -tableBulletType.insert(std::pair(BulletTypes::Psionic_Storm.getID(), &BulletTypes::Psionic_Storm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Yamato_Gun", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Yamato_Gun)); -tableBulletType.insert(std::pair(BulletTypes::Yamato_Gun.getID(), &BulletTypes::Yamato_Gun)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Phase_Disruptor)); -tableBulletType.insert(std::pair(BulletTypes::Phase_Disruptor.getID(), &BulletTypes::Phase_Disruptor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "STA_STS_Cannon_Overlay", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::STA_STS_Cannon_Overlay)); -tableBulletType.insert(std::pair(BulletTypes::STA_STS_Cannon_Overlay.getID(), &BulletTypes::STA_STS_Cannon_Overlay)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Sunken_Colony_Tentacle", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Sunken_Colony_Tentacle)); -tableBulletType.insert(std::pair(BulletTypes::Sunken_Colony_Tentacle.getID(), &BulletTypes::Sunken_Colony_Tentacle)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Acid_Spore", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Acid_Spore)); -tableBulletType.insert(std::pair(BulletTypes::Acid_Spore.getID(), &BulletTypes::Acid_Spore)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Glave_Wurm", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Glave_Wurm)); -tableBulletType.insert(std::pair(BulletTypes::Glave_Wurm.getID(), &BulletTypes::Glave_Wurm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Seeker_Spores", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Seeker_Spores)); -tableBulletType.insert(std::pair(BulletTypes::Seeker_Spores.getID(), &BulletTypes::Seeker_Spores)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Queen_Spell_Carrier", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Queen_Spell_Carrier)); -tableBulletType.insert(std::pair(BulletTypes::Queen_Spell_Carrier.getID(), &BulletTypes::Queen_Spell_Carrier)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Plague_Cloud", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Plague_Cloud)); -tableBulletType.insert(std::pair(BulletTypes::Plague_Cloud.getID(), &BulletTypes::Plague_Cloud)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Consume", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Consume)); -tableBulletType.insert(std::pair(BulletTypes::Consume.getID(), &BulletTypes::Consume)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ensnare", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Ensnare)); -tableBulletType.insert(std::pair(BulletTypes::Ensnare.getID(), &BulletTypes::Ensnare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Needle_Spine_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Needle_Spine_Hit)); -tableBulletType.insert(std::pair(BulletTypes::Needle_Spine_Hit.getID(), &BulletTypes::Needle_Spine_Hit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Invisible", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Invisible)); -tableBulletType.insert(std::pair(BulletTypes::Invisible.getID(), &BulletTypes::Invisible)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Optical_Flare_Grenade", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Optical_Flare_Grenade)); -tableBulletType.insert(std::pair(BulletTypes::Optical_Flare_Grenade.getID(), &BulletTypes::Optical_Flare_Grenade)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Halo_Rockets", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Halo_Rockets)); -tableBulletType.insert(std::pair(BulletTypes::Halo_Rockets.getID(), &BulletTypes::Halo_Rockets)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Subterranean_Spines", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Subterranean_Spines)); -tableBulletType.insert(std::pair(BulletTypes::Subterranean_Spines.getID(), &BulletTypes::Subterranean_Spines)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Corrosive_Acid_Shot", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Corrosive_Acid_Shot)); -tableBulletType.insert(std::pair(BulletTypes::Corrosive_Acid_Shot.getID(), &BulletTypes::Corrosive_Acid_Shot)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Neutron_Flare", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Neutron_Flare)); -tableBulletType.insert(std::pair(BulletTypes::Neutron_Flare.getID(), &BulletTypes::Neutron_Flare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::None)); -tableBulletType.insert(std::pair(BulletTypes::None.getID(), &BulletTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Unknown)); -tableBulletType.insert(std::pair(BulletTypes::Unknown.getID(), &BulletTypes::Unknown)); -cls = env->FindClass("Lbwapi/Color;"); -getId = env->GetMethodID(cls,"", "(III)V"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Red", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Red.red(), Colors::Red.green(), Colors::Red.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Blue", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Blue.red(), Colors::Blue.green(), Colors::Blue.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Teal", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Teal.red(), Colors::Teal.green(), Colors::Teal.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Purple", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Purple.red(), Colors::Purple.green(), Colors::Purple.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Orange", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Orange.red(), Colors::Orange.green(), Colors::Orange.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Brown", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Brown.red(), Colors::Brown.green(), Colors::Brown.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "White", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::White.red(), Colors::White.green(), Colors::White.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Yellow", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Yellow.red(), Colors::Yellow.green(), Colors::Yellow.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Green", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Green.red(), Colors::Green.green(), Colors::Green.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cyan", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Cyan.red(), Colors::Cyan.green(), Colors::Cyan.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Black", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Black.red(), Colors::Black.green(), Colors::Black.blue())); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Grey", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Grey.red(), Colors::Grey.green(), Colors::Grey.blue())); -cls = env->FindClass("Lbwapi/DamageType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/DamageType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Independent", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Independent)); -tableDamageType.insert(std::pair(DamageTypes::Independent.getID(), &DamageTypes::Independent)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Explosive", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Explosive)); -tableDamageType.insert(std::pair(DamageTypes::Explosive.getID(), &DamageTypes::Explosive)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Concussive", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Concussive)); -tableDamageType.insert(std::pair(DamageTypes::Concussive.getID(), &DamageTypes::Concussive)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Normal", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Normal)); -tableDamageType.insert(std::pair(DamageTypes::Normal.getID(), &DamageTypes::Normal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ignore_Armor", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Ignore_Armor)); -tableDamageType.insert(std::pair(DamageTypes::Ignore_Armor.getID(), &DamageTypes::Ignore_Armor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::None)); -tableDamageType.insert(std::pair(DamageTypes::None.getID(), &DamageTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Unknown)); -tableDamageType.insert(std::pair(DamageTypes::Unknown.getID(), &DamageTypes::Unknown)); -cls = env->FindClass("Lbwapi/Error;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/Error;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unit_Does_Not_Exist", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unit_Does_Not_Exist)); -tableError.insert(std::pair(Errors::Unit_Does_Not_Exist.getID(), &Errors::Unit_Does_Not_Exist)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unit_Not_Visible", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unit_Not_Visible)); -tableError.insert(std::pair(Errors::Unit_Not_Visible.getID(), &Errors::Unit_Not_Visible)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unit_Not_Owned", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unit_Not_Owned)); -tableError.insert(std::pair(Errors::Unit_Not_Owned.getID(), &Errors::Unit_Not_Owned)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unit_Busy", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unit_Busy)); -tableError.insert(std::pair(Errors::Unit_Busy.getID(), &Errors::Unit_Busy)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Incompatible_UnitType", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Incompatible_UnitType)); -tableError.insert(std::pair(Errors::Incompatible_UnitType.getID(), &Errors::Incompatible_UnitType)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Incompatible_TechType", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Incompatible_TechType)); -tableError.insert(std::pair(Errors::Incompatible_TechType.getID(), &Errors::Incompatible_TechType)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Incompatible_State", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Incompatible_State)); -tableError.insert(std::pair(Errors::Incompatible_State.getID(), &Errors::Incompatible_State)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Already_Researched", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Already_Researched)); -tableError.insert(std::pair(Errors::Already_Researched.getID(), &Errors::Already_Researched)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fully_Upgraded", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Fully_Upgraded)); -tableError.insert(std::pair(Errors::Fully_Upgraded.getID(), &Errors::Fully_Upgraded)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Currently_Researching", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Currently_Researching)); -tableError.insert(std::pair(Errors::Currently_Researching.getID(), &Errors::Currently_Researching)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Currently_Upgrading", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Currently_Upgrading)); -tableError.insert(std::pair(Errors::Currently_Upgrading.getID(), &Errors::Currently_Upgrading)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Minerals", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Minerals)); -tableError.insert(std::pair(Errors::Insufficient_Minerals.getID(), &Errors::Insufficient_Minerals)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Gas", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Gas)); -tableError.insert(std::pair(Errors::Insufficient_Gas.getID(), &Errors::Insufficient_Gas)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Supply", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Supply)); -tableError.insert(std::pair(Errors::Insufficient_Supply.getID(), &Errors::Insufficient_Supply)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Energy", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Energy)); -tableError.insert(std::pair(Errors::Insufficient_Energy.getID(), &Errors::Insufficient_Energy)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Tech", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Tech)); -tableError.insert(std::pair(Errors::Insufficient_Tech.getID(), &Errors::Insufficient_Tech)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Ammo", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Ammo)); -tableError.insert(std::pair(Errors::Insufficient_Ammo.getID(), &Errors::Insufficient_Ammo)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Space", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Space)); -tableError.insert(std::pair(Errors::Insufficient_Space.getID(), &Errors::Insufficient_Space)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Invalid_Tile_Position", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Invalid_Tile_Position)); -tableError.insert(std::pair(Errors::Invalid_Tile_Position.getID(), &Errors::Invalid_Tile_Position)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unbuildable_Location", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unbuildable_Location)); -tableError.insert(std::pair(Errors::Unbuildable_Location.getID(), &Errors::Unbuildable_Location)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unreachable_Location", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unreachable_Location)); -tableError.insert(std::pair(Errors::Unreachable_Location.getID(), &Errors::Unreachable_Location)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Out_Of_Range", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Out_Of_Range)); -tableError.insert(std::pair(Errors::Out_Of_Range.getID(), &Errors::Out_Of_Range)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unable_To_Hit", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unable_To_Hit)); -tableError.insert(std::pair(Errors::Unable_To_Hit.getID(), &Errors::Unable_To_Hit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Access_Denied", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Access_Denied)); -tableError.insert(std::pair(Errors::Access_Denied.getID(), &Errors::Access_Denied)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "File_Not_Found", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::File_Not_Found)); -tableError.insert(std::pair(Errors::File_Not_Found.getID(), &Errors::File_Not_Found)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Invalid_Parameter", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Invalid_Parameter)); -tableError.insert(std::pair(Errors::Invalid_Parameter.getID(), &Errors::Invalid_Parameter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::None)); -tableError.insert(std::pair(Errors::None.getID(), &Errors::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unknown)); -tableError.insert(std::pair(Errors::Unknown.getID(), &Errors::Unknown)); -cls = env->FindClass("Lbwapi/ExplosionType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/ExplosionType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::None)); -tableExplosionType.insert(std::pair(ExplosionTypes::None.getID(), &ExplosionTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Normal", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Normal)); -tableExplosionType.insert(std::pair(ExplosionTypes::Normal.getID(), &ExplosionTypes::Normal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Radial_Splash", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Radial_Splash)); -tableExplosionType.insert(std::pair(ExplosionTypes::Radial_Splash.getID(), &ExplosionTypes::Radial_Splash)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Enemy_Splash", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Enemy_Splash)); -tableExplosionType.insert(std::pair(ExplosionTypes::Enemy_Splash.getID(), &ExplosionTypes::Enemy_Splash)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lockdown", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Lockdown)); -tableExplosionType.insert(std::pair(ExplosionTypes::Lockdown.getID(), &ExplosionTypes::Lockdown)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Nuclear_Missile", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Nuclear_Missile)); -tableExplosionType.insert(std::pair(ExplosionTypes::Nuclear_Missile.getID(), &ExplosionTypes::Nuclear_Missile)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Parasite", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Parasite)); -tableExplosionType.insert(std::pair(ExplosionTypes::Parasite.getID(), &ExplosionTypes::Parasite)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Broodlings", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Broodlings)); -tableExplosionType.insert(std::pair(ExplosionTypes::Broodlings.getID(), &ExplosionTypes::Broodlings)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EMP_Shockwave", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::EMP_Shockwave)); -tableExplosionType.insert(std::pair(ExplosionTypes::EMP_Shockwave.getID(), &ExplosionTypes::EMP_Shockwave)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Irradiate", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Irradiate)); -tableExplosionType.insert(std::pair(ExplosionTypes::Irradiate.getID(), &ExplosionTypes::Irradiate)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ensnare", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Ensnare)); -tableExplosionType.insert(std::pair(ExplosionTypes::Ensnare.getID(), &ExplosionTypes::Ensnare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Plague", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Plague)); -tableExplosionType.insert(std::pair(ExplosionTypes::Plague.getID(), &ExplosionTypes::Plague)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stasis_Field", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Stasis_Field)); -tableExplosionType.insert(std::pair(ExplosionTypes::Stasis_Field.getID(), &ExplosionTypes::Stasis_Field)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dark_Swarm", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Dark_Swarm)); -tableExplosionType.insert(std::pair(ExplosionTypes::Dark_Swarm.getID(), &ExplosionTypes::Dark_Swarm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Consume", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Consume)); -tableExplosionType.insert(std::pair(ExplosionTypes::Consume.getID(), &ExplosionTypes::Consume)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Yamato_Gun", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Yamato_Gun)); -tableExplosionType.insert(std::pair(ExplosionTypes::Yamato_Gun.getID(), &ExplosionTypes::Yamato_Gun)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Restoration", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Restoration)); -tableExplosionType.insert(std::pair(ExplosionTypes::Restoration.getID(), &ExplosionTypes::Restoration)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Disruption_Web", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Disruption_Web)); -tableExplosionType.insert(std::pair(ExplosionTypes::Disruption_Web.getID(), &ExplosionTypes::Disruption_Web)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Corrosive_Acid", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Corrosive_Acid)); -tableExplosionType.insert(std::pair(ExplosionTypes::Corrosive_Acid.getID(), &ExplosionTypes::Corrosive_Acid)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Mind_Control", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Mind_Control)); -tableExplosionType.insert(std::pair(ExplosionTypes::Mind_Control.getID(), &ExplosionTypes::Mind_Control)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Feedback", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Feedback)); -tableExplosionType.insert(std::pair(ExplosionTypes::Feedback.getID(), &ExplosionTypes::Feedback)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Optical_Flare", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Optical_Flare)); -tableExplosionType.insert(std::pair(ExplosionTypes::Optical_Flare.getID(), &ExplosionTypes::Optical_Flare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Maelstrom", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Maelstrom)); -tableExplosionType.insert(std::pair(ExplosionTypes::Maelstrom.getID(), &ExplosionTypes::Maelstrom)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Air_Splash", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Air_Splash)); -tableExplosionType.insert(std::pair(ExplosionTypes::Air_Splash.getID(), &ExplosionTypes::Air_Splash)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Unknown)); -tableExplosionType.insert(std::pair(ExplosionTypes::Unknown.getID(), &ExplosionTypes::Unknown)); -cls = env->FindClass("Lbwapi/GameType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/GameType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Melee", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Melee)); -tableGameType.insert(std::pair(GameTypes::Melee.getID(), &GameTypes::Melee)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Free_For_All", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Free_For_All)); -tableGameType.insert(std::pair(GameTypes::Free_For_All.getID(), &GameTypes::Free_For_All)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "One_on_One", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::One_on_One)); -tableGameType.insert(std::pair(GameTypes::One_on_One.getID(), &GameTypes::One_on_One)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Capture_The_Flag", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Capture_The_Flag)); -tableGameType.insert(std::pair(GameTypes::Capture_The_Flag.getID(), &GameTypes::Capture_The_Flag)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Greed", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Greed)); -tableGameType.insert(std::pair(GameTypes::Greed.getID(), &GameTypes::Greed)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Slaughter", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Slaughter)); -tableGameType.insert(std::pair(GameTypes::Slaughter.getID(), &GameTypes::Slaughter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Sudden_Death", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Sudden_Death)); -tableGameType.insert(std::pair(GameTypes::Sudden_Death.getID(), &GameTypes::Sudden_Death)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ladder", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Ladder)); -tableGameType.insert(std::pair(GameTypes::Ladder.getID(), &GameTypes::Ladder)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Use_Map_Settings", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Use_Map_Settings)); -tableGameType.insert(std::pair(GameTypes::Use_Map_Settings.getID(), &GameTypes::Use_Map_Settings)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Team_Melee", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Team_Melee)); -tableGameType.insert(std::pair(GameTypes::Team_Melee.getID(), &GameTypes::Team_Melee)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Team_Free_For_All", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Team_Free_For_All)); -tableGameType.insert(std::pair(GameTypes::Team_Free_For_All.getID(), &GameTypes::Team_Free_For_All)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Team_Capture_The_Flag", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Team_Capture_The_Flag)); -tableGameType.insert(std::pair(GameTypes::Team_Capture_The_Flag.getID(), &GameTypes::Team_Capture_The_Flag)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Top_vs_Bottom", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Top_vs_Bottom)); -tableGameType.insert(std::pair(GameTypes::Top_vs_Bottom.getID(), &GameTypes::Top_vs_Bottom)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::None)); -tableGameType.insert(std::pair(GameTypes::None.getID(), &GameTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Unknown)); -tableGameType.insert(std::pair(GameTypes::Unknown.getID(), &GameTypes::Unknown)); -cls = env->FindClass("Lbwapi/Order;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/Order;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Die", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Die)); -tableOrder.insert(std::pair(Orders::Die.getID(), &Orders::Die)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stop", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Stop)); -tableOrder.insert(std::pair(Orders::Stop.getID(), &Orders::Stop)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Guard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Guard)); -tableOrder.insert(std::pair(Orders::Guard.getID(), &Orders::Guard)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlayerGuard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PlayerGuard)); -tableOrder.insert(std::pair(Orders::PlayerGuard.getID(), &Orders::PlayerGuard)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "TurretGuard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::TurretGuard)); -tableOrder.insert(std::pair(Orders::TurretGuard.getID(), &Orders::TurretGuard)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BunkerGuard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BunkerGuard)); -tableOrder.insert(std::pair(Orders::BunkerGuard.getID(), &Orders::BunkerGuard)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Move", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Move)); -tableOrder.insert(std::pair(Orders::Move.getID(), &Orders::Move)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AttackUnit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AttackUnit)); -tableOrder.insert(std::pair(Orders::AttackUnit.getID(), &Orders::AttackUnit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AttackTile", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AttackTile)); -tableOrder.insert(std::pair(Orders::AttackTile.getID(), &Orders::AttackTile)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hover", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Hover)); -tableOrder.insert(std::pair(Orders::Hover.getID(), &Orders::Hover)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AttackMove", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AttackMove)); -tableOrder.insert(std::pair(Orders::AttackMove.getID(), &Orders::AttackMove)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InfestedCommandCenter", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InfestedCommandCenter)); -tableOrder.insert(std::pair(Orders::InfestedCommandCenter.getID(), &Orders::InfestedCommandCenter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "UnusedNothing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::UnusedNothing)); -tableOrder.insert(std::pair(Orders::UnusedNothing.getID(), &Orders::UnusedNothing)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "UnusedPowerup", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::UnusedPowerup)); -tableOrder.insert(std::pair(Orders::UnusedPowerup.getID(), &Orders::UnusedPowerup)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "TowerGuard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::TowerGuard)); -tableOrder.insert(std::pair(Orders::TowerGuard.getID(), &Orders::TowerGuard)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "VultureMine", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::VultureMine)); -tableOrder.insert(std::pair(Orders::VultureMine.getID(), &Orders::VultureMine)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Nothing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Nothing)); -tableOrder.insert(std::pair(Orders::Nothing.getID(), &Orders::Nothing)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastInfestation", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastInfestation)); -tableOrder.insert(std::pair(Orders::CastInfestation.getID(), &Orders::CastInfestation)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InfestingCommandCenter", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InfestingCommandCenter)); -tableOrder.insert(std::pair(Orders::InfestingCommandCenter.getID(), &Orders::InfestingCommandCenter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlaceBuilding", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PlaceBuilding)); -tableOrder.insert(std::pair(Orders::PlaceBuilding.getID(), &Orders::PlaceBuilding)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CreateProtossBuilding", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CreateProtossBuilding)); -tableOrder.insert(std::pair(Orders::CreateProtossBuilding.getID(), &Orders::CreateProtossBuilding)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ConstructingBuilding", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ConstructingBuilding)); -tableOrder.insert(std::pair(Orders::ConstructingBuilding.getID(), &Orders::ConstructingBuilding)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Repair", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Repair)); -tableOrder.insert(std::pair(Orders::Repair.getID(), &Orders::Repair)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlaceAddon", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PlaceAddon)); -tableOrder.insert(std::pair(Orders::PlaceAddon.getID(), &Orders::PlaceAddon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BuildAddon", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BuildAddon)); -tableOrder.insert(std::pair(Orders::BuildAddon.getID(), &Orders::BuildAddon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Train", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Train)); -tableOrder.insert(std::pair(Orders::Train.getID(), &Orders::Train)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RallyPointUnit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RallyPointUnit)); -tableOrder.insert(std::pair(Orders::RallyPointUnit.getID(), &Orders::RallyPointUnit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RallyPointTile", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RallyPointTile)); -tableOrder.insert(std::pair(Orders::RallyPointTile.getID(), &Orders::RallyPointTile)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ZergBirth", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ZergBirth)); -tableOrder.insert(std::pair(Orders::ZergBirth.getID(), &Orders::ZergBirth)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ZergUnitMorph", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ZergUnitMorph)); -tableOrder.insert(std::pair(Orders::ZergUnitMorph.getID(), &Orders::ZergUnitMorph)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ZergBuildingMorph", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ZergBuildingMorph)); -tableOrder.insert(std::pair(Orders::ZergBuildingMorph.getID(), &Orders::ZergBuildingMorph)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "IncompleteBuilding", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::IncompleteBuilding)); -tableOrder.insert(std::pair(Orders::IncompleteBuilding.getID(), &Orders::IncompleteBuilding)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BuildNydusExit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BuildNydusExit)); -tableOrder.insert(std::pair(Orders::BuildNydusExit.getID(), &Orders::BuildNydusExit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EnterNydusCanal", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::EnterNydusCanal)); -tableOrder.insert(std::pair(Orders::EnterNydusCanal.getID(), &Orders::EnterNydusCanal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Follow", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Follow)); -tableOrder.insert(std::pair(Orders::Follow.getID(), &Orders::Follow)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Carrier", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Carrier)); -tableOrder.insert(std::pair(Orders::Carrier.getID(), &Orders::Carrier)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ReaverCarrierMove", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ReaverCarrierMove)); -tableOrder.insert(std::pair(Orders::ReaverCarrierMove.getID(), &Orders::ReaverCarrierMove)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CarrierIgnore2", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CarrierIgnore2)); -tableOrder.insert(std::pair(Orders::CarrierIgnore2.getID(), &Orders::CarrierIgnore2)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Reaver", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Reaver)); -tableOrder.insert(std::pair(Orders::Reaver.getID(), &Orders::Reaver)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "TrainFighter", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::TrainFighter)); -tableOrder.insert(std::pair(Orders::TrainFighter.getID(), &Orders::TrainFighter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InterceptorAttack", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InterceptorAttack)); -tableOrder.insert(std::pair(Orders::InterceptorAttack.getID(), &Orders::InterceptorAttack)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ScarabAttack", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ScarabAttack)); -tableOrder.insert(std::pair(Orders::ScarabAttack.getID(), &Orders::ScarabAttack)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RechargeShieldsUnit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RechargeShieldsUnit)); -tableOrder.insert(std::pair(Orders::RechargeShieldsUnit.getID(), &Orders::RechargeShieldsUnit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RechargeShieldsBattery", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RechargeShieldsBattery)); -tableOrder.insert(std::pair(Orders::RechargeShieldsBattery.getID(), &Orders::RechargeShieldsBattery)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ShieldBattery", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ShieldBattery)); -tableOrder.insert(std::pair(Orders::ShieldBattery.getID(), &Orders::ShieldBattery)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InterceptorReturn", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InterceptorReturn)); -tableOrder.insert(std::pair(Orders::InterceptorReturn.getID(), &Orders::InterceptorReturn)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BuildingLand", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BuildingLand)); -tableOrder.insert(std::pair(Orders::BuildingLand.getID(), &Orders::BuildingLand)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BuildingLiftOff", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BuildingLiftOff)); -tableOrder.insert(std::pair(Orders::BuildingLiftOff.getID(), &Orders::BuildingLiftOff)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "DroneLiftOff", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::DroneLiftOff)); -tableOrder.insert(std::pair(Orders::DroneLiftOff.getID(), &Orders::DroneLiftOff)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "LiftingOff", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::LiftingOff)); -tableOrder.insert(std::pair(Orders::LiftingOff.getID(), &Orders::LiftingOff)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ResearchTech", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ResearchTech)); -tableOrder.insert(std::pair(Orders::ResearchTech.getID(), &Orders::ResearchTech)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Upgrade", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Upgrade)); -tableOrder.insert(std::pair(Orders::Upgrade.getID(), &Orders::Upgrade)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Larva", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Larva)); -tableOrder.insert(std::pair(Orders::Larva.getID(), &Orders::Larva)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "SpawningLarva", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::SpawningLarva)); -tableOrder.insert(std::pair(Orders::SpawningLarva.getID(), &Orders::SpawningLarva)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Harvest1", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Harvest1)); -tableOrder.insert(std::pair(Orders::Harvest1.getID(), &Orders::Harvest1)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Harvest2", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Harvest2)); -tableOrder.insert(std::pair(Orders::Harvest2.getID(), &Orders::Harvest2)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MoveToGas", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MoveToGas)); -tableOrder.insert(std::pair(Orders::MoveToGas.getID(), &Orders::MoveToGas)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "WaitForGas", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::WaitForGas)); -tableOrder.insert(std::pair(Orders::WaitForGas.getID(), &Orders::WaitForGas)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HarvestGas", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HarvestGas)); -tableOrder.insert(std::pair(Orders::HarvestGas.getID(), &Orders::HarvestGas)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ReturnGas", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ReturnGas)); -tableOrder.insert(std::pair(Orders::ReturnGas.getID(), &Orders::ReturnGas)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MoveToMinerals", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MoveToMinerals)); -tableOrder.insert(std::pair(Orders::MoveToMinerals.getID(), &Orders::MoveToMinerals)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "WaitForMinerals", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::WaitForMinerals)); -tableOrder.insert(std::pair(Orders::WaitForMinerals.getID(), &Orders::WaitForMinerals)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MiningMinerals", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MiningMinerals)); -tableOrder.insert(std::pair(Orders::MiningMinerals.getID(), &Orders::MiningMinerals)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Harvest3", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Harvest3)); -tableOrder.insert(std::pair(Orders::Harvest3.getID(), &Orders::Harvest3)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Harvest4", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Harvest4)); -tableOrder.insert(std::pair(Orders::Harvest4.getID(), &Orders::Harvest4)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ReturnMinerals", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ReturnMinerals)); -tableOrder.insert(std::pair(Orders::ReturnMinerals.getID(), &Orders::ReturnMinerals)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Interrupted", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Interrupted)); -tableOrder.insert(std::pair(Orders::Interrupted.getID(), &Orders::Interrupted)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EnterTransport", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::EnterTransport)); -tableOrder.insert(std::pair(Orders::EnterTransport.getID(), &Orders::EnterTransport)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PickupIdle", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PickupIdle)); -tableOrder.insert(std::pair(Orders::PickupIdle.getID(), &Orders::PickupIdle)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PickupTransport", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PickupTransport)); -tableOrder.insert(std::pair(Orders::PickupTransport.getID(), &Orders::PickupTransport)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PickupBunker", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PickupBunker)); -tableOrder.insert(std::pair(Orders::PickupBunker.getID(), &Orders::PickupBunker)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Pickup4", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Pickup4)); -tableOrder.insert(std::pair(Orders::Pickup4.getID(), &Orders::Pickup4)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PowerupIdle", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PowerupIdle)); -tableOrder.insert(std::pair(Orders::PowerupIdle.getID(), &Orders::PowerupIdle)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Sieging", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Sieging)); -tableOrder.insert(std::pair(Orders::Sieging.getID(), &Orders::Sieging)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unsieging", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Unsieging)); -tableOrder.insert(std::pair(Orders::Unsieging.getID(), &Orders::Unsieging)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InitCreepGrowth", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InitCreepGrowth)); -tableOrder.insert(std::pair(Orders::InitCreepGrowth.getID(), &Orders::InitCreepGrowth)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "SpreadCreep", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::SpreadCreep)); -tableOrder.insert(std::pair(Orders::SpreadCreep.getID(), &Orders::SpreadCreep)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "StoppingCreepGrowth", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::StoppingCreepGrowth)); -tableOrder.insert(std::pair(Orders::StoppingCreepGrowth.getID(), &Orders::StoppingCreepGrowth)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "GuardianAspect", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::GuardianAspect)); -tableOrder.insert(std::pair(Orders::GuardianAspect.getID(), &Orders::GuardianAspect)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ArchonWarp", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ArchonWarp)); -tableOrder.insert(std::pair(Orders::ArchonWarp.getID(), &Orders::ArchonWarp)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CompletingArchonSummon", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CompletingArchonSummon)); -tableOrder.insert(std::pair(Orders::CompletingArchonSummon.getID(), &Orders::CompletingArchonSummon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HoldPosition", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HoldPosition)); -tableOrder.insert(std::pair(Orders::HoldPosition.getID(), &Orders::HoldPosition)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cloak", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Cloak)); -tableOrder.insert(std::pair(Orders::Cloak.getID(), &Orders::Cloak)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Decloak", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Decloak)); -tableOrder.insert(std::pair(Orders::Decloak.getID(), &Orders::Decloak)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unload", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Unload)); -tableOrder.insert(std::pair(Orders::Unload.getID(), &Orders::Unload)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MoveUnload", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MoveUnload)); -tableOrder.insert(std::pair(Orders::MoveUnload.getID(), &Orders::MoveUnload)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "FireYamatoGun", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::FireYamatoGun)); -tableOrder.insert(std::pair(Orders::FireYamatoGun.getID(), &Orders::FireYamatoGun)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastLockdown", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastLockdown)); -tableOrder.insert(std::pair(Orders::CastLockdown.getID(), &Orders::CastLockdown)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burrowing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Burrowing)); -tableOrder.insert(std::pair(Orders::Burrowing.getID(), &Orders::Burrowing)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burrowed", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Burrowed)); -tableOrder.insert(std::pair(Orders::Burrowed.getID(), &Orders::Burrowed)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unburrowing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Unburrowing)); -tableOrder.insert(std::pair(Orders::Unburrowing.getID(), &Orders::Unburrowing)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastDarkSwarm", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastDarkSwarm)); -tableOrder.insert(std::pair(Orders::CastDarkSwarm.getID(), &Orders::CastDarkSwarm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastParasite", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastParasite)); -tableOrder.insert(std::pair(Orders::CastParasite.getID(), &Orders::CastParasite)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastSpawnBroodlings", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastSpawnBroodlings)); -tableOrder.insert(std::pair(Orders::CastSpawnBroodlings.getID(), &Orders::CastSpawnBroodlings)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastEMPShockwave", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastEMPShockwave)); -tableOrder.insert(std::pair(Orders::CastEMPShockwave.getID(), &Orders::CastEMPShockwave)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeWait", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeWait)); -tableOrder.insert(std::pair(Orders::NukeWait.getID(), &Orders::NukeWait)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeTrain", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeTrain)); -tableOrder.insert(std::pair(Orders::NukeTrain.getID(), &Orders::NukeTrain)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeLaunch", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeLaunch)); -tableOrder.insert(std::pair(Orders::NukeLaunch.getID(), &Orders::NukeLaunch)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukePaint", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukePaint)); -tableOrder.insert(std::pair(Orders::NukePaint.getID(), &Orders::NukePaint)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeUnit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeUnit)); -tableOrder.insert(std::pair(Orders::NukeUnit.getID(), &Orders::NukeUnit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastNuclearStrike", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastNuclearStrike)); -tableOrder.insert(std::pair(Orders::CastNuclearStrike.getID(), &Orders::CastNuclearStrike)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeTrack", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeTrack)); -tableOrder.insert(std::pair(Orders::NukeTrack.getID(), &Orders::NukeTrack)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CloakNearbyUnits", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CloakNearbyUnits)); -tableOrder.insert(std::pair(Orders::CloakNearbyUnits.getID(), &Orders::CloakNearbyUnits)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlaceMine", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PlaceMine)); -tableOrder.insert(std::pair(Orders::PlaceMine.getID(), &Orders::PlaceMine)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RightClickAction", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RightClickAction)); -tableOrder.insert(std::pair(Orders::RightClickAction.getID(), &Orders::RightClickAction)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastRecall", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastRecall)); -tableOrder.insert(std::pair(Orders::CastRecall.getID(), &Orders::CastRecall)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Teleport", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Teleport)); -tableOrder.insert(std::pair(Orders::Teleport.getID(), &Orders::Teleport)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastScannerSweep", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastScannerSweep)); -tableOrder.insert(std::pair(Orders::CastScannerSweep.getID(), &Orders::CastScannerSweep)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Scanner", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Scanner)); -tableOrder.insert(std::pair(Orders::Scanner.getID(), &Orders::Scanner)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastDefensiveMatrix", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastDefensiveMatrix)); -tableOrder.insert(std::pair(Orders::CastDefensiveMatrix.getID(), &Orders::CastDefensiveMatrix)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastPsionicStorm", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastPsionicStorm)); -tableOrder.insert(std::pair(Orders::CastPsionicStorm.getID(), &Orders::CastPsionicStorm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastIrradiate", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastIrradiate)); -tableOrder.insert(std::pair(Orders::CastIrradiate.getID(), &Orders::CastIrradiate)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastPlague", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastPlague)); -tableOrder.insert(std::pair(Orders::CastPlague.getID(), &Orders::CastPlague)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastConsume", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastConsume)); -tableOrder.insert(std::pair(Orders::CastConsume.getID(), &Orders::CastConsume)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastEnsnare", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastEnsnare)); -tableOrder.insert(std::pair(Orders::CastEnsnare.getID(), &Orders::CastEnsnare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastStasisField", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastStasisField)); -tableOrder.insert(std::pair(Orders::CastStasisField.getID(), &Orders::CastStasisField)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastHallucination", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastHallucination)); -tableOrder.insert(std::pair(Orders::CastHallucination.getID(), &Orders::CastHallucination)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hallucination2", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Hallucination2)); -tableOrder.insert(std::pair(Orders::Hallucination2.getID(), &Orders::Hallucination2)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ResetCollision", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ResetCollision)); -tableOrder.insert(std::pair(Orders::ResetCollision.getID(), &Orders::ResetCollision)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Patrol", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Patrol)); -tableOrder.insert(std::pair(Orders::Patrol.getID(), &Orders::Patrol)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CTFCOPInit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CTFCOPInit)); -tableOrder.insert(std::pair(Orders::CTFCOPInit.getID(), &Orders::CTFCOPInit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CTFCOPStarted", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CTFCOPStarted)); -tableOrder.insert(std::pair(Orders::CTFCOPStarted.getID(), &Orders::CTFCOPStarted)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CTFCOP2", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CTFCOP2)); -tableOrder.insert(std::pair(Orders::CTFCOP2.getID(), &Orders::CTFCOP2)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ComputerAI", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ComputerAI)); -tableOrder.insert(std::pair(Orders::ComputerAI.getID(), &Orders::ComputerAI)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AtkMoveEP", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AtkMoveEP)); -tableOrder.insert(std::pair(Orders::AtkMoveEP.getID(), &Orders::AtkMoveEP)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HarassMove", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HarassMove)); -tableOrder.insert(std::pair(Orders::HarassMove.getID(), &Orders::HarassMove)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AIPatrol", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AIPatrol)); -tableOrder.insert(std::pair(Orders::AIPatrol.getID(), &Orders::AIPatrol)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "GuardPost", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::GuardPost)); -tableOrder.insert(std::pair(Orders::GuardPost.getID(), &Orders::GuardPost)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RescuePassive", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RescuePassive)); -tableOrder.insert(std::pair(Orders::RescuePassive.getID(), &Orders::RescuePassive)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Neutral", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Neutral)); -tableOrder.insert(std::pair(Orders::Neutral.getID(), &Orders::Neutral)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ComputerReturn", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ComputerReturn)); -tableOrder.insert(std::pair(Orders::ComputerReturn.getID(), &Orders::ComputerReturn)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "SelfDestructing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::SelfDestructing)); -tableOrder.insert(std::pair(Orders::SelfDestructing.getID(), &Orders::SelfDestructing)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Critter)); -tableOrder.insert(std::pair(Orders::Critter.getID(), &Orders::Critter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HiddenGun", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HiddenGun)); -tableOrder.insert(std::pair(Orders::HiddenGun.getID(), &Orders::HiddenGun)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "OpenDoor", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::OpenDoor)); -tableOrder.insert(std::pair(Orders::OpenDoor.getID(), &Orders::OpenDoor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CloseDoor", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CloseDoor)); -tableOrder.insert(std::pair(Orders::CloseDoor.getID(), &Orders::CloseDoor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HideTrap", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HideTrap)); -tableOrder.insert(std::pair(Orders::HideTrap.getID(), &Orders::HideTrap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RevealTrap", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RevealTrap)); -tableOrder.insert(std::pair(Orders::RevealTrap.getID(), &Orders::RevealTrap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EnableDoodad", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::EnableDoodad)); -tableOrder.insert(std::pair(Orders::EnableDoodad.getID(), &Orders::EnableDoodad)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "DisableDoodad", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::DisableDoodad)); -tableOrder.insert(std::pair(Orders::DisableDoodad.getID(), &Orders::DisableDoodad)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "WarpIn", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::WarpIn)); -tableOrder.insert(std::pair(Orders::WarpIn.getID(), &Orders::WarpIn)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Medic", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Medic)); -tableOrder.insert(std::pair(Orders::Medic.getID(), &Orders::Medic)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MedicHeal", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MedicHeal)); -tableOrder.insert(std::pair(Orders::MedicHeal.getID(), &Orders::MedicHeal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HealMove", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HealMove)); -tableOrder.insert(std::pair(Orders::HealMove.getID(), &Orders::HealMove)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MedicHealToIdle", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MedicHealToIdle)); -tableOrder.insert(std::pair(Orders::MedicHealToIdle.getID(), &Orders::MedicHealToIdle)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastRestoration", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastRestoration)); -tableOrder.insert(std::pair(Orders::CastRestoration.getID(), &Orders::CastRestoration)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastDisruptionWeb", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastDisruptionWeb)); -tableOrder.insert(std::pair(Orders::CastDisruptionWeb.getID(), &Orders::CastDisruptionWeb)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastMindControl", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastMindControl)); -tableOrder.insert(std::pair(Orders::CastMindControl.getID(), &Orders::CastMindControl)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "DarkArchonMeld", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::DarkArchonMeld)); -tableOrder.insert(std::pair(Orders::DarkArchonMeld.getID(), &Orders::DarkArchonMeld)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastFeedback", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastFeedback)); -tableOrder.insert(std::pair(Orders::CastFeedback.getID(), &Orders::CastFeedback)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastOpticalFlare", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastOpticalFlare)); -tableOrder.insert(std::pair(Orders::CastOpticalFlare.getID(), &Orders::CastOpticalFlare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastMaelstrom", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastMaelstrom)); -tableOrder.insert(std::pair(Orders::CastMaelstrom.getID(), &Orders::CastMaelstrom)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "JunkYardDog", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::JunkYardDog)); -tableOrder.insert(std::pair(Orders::JunkYardDog.getID(), &Orders::JunkYardDog)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fatal", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Fatal)); -tableOrder.insert(std::pair(Orders::Fatal.getID(), &Orders::Fatal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::None)); -tableOrder.insert(std::pair(Orders::None.getID(), &Orders::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Unknown)); -tableOrder.insert(std::pair(Orders::Unknown.getID(), &Orders::Unknown)); -cls = env->FindClass("Lbwapi/PlayerType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/PlayerType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::None)); -tablePlayerType.insert(std::pair(PlayerTypes::None.getID(), &PlayerTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Computer", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Computer)); -tablePlayerType.insert(std::pair(PlayerTypes::Computer.getID(), &PlayerTypes::Computer)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Player", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Player)); -tablePlayerType.insert(std::pair(PlayerTypes::Player.getID(), &PlayerTypes::Player)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RescuePassive", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::RescuePassive)); -tablePlayerType.insert(std::pair(PlayerTypes::RescuePassive.getID(), &PlayerTypes::RescuePassive)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EitherPreferComputer", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::EitherPreferComputer)); -tablePlayerType.insert(std::pair(PlayerTypes::EitherPreferComputer.getID(), &PlayerTypes::EitherPreferComputer)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EitherPreferHuman", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::EitherPreferHuman)); -tablePlayerType.insert(std::pair(PlayerTypes::EitherPreferHuman.getID(), &PlayerTypes::EitherPreferHuman)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Neutral", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Neutral)); -tablePlayerType.insert(std::pair(PlayerTypes::Neutral.getID(), &PlayerTypes::Neutral)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Closed", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Closed)); -tablePlayerType.insert(std::pair(PlayerTypes::Closed.getID(), &PlayerTypes::Closed)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlayerLeft", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::PlayerLeft)); -tablePlayerType.insert(std::pair(PlayerTypes::PlayerLeft.getID(), &PlayerTypes::PlayerLeft)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ComputerLeft", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::ComputerLeft)); -tablePlayerType.insert(std::pair(PlayerTypes::ComputerLeft.getID(), &PlayerTypes::ComputerLeft)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Unknown)); -tablePlayerType.insert(std::pair(PlayerTypes::Unknown.getID(), &PlayerTypes::Unknown)); -cls = env->FindClass("Lbwapi/Race;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/Race;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Zerg)); -tableRace.insert(std::pair(Races::Zerg.getID(), &Races::Zerg)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Terran)); -tableRace.insert(std::pair(Races::Terran.getID(), &Races::Terran)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Protoss)); -tableRace.insert(std::pair(Races::Protoss.getID(), &Races::Protoss)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Random", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Random)); -tableRace.insert(std::pair(Races::Random.getID(), &Races::Random)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::None)); -tableRace.insert(std::pair(Races::None.getID(), &Races::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Unknown)); -tableRace.insert(std::pair(Races::Unknown.getID(), &Races::Unknown)); -cls = env->FindClass("Lbwapi/TechType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/TechType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stim_Packs", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Stim_Packs)); -tableTechType.insert(std::pair(TechTypes::Stim_Packs.getID(), &TechTypes::Stim_Packs)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lockdown", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Lockdown)); -tableTechType.insert(std::pair(TechTypes::Lockdown.getID(), &TechTypes::Lockdown)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EMP_Shockwave", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::EMP_Shockwave)); -tableTechType.insert(std::pair(TechTypes::EMP_Shockwave.getID(), &TechTypes::EMP_Shockwave)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spider_Mines", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Spider_Mines)); -tableTechType.insert(std::pair(TechTypes::Spider_Mines.getID(), &TechTypes::Spider_Mines)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Scanner_Sweep", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Scanner_Sweep)); -tableTechType.insert(std::pair(TechTypes::Scanner_Sweep.getID(), &TechTypes::Scanner_Sweep)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Tank_Siege_Mode", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Tank_Siege_Mode)); -tableTechType.insert(std::pair(TechTypes::Tank_Siege_Mode.getID(), &TechTypes::Tank_Siege_Mode)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Defensive_Matrix", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Defensive_Matrix)); -tableTechType.insert(std::pair(TechTypes::Defensive_Matrix.getID(), &TechTypes::Defensive_Matrix)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Irradiate", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Irradiate)); -tableTechType.insert(std::pair(TechTypes::Irradiate.getID(), &TechTypes::Irradiate)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Yamato_Gun", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Yamato_Gun)); -tableTechType.insert(std::pair(TechTypes::Yamato_Gun.getID(), &TechTypes::Yamato_Gun)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cloaking_Field", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Cloaking_Field)); -tableTechType.insert(std::pair(TechTypes::Cloaking_Field.getID(), &TechTypes::Cloaking_Field)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Personnel_Cloaking", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Personnel_Cloaking)); -tableTechType.insert(std::pair(TechTypes::Personnel_Cloaking.getID(), &TechTypes::Personnel_Cloaking)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Restoration", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Restoration)); -tableTechType.insert(std::pair(TechTypes::Restoration.getID(), &TechTypes::Restoration)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Optical_Flare", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Optical_Flare)); -tableTechType.insert(std::pair(TechTypes::Optical_Flare.getID(), &TechTypes::Optical_Flare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Healing", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Healing)); -tableTechType.insert(std::pair(TechTypes::Healing.getID(), &TechTypes::Healing)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Nuclear_Strike", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Nuclear_Strike)); -tableTechType.insert(std::pair(TechTypes::Nuclear_Strike.getID(), &TechTypes::Nuclear_Strike)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burrowing", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Burrowing)); -tableTechType.insert(std::pair(TechTypes::Burrowing.getID(), &TechTypes::Burrowing)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Infestation", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Infestation)); -tableTechType.insert(std::pair(TechTypes::Infestation.getID(), &TechTypes::Infestation)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spawn_Broodlings", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Spawn_Broodlings)); -tableTechType.insert(std::pair(TechTypes::Spawn_Broodlings.getID(), &TechTypes::Spawn_Broodlings)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dark_Swarm", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Dark_Swarm)); -tableTechType.insert(std::pair(TechTypes::Dark_Swarm.getID(), &TechTypes::Dark_Swarm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Plague", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Plague)); -tableTechType.insert(std::pair(TechTypes::Plague.getID(), &TechTypes::Plague)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Consume", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Consume)); -tableTechType.insert(std::pair(TechTypes::Consume.getID(), &TechTypes::Consume)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ensnare", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Ensnare)); -tableTechType.insert(std::pair(TechTypes::Ensnare.getID(), &TechTypes::Ensnare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Parasite", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Parasite)); -tableTechType.insert(std::pair(TechTypes::Parasite.getID(), &TechTypes::Parasite)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lurker_Aspect", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Lurker_Aspect)); -tableTechType.insert(std::pair(TechTypes::Lurker_Aspect.getID(), &TechTypes::Lurker_Aspect)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Storm", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Psionic_Storm)); -tableTechType.insert(std::pair(TechTypes::Psionic_Storm.getID(), &TechTypes::Psionic_Storm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hallucination", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Hallucination)); -tableTechType.insert(std::pair(TechTypes::Hallucination.getID(), &TechTypes::Hallucination)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Recall", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Recall)); -tableTechType.insert(std::pair(TechTypes::Recall.getID(), &TechTypes::Recall)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stasis_Field", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Stasis_Field)); -tableTechType.insert(std::pair(TechTypes::Stasis_Field.getID(), &TechTypes::Stasis_Field)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Archon_Warp", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Archon_Warp)); -tableTechType.insert(std::pair(TechTypes::Archon_Warp.getID(), &TechTypes::Archon_Warp)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Disruption_Web", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Disruption_Web)); -tableTechType.insert(std::pair(TechTypes::Disruption_Web.getID(), &TechTypes::Disruption_Web)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Mind_Control", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Mind_Control)); -tableTechType.insert(std::pair(TechTypes::Mind_Control.getID(), &TechTypes::Mind_Control)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dark_Archon_Meld", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Dark_Archon_Meld)); -tableTechType.insert(std::pair(TechTypes::Dark_Archon_Meld.getID(), &TechTypes::Dark_Archon_Meld)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Feedback", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Feedback)); -tableTechType.insert(std::pair(TechTypes::Feedback.getID(), &TechTypes::Feedback)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Maelstrom", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Maelstrom)); -tableTechType.insert(std::pair(TechTypes::Maelstrom.getID(), &TechTypes::Maelstrom)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::None)); -tableTechType.insert(std::pair(TechTypes::None.getID(), &TechTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Unknown)); -tableTechType.insert(std::pair(TechTypes::Unknown.getID(), &TechTypes::Unknown)); -cls = env->FindClass("Lbwapi/UnitCommandType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/UnitCommandType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Attack_Move", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Attack_Move)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Attack_Move.getID(), &UnitCommandTypes::Attack_Move)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Attack_Unit", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Attack_Unit)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Attack_Unit.getID(), &UnitCommandTypes::Attack_Unit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Build", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Build)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Build.getID(), &UnitCommandTypes::Build)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Build_Addon", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Build_Addon)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Build_Addon.getID(), &UnitCommandTypes::Build_Addon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Train", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Train)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Train.getID(), &UnitCommandTypes::Train)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Morph", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Morph)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Morph.getID(), &UnitCommandTypes::Morph)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Research", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Research)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Research.getID(), &UnitCommandTypes::Research)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Upgrade", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Upgrade)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Upgrade.getID(), &UnitCommandTypes::Upgrade)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Set_Rally_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Set_Rally_Position)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Set_Rally_Position.getID(), &UnitCommandTypes::Set_Rally_Position)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Set_Rally_Unit", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Set_Rally_Unit)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Set_Rally_Unit.getID(), &UnitCommandTypes::Set_Rally_Unit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Move", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Move)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Move.getID(), &UnitCommandTypes::Move)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Patrol", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Patrol)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Patrol.getID(), &UnitCommandTypes::Patrol)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hold_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Hold_Position)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Hold_Position.getID(), &UnitCommandTypes::Hold_Position)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stop", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Stop)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Stop.getID(), &UnitCommandTypes::Stop)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Follow", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Follow)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Follow.getID(), &UnitCommandTypes::Follow)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gather", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Gather)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Gather.getID(), &UnitCommandTypes::Gather)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Return_Cargo", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Return_Cargo)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Return_Cargo.getID(), &UnitCommandTypes::Return_Cargo)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Repair", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Repair)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Repair.getID(), &UnitCommandTypes::Repair)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burrow", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Burrow)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Burrow.getID(), &UnitCommandTypes::Burrow)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unburrow", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unburrow)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unburrow.getID(), &UnitCommandTypes::Unburrow)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cloak", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cloak)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cloak.getID(), &UnitCommandTypes::Cloak)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Decloak", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Decloak)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Decloak.getID(), &UnitCommandTypes::Decloak)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Siege", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Siege)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Siege.getID(), &UnitCommandTypes::Siege)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unsiege", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unsiege)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unsiege.getID(), &UnitCommandTypes::Unsiege)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lift", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Lift)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Lift.getID(), &UnitCommandTypes::Lift)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Land", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Land)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Land.getID(), &UnitCommandTypes::Land)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Load", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Load)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Load.getID(), &UnitCommandTypes::Load)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unload", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unload)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unload.getID(), &UnitCommandTypes::Unload)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unload_All", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unload_All)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unload_All.getID(), &UnitCommandTypes::Unload_All)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unload_All_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unload_All_Position)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unload_All_Position.getID(), &UnitCommandTypes::Unload_All_Position)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Right_Click_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Right_Click_Position)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Right_Click_Position.getID(), &UnitCommandTypes::Right_Click_Position)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Right_Click_Unit", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Right_Click_Unit)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Right_Click_Unit.getID(), &UnitCommandTypes::Right_Click_Unit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Halt_Construction", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Halt_Construction)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Halt_Construction.getID(), &UnitCommandTypes::Halt_Construction)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Construction", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Construction)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Construction.getID(), &UnitCommandTypes::Cancel_Construction)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Addon", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Addon)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Addon.getID(), &UnitCommandTypes::Cancel_Addon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Train", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Train)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Train.getID(), &UnitCommandTypes::Cancel_Train)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Train_Slot", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Train_Slot)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Train_Slot.getID(), &UnitCommandTypes::Cancel_Train_Slot)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Morph", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Morph)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Morph.getID(), &UnitCommandTypes::Cancel_Morph)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Research", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Research)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Research.getID(), &UnitCommandTypes::Cancel_Research)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Upgrade", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Upgrade)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Upgrade.getID(), &UnitCommandTypes::Cancel_Upgrade)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Use_Tech", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Use_Tech)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Use_Tech.getID(), &UnitCommandTypes::Use_Tech)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Use_Tech_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Use_Tech_Position)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Use_Tech_Position.getID(), &UnitCommandTypes::Use_Tech_Position)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Use_Tech_Unit", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Use_Tech_Unit)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Use_Tech_Unit.getID(), &UnitCommandTypes::Use_Tech_Unit)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Place_COP", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Place_COP)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Place_COP.getID(), &UnitCommandTypes::Place_COP)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::None)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::None.getID(), &UnitCommandTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unknown)); -tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unknown.getID(), &UnitCommandTypes::Unknown)); -cls = env->FindClass("Lbwapi/UnitSizeType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/UnitSizeType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Independent", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Independent)); -tableUnitSizeType.insert(std::pair(UnitSizeTypes::Independent.getID(), &UnitSizeTypes::Independent)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Small", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Small)); -tableUnitSizeType.insert(std::pair(UnitSizeTypes::Small.getID(), &UnitSizeTypes::Small)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Medium", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Medium)); -tableUnitSizeType.insert(std::pair(UnitSizeTypes::Medium.getID(), &UnitSizeTypes::Medium)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Large", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Large)); -tableUnitSizeType.insert(std::pair(UnitSizeTypes::Large.getID(), &UnitSizeTypes::Large)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::None)); -tableUnitSizeType.insert(std::pair(UnitSizeTypes::None.getID(), &UnitSizeTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Unknown)); -tableUnitSizeType.insert(std::pair(UnitSizeTypes::Unknown.getID(), &UnitSizeTypes::Unknown)); -cls = env->FindClass("Lbwapi/UnitType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/UnitType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Firebat", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Firebat)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Firebat.getID(), &UnitTypes::Terran_Firebat)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Ghost", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Ghost)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Ghost.getID(), &UnitTypes::Terran_Ghost)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Goliath", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Goliath)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Goliath.getID(), &UnitTypes::Terran_Goliath)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Marine", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Marine)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Marine.getID(), &UnitTypes::Terran_Marine)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Medic", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Medic)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Medic.getID(), &UnitTypes::Terran_Medic)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_SCV", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_SCV)); -tableUnitType.insert(std::pair(UnitTypes::Terran_SCV.getID(), &UnitTypes::Terran_SCV)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Siege_Tank_Siege_Mode", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Siege_Tank_Siege_Mode)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Siege_Tank_Siege_Mode.getID(), &UnitTypes::Terran_Siege_Tank_Siege_Mode)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Siege_Tank_Tank_Mode", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Siege_Tank_Tank_Mode)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Siege_Tank_Tank_Mode.getID(), &UnitTypes::Terran_Siege_Tank_Tank_Mode)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Vulture", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Vulture)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Vulture.getID(), &UnitTypes::Terran_Vulture)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Vulture_Spider_Mine", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Vulture_Spider_Mine)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Vulture_Spider_Mine.getID(), &UnitTypes::Terran_Vulture_Spider_Mine)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Battlecruiser", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Battlecruiser)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Battlecruiser.getID(), &UnitTypes::Terran_Battlecruiser)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Dropship", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Dropship)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Dropship.getID(), &UnitTypes::Terran_Dropship)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Nuclear_Missile", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Nuclear_Missile)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Nuclear_Missile.getID(), &UnitTypes::Terran_Nuclear_Missile)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Science_Vessel", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Science_Vessel)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Science_Vessel.getID(), &UnitTypes::Terran_Science_Vessel)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Valkyrie", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Valkyrie)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Valkyrie.getID(), &UnitTypes::Terran_Valkyrie)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Wraith", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Wraith)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Wraith.getID(), &UnitTypes::Terran_Wraith)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Alan_Schezar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Alan_Schezar)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Alan_Schezar.getID(), &UnitTypes::Hero_Alan_Schezar)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Alexei_Stukov", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Alexei_Stukov)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Alexei_Stukov.getID(), &UnitTypes::Hero_Alexei_Stukov)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Arcturus_Mengsk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Arcturus_Mengsk)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Arcturus_Mengsk.getID(), &UnitTypes::Hero_Arcturus_Mengsk)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Edmund_Duke_Tank_Mode", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Edmund_Duke_Tank_Mode)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Edmund_Duke_Tank_Mode.getID(), &UnitTypes::Hero_Edmund_Duke_Tank_Mode)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Edmund_Duke_Siege_Mode", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Edmund_Duke_Siege_Mode)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Edmund_Duke_Siege_Mode.getID(), &UnitTypes::Hero_Edmund_Duke_Siege_Mode)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Gerard_DuGalle", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Gerard_DuGalle)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Gerard_DuGalle.getID(), &UnitTypes::Hero_Gerard_DuGalle)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Gui_Montag", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Gui_Montag)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Gui_Montag.getID(), &UnitTypes::Hero_Gui_Montag)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Hyperion", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Hyperion)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Hyperion.getID(), &UnitTypes::Hero_Hyperion)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Jim_Raynor_Marine", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Jim_Raynor_Marine)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Jim_Raynor_Marine.getID(), &UnitTypes::Hero_Jim_Raynor_Marine)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Jim_Raynor_Vulture", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Jim_Raynor_Vulture)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Jim_Raynor_Vulture.getID(), &UnitTypes::Hero_Jim_Raynor_Vulture)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Magellan", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Magellan)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Magellan.getID(), &UnitTypes::Hero_Magellan)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Norad_II", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Norad_II)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Norad_II.getID(), &UnitTypes::Hero_Norad_II)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Samir_Duran", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Samir_Duran)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Samir_Duran.getID(), &UnitTypes::Hero_Samir_Duran)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Sarah_Kerrigan", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Sarah_Kerrigan)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Sarah_Kerrigan.getID(), &UnitTypes::Hero_Sarah_Kerrigan)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Tom_Kazansky", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Tom_Kazansky)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Tom_Kazansky.getID(), &UnitTypes::Hero_Tom_Kazansky)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Civilian", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Civilian)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Civilian.getID(), &UnitTypes::Terran_Civilian)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Academy", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Academy)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Academy.getID(), &UnitTypes::Terran_Academy)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Armory", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Armory)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Armory.getID(), &UnitTypes::Terran_Armory)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Barracks", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Barracks)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Barracks.getID(), &UnitTypes::Terran_Barracks)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Bunker", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Bunker)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Bunker.getID(), &UnitTypes::Terran_Bunker)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Command_Center", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Command_Center)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Command_Center.getID(), &UnitTypes::Terran_Command_Center)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Engineering_Bay", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Engineering_Bay)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Engineering_Bay.getID(), &UnitTypes::Terran_Engineering_Bay)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Factory", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Factory)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Factory.getID(), &UnitTypes::Terran_Factory)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Missile_Turret", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Missile_Turret)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Missile_Turret.getID(), &UnitTypes::Terran_Missile_Turret)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Refinery", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Refinery)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Refinery.getID(), &UnitTypes::Terran_Refinery)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Science_Facility", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Science_Facility)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Science_Facility.getID(), &UnitTypes::Terran_Science_Facility)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Starport", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Starport)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Starport.getID(), &UnitTypes::Terran_Starport)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Supply_Depot", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Supply_Depot)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Supply_Depot.getID(), &UnitTypes::Terran_Supply_Depot)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Comsat_Station", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Comsat_Station)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Comsat_Station.getID(), &UnitTypes::Terran_Comsat_Station)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Control_Tower", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Control_Tower)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Control_Tower.getID(), &UnitTypes::Terran_Control_Tower)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Covert_Ops", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Covert_Ops)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Covert_Ops.getID(), &UnitTypes::Terran_Covert_Ops)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Machine_Shop", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Machine_Shop)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Machine_Shop.getID(), &UnitTypes::Terran_Machine_Shop)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Nuclear_Silo", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Nuclear_Silo)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Nuclear_Silo.getID(), &UnitTypes::Terran_Nuclear_Silo)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Physics_Lab", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Physics_Lab)); -tableUnitType.insert(std::pair(UnitTypes::Terran_Physics_Lab.getID(), &UnitTypes::Terran_Physics_Lab)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Crashed_Norad_II", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Crashed_Norad_II)); -tableUnitType.insert(std::pair(UnitTypes::Special_Crashed_Norad_II.getID(), &UnitTypes::Special_Crashed_Norad_II)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Ion_Cannon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Ion_Cannon)); -tableUnitType.insert(std::pair(UnitTypes::Special_Ion_Cannon.getID(), &UnitTypes::Special_Ion_Cannon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Power_Generator", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Power_Generator)); -tableUnitType.insert(std::pair(UnitTypes::Special_Power_Generator.getID(), &UnitTypes::Special_Power_Generator)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Psi_Disrupter", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Psi_Disrupter)); -tableUnitType.insert(std::pair(UnitTypes::Special_Psi_Disrupter.getID(), &UnitTypes::Special_Psi_Disrupter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Archon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Archon)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Archon.getID(), &UnitTypes::Protoss_Archon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Dark_Archon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Dark_Archon)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Dark_Archon.getID(), &UnitTypes::Protoss_Dark_Archon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Dark_Templar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Dark_Templar)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Dark_Templar.getID(), &UnitTypes::Protoss_Dark_Templar)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Dragoon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Dragoon)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Dragoon.getID(), &UnitTypes::Protoss_Dragoon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_High_Templar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_High_Templar)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_High_Templar.getID(), &UnitTypes::Protoss_High_Templar)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Probe", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Probe)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Probe.getID(), &UnitTypes::Protoss_Probe)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Reaver", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Reaver)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Reaver.getID(), &UnitTypes::Protoss_Reaver)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Scarab", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Scarab)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Scarab.getID(), &UnitTypes::Protoss_Scarab)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Zealot", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Zealot)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Zealot.getID(), &UnitTypes::Protoss_Zealot)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Arbiter", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Arbiter)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Arbiter.getID(), &UnitTypes::Protoss_Arbiter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Carrier", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Carrier)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Carrier.getID(), &UnitTypes::Protoss_Carrier)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Corsair", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Corsair)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Corsair.getID(), &UnitTypes::Protoss_Corsair)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Interceptor", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Interceptor)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Interceptor.getID(), &UnitTypes::Protoss_Interceptor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Observer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Observer)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Observer.getID(), &UnitTypes::Protoss_Observer)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Scout", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Scout)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Scout.getID(), &UnitTypes::Protoss_Scout)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Shuttle", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Shuttle)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Shuttle.getID(), &UnitTypes::Protoss_Shuttle)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Aldaris", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Aldaris)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Aldaris.getID(), &UnitTypes::Hero_Aldaris)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Artanis", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Artanis)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Artanis.getID(), &UnitTypes::Hero_Artanis)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Danimoth", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Danimoth)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Danimoth.getID(), &UnitTypes::Hero_Danimoth)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Dark_Templar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Dark_Templar)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Dark_Templar.getID(), &UnitTypes::Hero_Dark_Templar)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Fenix_Dragoon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Fenix_Dragoon)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Fenix_Dragoon.getID(), &UnitTypes::Hero_Fenix_Dragoon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Fenix_Zealot", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Fenix_Zealot)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Fenix_Zealot.getID(), &UnitTypes::Hero_Fenix_Zealot)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Gantrithor", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Gantrithor)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Gantrithor.getID(), &UnitTypes::Hero_Gantrithor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Mojo", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Mojo)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Mojo.getID(), &UnitTypes::Hero_Mojo)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Raszagal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Raszagal)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Raszagal.getID(), &UnitTypes::Hero_Raszagal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Tassadar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Tassadar)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Tassadar.getID(), &UnitTypes::Hero_Tassadar)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Tassadar_Zeratul_Archon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Tassadar_Zeratul_Archon)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Tassadar_Zeratul_Archon.getID(), &UnitTypes::Hero_Tassadar_Zeratul_Archon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Warbringer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Warbringer)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Warbringer.getID(), &UnitTypes::Hero_Warbringer)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Zeratul", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Zeratul)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Zeratul.getID(), &UnitTypes::Hero_Zeratul)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Arbiter_Tribunal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Arbiter_Tribunal)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Arbiter_Tribunal.getID(), &UnitTypes::Protoss_Arbiter_Tribunal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Assimilator", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Assimilator)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Assimilator.getID(), &UnitTypes::Protoss_Assimilator)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Citadel_of_Adun", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Citadel_of_Adun)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Citadel_of_Adun.getID(), &UnitTypes::Protoss_Citadel_of_Adun)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Cybernetics_Core", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Cybernetics_Core)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Cybernetics_Core.getID(), &UnitTypes::Protoss_Cybernetics_Core)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Fleet_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Fleet_Beacon)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Fleet_Beacon.getID(), &UnitTypes::Protoss_Fleet_Beacon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Forge", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Forge)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Forge.getID(), &UnitTypes::Protoss_Forge)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Gateway", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Gateway)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Gateway.getID(), &UnitTypes::Protoss_Gateway)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Nexus", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Nexus)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Nexus.getID(), &UnitTypes::Protoss_Nexus)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Observatory", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Observatory)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Observatory.getID(), &UnitTypes::Protoss_Observatory)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Photon_Cannon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Photon_Cannon)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Photon_Cannon.getID(), &UnitTypes::Protoss_Photon_Cannon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Pylon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Pylon)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Pylon.getID(), &UnitTypes::Protoss_Pylon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Robotics_Facility", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Robotics_Facility)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Robotics_Facility.getID(), &UnitTypes::Protoss_Robotics_Facility)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Robotics_Support_Bay", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Robotics_Support_Bay)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Robotics_Support_Bay.getID(), &UnitTypes::Protoss_Robotics_Support_Bay)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Shield_Battery", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Shield_Battery)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Shield_Battery.getID(), &UnitTypes::Protoss_Shield_Battery)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Stargate", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Stargate)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Stargate.getID(), &UnitTypes::Protoss_Stargate)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Templar_Archives", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Templar_Archives)); -tableUnitType.insert(std::pair(UnitTypes::Protoss_Templar_Archives.getID(), &UnitTypes::Protoss_Templar_Archives)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Khaydarin_Crystal_Form", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Khaydarin_Crystal_Form)); -tableUnitType.insert(std::pair(UnitTypes::Special_Khaydarin_Crystal_Form.getID(), &UnitTypes::Special_Khaydarin_Crystal_Form)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Protoss_Temple", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Protoss_Temple)); -tableUnitType.insert(std::pair(UnitTypes::Special_Protoss_Temple.getID(), &UnitTypes::Special_Protoss_Temple)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Stasis_Cell_Prison", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Stasis_Cell_Prison)); -tableUnitType.insert(std::pair(UnitTypes::Special_Stasis_Cell_Prison.getID(), &UnitTypes::Special_Stasis_Cell_Prison)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Warp_Gate", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Warp_Gate)); -tableUnitType.insert(std::pair(UnitTypes::Special_Warp_Gate.getID(), &UnitTypes::Special_Warp_Gate)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_XelNaga_Temple", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_XelNaga_Temple)); -tableUnitType.insert(std::pair(UnitTypes::Special_XelNaga_Temple.getID(), &UnitTypes::Special_XelNaga_Temple)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Broodling", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Broodling)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Broodling.getID(), &UnitTypes::Zerg_Broodling)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Defiler", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Defiler)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Defiler.getID(), &UnitTypes::Zerg_Defiler)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Drone", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Drone)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Drone.getID(), &UnitTypes::Zerg_Drone)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Egg", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Egg)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Egg.getID(), &UnitTypes::Zerg_Egg)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Hydralisk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Hydralisk)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Hydralisk.getID(), &UnitTypes::Zerg_Hydralisk)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Infested_Terran", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Infested_Terran)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Infested_Terran.getID(), &UnitTypes::Zerg_Infested_Terran)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Larva", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Larva)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Larva.getID(), &UnitTypes::Zerg_Larva)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Lurker", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Lurker)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Lurker.getID(), &UnitTypes::Zerg_Lurker)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Lurker_Egg", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Lurker_Egg)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Lurker_Egg.getID(), &UnitTypes::Zerg_Lurker_Egg)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Ultralisk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Ultralisk)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Ultralisk.getID(), &UnitTypes::Zerg_Ultralisk)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Zergling", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Zergling)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Zergling.getID(), &UnitTypes::Zerg_Zergling)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Cocoon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Cocoon)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Cocoon.getID(), &UnitTypes::Zerg_Cocoon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Devourer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Devourer)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Devourer.getID(), &UnitTypes::Zerg_Devourer)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Guardian", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Guardian)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Guardian.getID(), &UnitTypes::Zerg_Guardian)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Mutalisk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Mutalisk)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Mutalisk.getID(), &UnitTypes::Zerg_Mutalisk)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Overlord", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Overlord)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Overlord.getID(), &UnitTypes::Zerg_Overlord)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Queen", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Queen)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Queen.getID(), &UnitTypes::Zerg_Queen)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Scourge", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Scourge)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Scourge.getID(), &UnitTypes::Zerg_Scourge)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Devouring_One", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Devouring_One)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Devouring_One.getID(), &UnitTypes::Hero_Devouring_One)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Hunter_Killer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Hunter_Killer)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Hunter_Killer.getID(), &UnitTypes::Hero_Hunter_Killer)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Infested_Duran", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Infested_Duran)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Infested_Duran.getID(), &UnitTypes::Hero_Infested_Duran)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Infested_Kerrigan", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Infested_Kerrigan)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Infested_Kerrigan.getID(), &UnitTypes::Hero_Infested_Kerrigan)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Kukulza_Guardian", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Kukulza_Guardian)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Kukulza_Guardian.getID(), &UnitTypes::Hero_Kukulza_Guardian)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Kukulza_Mutalisk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Kukulza_Mutalisk)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Kukulza_Mutalisk.getID(), &UnitTypes::Hero_Kukulza_Mutalisk)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Matriarch", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Matriarch)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Matriarch.getID(), &UnitTypes::Hero_Matriarch)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Torrasque", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Torrasque)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Torrasque.getID(), &UnitTypes::Hero_Torrasque)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Unclean_One", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Unclean_One)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Unclean_One.getID(), &UnitTypes::Hero_Unclean_One)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Yggdrasill", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Yggdrasill)); -tableUnitType.insert(std::pair(UnitTypes::Hero_Yggdrasill.getID(), &UnitTypes::Hero_Yggdrasill)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Creep_Colony", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Creep_Colony)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Creep_Colony.getID(), &UnitTypes::Zerg_Creep_Colony)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Defiler_Mound", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Defiler_Mound)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Defiler_Mound.getID(), &UnitTypes::Zerg_Defiler_Mound)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Evolution_Chamber", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Evolution_Chamber)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Evolution_Chamber.getID(), &UnitTypes::Zerg_Evolution_Chamber)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Extractor", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Extractor)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Extractor.getID(), &UnitTypes::Zerg_Extractor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Greater_Spire", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Greater_Spire)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Greater_Spire.getID(), &UnitTypes::Zerg_Greater_Spire)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Hatchery", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Hatchery)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Hatchery.getID(), &UnitTypes::Zerg_Hatchery)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Hive", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Hive)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Hive.getID(), &UnitTypes::Zerg_Hive)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Hydralisk_Den", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Hydralisk_Den)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Hydralisk_Den.getID(), &UnitTypes::Zerg_Hydralisk_Den)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Infested_Command_Center", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Infested_Command_Center)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Infested_Command_Center.getID(), &UnitTypes::Zerg_Infested_Command_Center)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Lair", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Lair)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Lair.getID(), &UnitTypes::Zerg_Lair)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Nydus_Canal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Nydus_Canal)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Nydus_Canal.getID(), &UnitTypes::Zerg_Nydus_Canal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Queens_Nest", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Queens_Nest)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Queens_Nest.getID(), &UnitTypes::Zerg_Queens_Nest)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Spawning_Pool", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Spawning_Pool)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Spawning_Pool.getID(), &UnitTypes::Zerg_Spawning_Pool)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Spire", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Spire)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Spire.getID(), &UnitTypes::Zerg_Spire)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Spore_Colony", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Spore_Colony)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Spore_Colony.getID(), &UnitTypes::Zerg_Spore_Colony)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Sunken_Colony", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Sunken_Colony)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Sunken_Colony.getID(), &UnitTypes::Zerg_Sunken_Colony)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Ultralisk_Cavern", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Ultralisk_Cavern)); -tableUnitType.insert(std::pair(UnitTypes::Zerg_Ultralisk_Cavern.getID(), &UnitTypes::Zerg_Ultralisk_Cavern)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Cerebrate", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Cerebrate)); -tableUnitType.insert(std::pair(UnitTypes::Special_Cerebrate.getID(), &UnitTypes::Special_Cerebrate)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Cerebrate_Daggoth", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Cerebrate_Daggoth)); -tableUnitType.insert(std::pair(UnitTypes::Special_Cerebrate_Daggoth.getID(), &UnitTypes::Special_Cerebrate_Daggoth)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Mature_Chrysalis", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Mature_Chrysalis)); -tableUnitType.insert(std::pair(UnitTypes::Special_Mature_Chrysalis.getID(), &UnitTypes::Special_Mature_Chrysalis)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Overmind", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Overmind)); -tableUnitType.insert(std::pair(UnitTypes::Special_Overmind.getID(), &UnitTypes::Special_Overmind)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Overmind_Cocoon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Overmind_Cocoon)); -tableUnitType.insert(std::pair(UnitTypes::Special_Overmind_Cocoon.getID(), &UnitTypes::Special_Overmind_Cocoon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Overmind_With_Shell", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Overmind_With_Shell)); -tableUnitType.insert(std::pair(UnitTypes::Special_Overmind_With_Shell.getID(), &UnitTypes::Special_Overmind_With_Shell)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Bengalaas", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Bengalaas)); -tableUnitType.insert(std::pair(UnitTypes::Critter_Bengalaas.getID(), &UnitTypes::Critter_Bengalaas)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Kakaru", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Kakaru)); -tableUnitType.insert(std::pair(UnitTypes::Critter_Kakaru.getID(), &UnitTypes::Critter_Kakaru)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Ragnasaur", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Ragnasaur)); -tableUnitType.insert(std::pair(UnitTypes::Critter_Ragnasaur.getID(), &UnitTypes::Critter_Ragnasaur)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Rhynadon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Rhynadon)); -tableUnitType.insert(std::pair(UnitTypes::Critter_Rhynadon.getID(), &UnitTypes::Critter_Rhynadon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Scantid", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Scantid)); -tableUnitType.insert(std::pair(UnitTypes::Critter_Scantid.getID(), &UnitTypes::Critter_Scantid)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Ursadon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Ursadon)); -tableUnitType.insert(std::pair(UnitTypes::Critter_Ursadon.getID(), &UnitTypes::Critter_Ursadon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Resource_Mineral_Field", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Resource_Mineral_Field)); -tableUnitType.insert(std::pair(UnitTypes::Resource_Mineral_Field.getID(), &UnitTypes::Resource_Mineral_Field)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Resource_Mineral_Field_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Resource_Mineral_Field_Type_2)); -tableUnitType.insert(std::pair(UnitTypes::Resource_Mineral_Field_Type_2.getID(), &UnitTypes::Resource_Mineral_Field_Type_2)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Resource_Mineral_Field_Type_3", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Resource_Mineral_Field_Type_3)); -tableUnitType.insert(std::pair(UnitTypes::Resource_Mineral_Field_Type_3.getID(), &UnitTypes::Resource_Mineral_Field_Type_3)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Resource_Vespene_Geyser", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Resource_Vespene_Geyser)); -tableUnitType.insert(std::pair(UnitTypes::Resource_Vespene_Geyser.getID(), &UnitTypes::Resource_Vespene_Geyser)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spell_Dark_Swarm", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Spell_Dark_Swarm)); -tableUnitType.insert(std::pair(UnitTypes::Spell_Dark_Swarm.getID(), &UnitTypes::Spell_Dark_Swarm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spell_Disruption_Web", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Spell_Disruption_Web)); -tableUnitType.insert(std::pair(UnitTypes::Spell_Disruption_Web.getID(), &UnitTypes::Spell_Disruption_Web)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spell_Scanner_Sweep", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Spell_Scanner_Sweep)); -tableUnitType.insert(std::pair(UnitTypes::Spell_Scanner_Sweep.getID(), &UnitTypes::Spell_Scanner_Sweep)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Protoss_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Protoss_Beacon)); -tableUnitType.insert(std::pair(UnitTypes::Special_Protoss_Beacon.getID(), &UnitTypes::Special_Protoss_Beacon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Protoss_Flag_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Protoss_Flag_Beacon)); -tableUnitType.insert(std::pair(UnitTypes::Special_Protoss_Flag_Beacon.getID(), &UnitTypes::Special_Protoss_Flag_Beacon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Terran_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Terran_Beacon)); -tableUnitType.insert(std::pair(UnitTypes::Special_Terran_Beacon.getID(), &UnitTypes::Special_Terran_Beacon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Terran_Flag_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Terran_Flag_Beacon)); -tableUnitType.insert(std::pair(UnitTypes::Special_Terran_Flag_Beacon.getID(), &UnitTypes::Special_Terran_Flag_Beacon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Zerg_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Zerg_Beacon)); -tableUnitType.insert(std::pair(UnitTypes::Special_Zerg_Beacon.getID(), &UnitTypes::Special_Zerg_Beacon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Zerg_Flag_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Zerg_Flag_Beacon)); -tableUnitType.insert(std::pair(UnitTypes::Special_Zerg_Flag_Beacon.getID(), &UnitTypes::Special_Zerg_Flag_Beacon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Data_Disk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Data_Disk)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Data_Disk.getID(), &UnitTypes::Powerup_Data_Disk)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Flag", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Flag)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Flag.getID(), &UnitTypes::Powerup_Flag)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Khalis_Crystal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Khalis_Crystal)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Khalis_Crystal.getID(), &UnitTypes::Powerup_Khalis_Crystal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Khaydarin_Crystal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Khaydarin_Crystal)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Khaydarin_Crystal.getID(), &UnitTypes::Powerup_Khaydarin_Crystal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Mineral_Cluster_Type_1", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Mineral_Cluster_Type_1)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Mineral_Cluster_Type_1.getID(), &UnitTypes::Powerup_Mineral_Cluster_Type_1)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Mineral_Cluster_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Mineral_Cluster_Type_2)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Mineral_Cluster_Type_2.getID(), &UnitTypes::Powerup_Mineral_Cluster_Type_2)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Protoss_Gas_Orb_Type_1", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Protoss_Gas_Orb_Type_1)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Protoss_Gas_Orb_Type_1.getID(), &UnitTypes::Powerup_Protoss_Gas_Orb_Type_1)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Protoss_Gas_Orb_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Protoss_Gas_Orb_Type_2)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Protoss_Gas_Orb_Type_2.getID(), &UnitTypes::Powerup_Protoss_Gas_Orb_Type_2)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Psi_Emitter", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Psi_Emitter)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Psi_Emitter.getID(), &UnitTypes::Powerup_Psi_Emitter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Terran_Gas_Tank_Type_1", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Terran_Gas_Tank_Type_1)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Terran_Gas_Tank_Type_1.getID(), &UnitTypes::Powerup_Terran_Gas_Tank_Type_1)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Terran_Gas_Tank_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Terran_Gas_Tank_Type_2)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Terran_Gas_Tank_Type_2.getID(), &UnitTypes::Powerup_Terran_Gas_Tank_Type_2)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Uraj_Crystal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Uraj_Crystal)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Uraj_Crystal.getID(), &UnitTypes::Powerup_Uraj_Crystal)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Young_Chrysalis", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Young_Chrysalis)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Young_Chrysalis.getID(), &UnitTypes::Powerup_Young_Chrysalis)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Zerg_Gas_Sac_Type_1", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Zerg_Gas_Sac_Type_1)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Zerg_Gas_Sac_Type_1.getID(), &UnitTypes::Powerup_Zerg_Gas_Sac_Type_1)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Zerg_Gas_Sac_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Zerg_Gas_Sac_Type_2)); -tableUnitType.insert(std::pair(UnitTypes::Powerup_Zerg_Gas_Sac_Type_2.getID(), &UnitTypes::Powerup_Zerg_Gas_Sac_Type_2)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Floor_Gun_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Floor_Gun_Trap)); -tableUnitType.insert(std::pair(UnitTypes::Special_Floor_Gun_Trap.getID(), &UnitTypes::Special_Floor_Gun_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Floor_Missile_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Floor_Missile_Trap)); -tableUnitType.insert(std::pair(UnitTypes::Special_Floor_Missile_Trap.getID(), &UnitTypes::Special_Floor_Missile_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Right_Wall_Flame_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Right_Wall_Flame_Trap)); -tableUnitType.insert(std::pair(UnitTypes::Special_Right_Wall_Flame_Trap.getID(), &UnitTypes::Special_Right_Wall_Flame_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Right_Wall_Missile_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Right_Wall_Missile_Trap)); -tableUnitType.insert(std::pair(UnitTypes::Special_Right_Wall_Missile_Trap.getID(), &UnitTypes::Special_Right_Wall_Missile_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Wall_Flame_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Wall_Flame_Trap)); -tableUnitType.insert(std::pair(UnitTypes::Special_Wall_Flame_Trap.getID(), &UnitTypes::Special_Wall_Flame_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Wall_Missile_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Wall_Missile_Trap)); -tableUnitType.insert(std::pair(UnitTypes::Special_Wall_Missile_Trap.getID(), &UnitTypes::Special_Wall_Missile_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Pit_Door", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Pit_Door)); -tableUnitType.insert(std::pair(UnitTypes::Special_Pit_Door.getID(), &UnitTypes::Special_Pit_Door)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Right_Pit_Door", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Right_Pit_Door)); -tableUnitType.insert(std::pair(UnitTypes::Special_Right_Pit_Door.getID(), &UnitTypes::Special_Right_Pit_Door)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Right_Upper_Level_Door", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Right_Upper_Level_Door)); -tableUnitType.insert(std::pair(UnitTypes::Special_Right_Upper_Level_Door.getID(), &UnitTypes::Special_Right_Upper_Level_Door)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Upper_Level_Door", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Upper_Level_Door)); -tableUnitType.insert(std::pair(UnitTypes::Special_Upper_Level_Door.getID(), &UnitTypes::Special_Upper_Level_Door)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Cargo_Ship", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Cargo_Ship)); -tableUnitType.insert(std::pair(UnitTypes::Special_Cargo_Ship.getID(), &UnitTypes::Special_Cargo_Ship)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Floor_Hatch", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Floor_Hatch)); -tableUnitType.insert(std::pair(UnitTypes::Special_Floor_Hatch.getID(), &UnitTypes::Special_Floor_Hatch)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Independant_Starport", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Independant_Starport)); -tableUnitType.insert(std::pair(UnitTypes::Special_Independant_Starport.getID(), &UnitTypes::Special_Independant_Starport)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Map_Revealer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Map_Revealer)); -tableUnitType.insert(std::pair(UnitTypes::Special_Map_Revealer.getID(), &UnitTypes::Special_Map_Revealer)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Mercenary_Gunship", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Mercenary_Gunship)); -tableUnitType.insert(std::pair(UnitTypes::Special_Mercenary_Gunship.getID(), &UnitTypes::Special_Mercenary_Gunship)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Start_Location", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Start_Location)); -tableUnitType.insert(std::pair(UnitTypes::Special_Start_Location.getID(), &UnitTypes::Special_Start_Location)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::None)); -tableUnitType.insert(std::pair(UnitTypes::None.getID(), &UnitTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AllUnits", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::AllUnits)); -tableUnitType.insert(std::pair(UnitTypes::AllUnits.getID(), &UnitTypes::AllUnits)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Men", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Men)); -tableUnitType.insert(std::pair(UnitTypes::Men.getID(), &UnitTypes::Men)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Buildings", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Buildings)); -tableUnitType.insert(std::pair(UnitTypes::Buildings.getID(), &UnitTypes::Buildings)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Factories", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Factories)); -tableUnitType.insert(std::pair(UnitTypes::Factories.getID(), &UnitTypes::Factories)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Unknown)); -tableUnitType.insert(std::pair(UnitTypes::Unknown.getID(), &UnitTypes::Unknown)); -cls = env->FindClass("Lbwapi/UpgradeType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/UpgradeType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Infantry_Armor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Infantry_Armor)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Infantry_Armor.getID(), &UpgradeTypes::Terran_Infantry_Armor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Vehicle_Plating", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Vehicle_Plating)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Vehicle_Plating.getID(), &UpgradeTypes::Terran_Vehicle_Plating)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Ship_Plating", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Ship_Plating)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Ship_Plating.getID(), &UpgradeTypes::Terran_Ship_Plating)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Infantry_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Infantry_Weapons)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Infantry_Weapons.getID(), &UpgradeTypes::Terran_Infantry_Weapons)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Vehicle_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Vehicle_Weapons)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Vehicle_Weapons.getID(), &UpgradeTypes::Terran_Vehicle_Weapons)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Ship_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Ship_Weapons)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Ship_Weapons.getID(), &UpgradeTypes::Terran_Ship_Weapons)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "U_238_Shells", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::U_238_Shells)); -tableUpgradeType.insert(std::pair(UpgradeTypes::U_238_Shells.getID(), &UpgradeTypes::U_238_Shells)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ion_Thrusters", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Ion_Thrusters)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Ion_Thrusters.getID(), &UpgradeTypes::Ion_Thrusters)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Titan_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Titan_Reactor)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Titan_Reactor.getID(), &UpgradeTypes::Titan_Reactor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ocular_Implants", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Ocular_Implants)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Ocular_Implants.getID(), &UpgradeTypes::Ocular_Implants)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Moebius_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Moebius_Reactor)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Moebius_Reactor.getID(), &UpgradeTypes::Moebius_Reactor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Apollo_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Apollo_Reactor)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Apollo_Reactor.getID(), &UpgradeTypes::Apollo_Reactor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Colossus_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Colossus_Reactor)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Colossus_Reactor.getID(), &UpgradeTypes::Colossus_Reactor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Caduceus_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Caduceus_Reactor)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Caduceus_Reactor.getID(), &UpgradeTypes::Caduceus_Reactor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Charon_Boosters", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Charon_Boosters)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Charon_Boosters.getID(), &UpgradeTypes::Charon_Boosters)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Carapace", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Carapace)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Carapace.getID(), &UpgradeTypes::Zerg_Carapace)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Flyer_Carapace", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Flyer_Carapace)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Flyer_Carapace.getID(), &UpgradeTypes::Zerg_Flyer_Carapace)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Melee_Attacks", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Melee_Attacks)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Melee_Attacks.getID(), &UpgradeTypes::Zerg_Melee_Attacks)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Missile_Attacks", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Missile_Attacks)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Missile_Attacks.getID(), &UpgradeTypes::Zerg_Missile_Attacks)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Flyer_Attacks", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Flyer_Attacks)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Flyer_Attacks.getID(), &UpgradeTypes::Zerg_Flyer_Attacks)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ventral_Sacs", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Ventral_Sacs)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Ventral_Sacs.getID(), &UpgradeTypes::Ventral_Sacs)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Antennae", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Antennae)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Antennae.getID(), &UpgradeTypes::Antennae)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Pneumatized_Carapace", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Pneumatized_Carapace)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Pneumatized_Carapace.getID(), &UpgradeTypes::Pneumatized_Carapace)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Metabolic_Boost", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Metabolic_Boost)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Metabolic_Boost.getID(), &UpgradeTypes::Metabolic_Boost)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Adrenal_Glands", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Adrenal_Glands)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Adrenal_Glands.getID(), &UpgradeTypes::Adrenal_Glands)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Muscular_Augments", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Muscular_Augments)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Muscular_Augments.getID(), &UpgradeTypes::Muscular_Augments)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Grooved_Spines", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Grooved_Spines)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Grooved_Spines.getID(), &UpgradeTypes::Grooved_Spines)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gamete_Meiosis", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Gamete_Meiosis)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Gamete_Meiosis.getID(), &UpgradeTypes::Gamete_Meiosis)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Metasynaptic_Node", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Metasynaptic_Node)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Metasynaptic_Node.getID(), &UpgradeTypes::Metasynaptic_Node)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Chitinous_Plating", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Chitinous_Plating)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Chitinous_Plating.getID(), &UpgradeTypes::Chitinous_Plating)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anabolic_Synthesis", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Anabolic_Synthesis)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Anabolic_Synthesis.getID(), &UpgradeTypes::Anabolic_Synthesis)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Ground_Armor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Ground_Armor)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Ground_Armor.getID(), &UpgradeTypes::Protoss_Ground_Armor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Air_Armor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Air_Armor)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Air_Armor.getID(), &UpgradeTypes::Protoss_Air_Armor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Ground_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Ground_Weapons)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Ground_Weapons.getID(), &UpgradeTypes::Protoss_Ground_Weapons)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Air_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Air_Weapons)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Air_Weapons.getID(), &UpgradeTypes::Protoss_Air_Weapons)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Plasma_Shields", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Plasma_Shields)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Plasma_Shields.getID(), &UpgradeTypes::Protoss_Plasma_Shields)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Singularity_Charge", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Singularity_Charge)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Singularity_Charge.getID(), &UpgradeTypes::Singularity_Charge)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Leg_Enhancements", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Leg_Enhancements)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Leg_Enhancements.getID(), &UpgradeTypes::Leg_Enhancements)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Scarab_Damage", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Scarab_Damage)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Scarab_Damage.getID(), &UpgradeTypes::Scarab_Damage)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Reaver_Capacity", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Reaver_Capacity)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Reaver_Capacity.getID(), &UpgradeTypes::Reaver_Capacity)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gravitic_Drive", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Gravitic_Drive)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Gravitic_Drive.getID(), &UpgradeTypes::Gravitic_Drive)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Sensor_Array", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Sensor_Array)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Sensor_Array.getID(), &UpgradeTypes::Sensor_Array)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gravitic_Boosters", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Gravitic_Boosters)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Gravitic_Boosters.getID(), &UpgradeTypes::Gravitic_Boosters)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Khaydarin_Amulet", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Khaydarin_Amulet)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Khaydarin_Amulet.getID(), &UpgradeTypes::Khaydarin_Amulet)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Apial_Sensors", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Apial_Sensors)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Apial_Sensors.getID(), &UpgradeTypes::Apial_Sensors)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gravitic_Thrusters", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Gravitic_Thrusters)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Gravitic_Thrusters.getID(), &UpgradeTypes::Gravitic_Thrusters)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Carrier_Capacity", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Carrier_Capacity)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Carrier_Capacity.getID(), &UpgradeTypes::Carrier_Capacity)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Khaydarin_Core", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Khaydarin_Core)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Khaydarin_Core.getID(), &UpgradeTypes::Khaydarin_Core)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Argus_Jewel", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Argus_Jewel)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Argus_Jewel.getID(), &UpgradeTypes::Argus_Jewel)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Argus_Talisman", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Argus_Talisman)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Argus_Talisman.getID(), &UpgradeTypes::Argus_Talisman)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Upgrade_60", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Upgrade_60)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Upgrade_60.getID(), &UpgradeTypes::Upgrade_60)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::None)); -tableUpgradeType.insert(std::pair(UpgradeTypes::None.getID(), &UpgradeTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Unknown)); -tableUpgradeType.insert(std::pair(UpgradeTypes::Unknown.getID(), &UpgradeTypes::Unknown)); -cls = env->FindClass("Lbwapi/WeaponType;"); -getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/WeaponType;"); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gauss_Rifle", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Gauss_Rifle)); -tableWeaponType.insert(std::pair(WeaponTypes::Gauss_Rifle.getID(), &WeaponTypes::Gauss_Rifle)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gauss_Rifle_Jim_Raynor", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Gauss_Rifle_Jim_Raynor)); -tableWeaponType.insert(std::pair(WeaponTypes::Gauss_Rifle_Jim_Raynor.getID(), &WeaponTypes::Gauss_Rifle_Jim_Raynor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle)); -tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle.getID(), &WeaponTypes::C_10_Canister_Rifle)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Sarah_Kerrigan", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle_Sarah_Kerrigan)); -tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle_Sarah_Kerrigan.getID(), &WeaponTypes::C_10_Canister_Rifle_Sarah_Kerrigan)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Samir_Duran", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle_Samir_Duran)); -tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle_Samir_Duran.getID(), &WeaponTypes::C_10_Canister_Rifle_Samir_Duran)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Infested_Duran", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle_Infested_Duran)); -tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle_Infested_Duran.getID(), &WeaponTypes::C_10_Canister_Rifle_Infested_Duran)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Alexei_Stukov", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle_Alexei_Stukov)); -tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle_Alexei_Stukov.getID(), &WeaponTypes::C_10_Canister_Rifle_Alexei_Stukov)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fragmentation_Grenade", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Fragmentation_Grenade)); -tableWeaponType.insert(std::pair(WeaponTypes::Fragmentation_Grenade.getID(), &WeaponTypes::Fragmentation_Grenade)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fragmentation_Grenade_Jim_Raynor", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Fragmentation_Grenade_Jim_Raynor)); -tableWeaponType.insert(std::pair(WeaponTypes::Fragmentation_Grenade_Jim_Raynor.getID(), &WeaponTypes::Fragmentation_Grenade_Jim_Raynor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spider_Mines", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Spider_Mines)); -tableWeaponType.insert(std::pair(WeaponTypes::Spider_Mines.getID(), &WeaponTypes::Spider_Mines)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Twin_Autocannons", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Twin_Autocannons)); -tableWeaponType.insert(std::pair(WeaponTypes::Twin_Autocannons.getID(), &WeaponTypes::Twin_Autocannons)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Twin_Autocannons_Alan_Schezar", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Twin_Autocannons_Alan_Schezar)); -tableWeaponType.insert(std::pair(WeaponTypes::Twin_Autocannons_Alan_Schezar.getID(), &WeaponTypes::Twin_Autocannons_Alan_Schezar)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hellfire_Missile_Pack", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Hellfire_Missile_Pack)); -tableWeaponType.insert(std::pair(WeaponTypes::Hellfire_Missile_Pack.getID(), &WeaponTypes::Hellfire_Missile_Pack)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hellfire_Missile_Pack_Alan_Schezar", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Hellfire_Missile_Pack_Alan_Schezar)); -tableWeaponType.insert(std::pair(WeaponTypes::Hellfire_Missile_Pack_Alan_Schezar.getID(), &WeaponTypes::Hellfire_Missile_Pack_Alan_Schezar)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Arclite_Cannon)); -tableWeaponType.insert(std::pair(WeaponTypes::Arclite_Cannon.getID(), &WeaponTypes::Arclite_Cannon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Cannon_Edmund_Duke", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Arclite_Cannon_Edmund_Duke)); -tableWeaponType.insert(std::pair(WeaponTypes::Arclite_Cannon_Edmund_Duke.getID(), &WeaponTypes::Arclite_Cannon_Edmund_Duke)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fusion_Cutter", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Fusion_Cutter)); -tableWeaponType.insert(std::pair(WeaponTypes::Fusion_Cutter.getID(), &WeaponTypes::Fusion_Cutter)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gemini_Missiles", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Gemini_Missiles)); -tableWeaponType.insert(std::pair(WeaponTypes::Gemini_Missiles.getID(), &WeaponTypes::Gemini_Missiles)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gemini_Missiles_Tom_Kazansky", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Gemini_Missiles_Tom_Kazansky)); -tableWeaponType.insert(std::pair(WeaponTypes::Gemini_Missiles_Tom_Kazansky.getID(), &WeaponTypes::Gemini_Missiles_Tom_Kazansky)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burst_Lasers", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Burst_Lasers)); -tableWeaponType.insert(std::pair(WeaponTypes::Burst_Lasers.getID(), &WeaponTypes::Burst_Lasers)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burst_Lasers_Tom_Kazansky", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Burst_Lasers_Tom_Kazansky)); -tableWeaponType.insert(std::pair(WeaponTypes::Burst_Lasers_Tom_Kazansky.getID(), &WeaponTypes::Burst_Lasers_Tom_Kazansky)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATS_Laser_Battery", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATS_Laser_Battery)); -tableWeaponType.insert(std::pair(WeaponTypes::ATS_Laser_Battery.getID(), &WeaponTypes::ATS_Laser_Battery)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATS_Laser_Battery_Hero", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATS_Laser_Battery_Hero)); -tableWeaponType.insert(std::pair(WeaponTypes::ATS_Laser_Battery_Hero.getID(), &WeaponTypes::ATS_Laser_Battery_Hero)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATS_Laser_Battery_Hyperion", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATS_Laser_Battery_Hyperion)); -tableWeaponType.insert(std::pair(WeaponTypes::ATS_Laser_Battery_Hyperion.getID(), &WeaponTypes::ATS_Laser_Battery_Hyperion)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATA_Laser_Battery", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATA_Laser_Battery)); -tableWeaponType.insert(std::pair(WeaponTypes::ATA_Laser_Battery.getID(), &WeaponTypes::ATA_Laser_Battery)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATA_Laser_Battery_Hero", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATA_Laser_Battery_Hero)); -tableWeaponType.insert(std::pair(WeaponTypes::ATA_Laser_Battery_Hero.getID(), &WeaponTypes::ATA_Laser_Battery_Hero)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATA_Laser_Battery_Hyperion", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATA_Laser_Battery_Hyperion)); -tableWeaponType.insert(std::pair(WeaponTypes::ATA_Laser_Battery_Hyperion.getID(), &WeaponTypes::ATA_Laser_Battery_Hyperion)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Flame_Thrower", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Flame_Thrower)); -tableWeaponType.insert(std::pair(WeaponTypes::Flame_Thrower.getID(), &WeaponTypes::Flame_Thrower)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Flame_Thrower_Gui_Montag", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Flame_Thrower_Gui_Montag)); -tableWeaponType.insert(std::pair(WeaponTypes::Flame_Thrower_Gui_Montag.getID(), &WeaponTypes::Flame_Thrower_Gui_Montag)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Shock_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Arclite_Shock_Cannon)); -tableWeaponType.insert(std::pair(WeaponTypes::Arclite_Shock_Cannon.getID(), &WeaponTypes::Arclite_Shock_Cannon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Shock_Cannon_Edmund_Duke", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Arclite_Shock_Cannon_Edmund_Duke)); -tableWeaponType.insert(std::pair(WeaponTypes::Arclite_Shock_Cannon_Edmund_Duke.getID(), &WeaponTypes::Arclite_Shock_Cannon_Edmund_Duke)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Longbolt_Missile", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Longbolt_Missile)); -tableWeaponType.insert(std::pair(WeaponTypes::Longbolt_Missile.getID(), &WeaponTypes::Longbolt_Missile)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Claws", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Claws)); -tableWeaponType.insert(std::pair(WeaponTypes::Claws.getID(), &WeaponTypes::Claws)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Claws_Devouring_One", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Claws_Devouring_One)); -tableWeaponType.insert(std::pair(WeaponTypes::Claws_Devouring_One.getID(), &WeaponTypes::Claws_Devouring_One)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Claws_Infested_Kerrigan", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Claws_Infested_Kerrigan)); -tableWeaponType.insert(std::pair(WeaponTypes::Claws_Infested_Kerrigan.getID(), &WeaponTypes::Claws_Infested_Kerrigan)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Needle_Spines", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Needle_Spines)); -tableWeaponType.insert(std::pair(WeaponTypes::Needle_Spines.getID(), &WeaponTypes::Needle_Spines)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Needle_Spines_Hunter_Killer", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Needle_Spines_Hunter_Killer)); -tableWeaponType.insert(std::pair(WeaponTypes::Needle_Spines_Hunter_Killer.getID(), &WeaponTypes::Needle_Spines_Hunter_Killer)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Kaiser_Blades", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Kaiser_Blades)); -tableWeaponType.insert(std::pair(WeaponTypes::Kaiser_Blades.getID(), &WeaponTypes::Kaiser_Blades)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Kaiser_Blades_Torrasque", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Kaiser_Blades_Torrasque)); -tableWeaponType.insert(std::pair(WeaponTypes::Kaiser_Blades_Torrasque.getID(), &WeaponTypes::Kaiser_Blades_Torrasque)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Toxic_Spores", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Toxic_Spores)); -tableWeaponType.insert(std::pair(WeaponTypes::Toxic_Spores.getID(), &WeaponTypes::Toxic_Spores)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spines", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Spines)); -tableWeaponType.insert(std::pair(WeaponTypes::Spines.getID(), &WeaponTypes::Spines)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Acid_Spore", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Acid_Spore)); -tableWeaponType.insert(std::pair(WeaponTypes::Acid_Spore.getID(), &WeaponTypes::Acid_Spore)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Acid_Spore_Kukulza", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Acid_Spore_Kukulza)); -tableWeaponType.insert(std::pair(WeaponTypes::Acid_Spore_Kukulza.getID(), &WeaponTypes::Acid_Spore_Kukulza)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Glave_Wurm", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Glave_Wurm)); -tableWeaponType.insert(std::pair(WeaponTypes::Glave_Wurm.getID(), &WeaponTypes::Glave_Wurm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Glave_Wurm_Kukulza", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Glave_Wurm_Kukulza)); -tableWeaponType.insert(std::pair(WeaponTypes::Glave_Wurm_Kukulza.getID(), &WeaponTypes::Glave_Wurm_Kukulza)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Seeker_Spores", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Seeker_Spores)); -tableWeaponType.insert(std::pair(WeaponTypes::Seeker_Spores.getID(), &WeaponTypes::Seeker_Spores)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Subterranean_Tentacle", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Subterranean_Tentacle)); -tableWeaponType.insert(std::pair(WeaponTypes::Subterranean_Tentacle.getID(), &WeaponTypes::Subterranean_Tentacle)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Suicide_Infested_Terran", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Suicide_Infested_Terran)); -tableWeaponType.insert(std::pair(WeaponTypes::Suicide_Infested_Terran.getID(), &WeaponTypes::Suicide_Infested_Terran)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Suicide_Scourge", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Suicide_Scourge)); -tableWeaponType.insert(std::pair(WeaponTypes::Suicide_Scourge.getID(), &WeaponTypes::Suicide_Scourge)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Particle_Beam", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Particle_Beam)); -tableWeaponType.insert(std::pair(WeaponTypes::Particle_Beam.getID(), &WeaponTypes::Particle_Beam)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psi_Blades", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psi_Blades)); -tableWeaponType.insert(std::pair(WeaponTypes::Psi_Blades.getID(), &WeaponTypes::Psi_Blades)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psi_Blades_Fenix", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psi_Blades_Fenix)); -tableWeaponType.insert(std::pair(WeaponTypes::Psi_Blades_Fenix.getID(), &WeaponTypes::Psi_Blades_Fenix)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Phase_Disruptor)); -tableWeaponType.insert(std::pair(WeaponTypes::Phase_Disruptor.getID(), &WeaponTypes::Phase_Disruptor)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor_Fenix", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Phase_Disruptor_Fenix)); -tableWeaponType.insert(std::pair(WeaponTypes::Phase_Disruptor_Fenix.getID(), &WeaponTypes::Phase_Disruptor_Fenix)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psi_Assault", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psi_Assault)); -tableWeaponType.insert(std::pair(WeaponTypes::Psi_Assault.getID(), &WeaponTypes::Psi_Assault)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Shockwave", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psionic_Shockwave)); -tableWeaponType.insert(std::pair(WeaponTypes::Psionic_Shockwave.getID(), &WeaponTypes::Psionic_Shockwave)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Shockwave_TZ_Archon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psionic_Shockwave_TZ_Archon)); -tableWeaponType.insert(std::pair(WeaponTypes::Psionic_Shockwave_TZ_Archon.getID(), &WeaponTypes::Psionic_Shockwave_TZ_Archon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dual_Photon_Blasters", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Dual_Photon_Blasters)); -tableWeaponType.insert(std::pair(WeaponTypes::Dual_Photon_Blasters.getID(), &WeaponTypes::Dual_Photon_Blasters)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dual_Photon_Blasters_Mojo", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Dual_Photon_Blasters_Mojo)); -tableWeaponType.insert(std::pair(WeaponTypes::Dual_Photon_Blasters_Mojo.getID(), &WeaponTypes::Dual_Photon_Blasters_Mojo)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dual_Photon_Blasters_Artanis", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Dual_Photon_Blasters_Artanis)); -tableWeaponType.insert(std::pair(WeaponTypes::Dual_Photon_Blasters_Artanis.getID(), &WeaponTypes::Dual_Photon_Blasters_Artanis)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anti_Matter_Missiles", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Anti_Matter_Missiles)); -tableWeaponType.insert(std::pair(WeaponTypes::Anti_Matter_Missiles.getID(), &WeaponTypes::Anti_Matter_Missiles)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anti_Matter_Missiles_Mojo", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Anti_Matter_Missiles_Mojo)); -tableWeaponType.insert(std::pair(WeaponTypes::Anti_Matter_Missiles_Mojo.getID(), &WeaponTypes::Anti_Matter_Missiles_Mojo)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anti_Matter_Missiles_Artanis", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Anti_Matter_Missiles_Artanis)); -tableWeaponType.insert(std::pair(WeaponTypes::Anti_Matter_Missiles_Artanis.getID(), &WeaponTypes::Anti_Matter_Missiles_Artanis)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Phase_Disruptor_Cannon)); -tableWeaponType.insert(std::pair(WeaponTypes::Phase_Disruptor_Cannon.getID(), &WeaponTypes::Phase_Disruptor_Cannon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor_Cannon_Danimoth", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Phase_Disruptor_Cannon_Danimoth)); -tableWeaponType.insert(std::pair(WeaponTypes::Phase_Disruptor_Cannon_Danimoth.getID(), &WeaponTypes::Phase_Disruptor_Cannon_Danimoth)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Pulse_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Pulse_Cannon)); -tableWeaponType.insert(std::pair(WeaponTypes::Pulse_Cannon.getID(), &WeaponTypes::Pulse_Cannon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "STS_Photon_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::STS_Photon_Cannon)); -tableWeaponType.insert(std::pair(WeaponTypes::STS_Photon_Cannon.getID(), &WeaponTypes::STS_Photon_Cannon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "STA_Photon_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::STA_Photon_Cannon)); -tableWeaponType.insert(std::pair(WeaponTypes::STA_Photon_Cannon.getID(), &WeaponTypes::STA_Photon_Cannon)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Scarab", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Scarab)); -tableWeaponType.insert(std::pair(WeaponTypes::Scarab.getID(), &WeaponTypes::Scarab)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Neutron_Flare", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Neutron_Flare)); -tableWeaponType.insert(std::pair(WeaponTypes::Neutron_Flare.getID(), &WeaponTypes::Neutron_Flare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Halo_Rockets", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Halo_Rockets)); -tableWeaponType.insert(std::pair(WeaponTypes::Halo_Rockets.getID(), &WeaponTypes::Halo_Rockets)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Corrosive_Acid", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Corrosive_Acid)); -tableWeaponType.insert(std::pair(WeaponTypes::Corrosive_Acid.getID(), &WeaponTypes::Corrosive_Acid)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Subterranean_Spines", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Subterranean_Spines)); -tableWeaponType.insert(std::pair(WeaponTypes::Subterranean_Spines.getID(), &WeaponTypes::Subterranean_Spines)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Warp_Blades", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Warp_Blades)); -tableWeaponType.insert(std::pair(WeaponTypes::Warp_Blades.getID(), &WeaponTypes::Warp_Blades)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Warp_Blades_Hero", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Warp_Blades_Hero)); -tableWeaponType.insert(std::pair(WeaponTypes::Warp_Blades_Hero.getID(), &WeaponTypes::Warp_Blades_Hero)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Warp_Blades_Zeratul", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Warp_Blades_Zeratul)); -tableWeaponType.insert(std::pair(WeaponTypes::Warp_Blades_Zeratul.getID(), &WeaponTypes::Warp_Blades_Zeratul)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Independant_Laser_Battery", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Independant_Laser_Battery)); -tableWeaponType.insert(std::pair(WeaponTypes::Independant_Laser_Battery.getID(), &WeaponTypes::Independant_Laser_Battery)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Twin_Autocannons_Floor_Trap", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Twin_Autocannons_Floor_Trap)); -tableWeaponType.insert(std::pair(WeaponTypes::Twin_Autocannons_Floor_Trap.getID(), &WeaponTypes::Twin_Autocannons_Floor_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hellfire_Missile_Pack_Wall_Trap", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Hellfire_Missile_Pack_Wall_Trap)); -tableWeaponType.insert(std::pair(WeaponTypes::Hellfire_Missile_Pack_Wall_Trap.getID(), &WeaponTypes::Hellfire_Missile_Pack_Wall_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Flame_Thrower_Wall_Trap", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Flame_Thrower_Wall_Trap)); -tableWeaponType.insert(std::pair(WeaponTypes::Flame_Thrower_Wall_Trap.getID(), &WeaponTypes::Flame_Thrower_Wall_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hellfire_Missile_Pack_Floor_Trap", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Hellfire_Missile_Pack_Floor_Trap)); -tableWeaponType.insert(std::pair(WeaponTypes::Hellfire_Missile_Pack_Floor_Trap.getID(), &WeaponTypes::Hellfire_Missile_Pack_Floor_Trap)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Yamato_Gun", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Yamato_Gun)); -tableWeaponType.insert(std::pair(WeaponTypes::Yamato_Gun.getID(), &WeaponTypes::Yamato_Gun)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Nuclear_Strike", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Nuclear_Strike)); -tableWeaponType.insert(std::pair(WeaponTypes::Nuclear_Strike.getID(), &WeaponTypes::Nuclear_Strike)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lockdown", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Lockdown)); -tableWeaponType.insert(std::pair(WeaponTypes::Lockdown.getID(), &WeaponTypes::Lockdown)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EMP_Shockwave", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::EMP_Shockwave)); -tableWeaponType.insert(std::pair(WeaponTypes::EMP_Shockwave.getID(), &WeaponTypes::EMP_Shockwave)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Irradiate", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Irradiate)); -tableWeaponType.insert(std::pair(WeaponTypes::Irradiate.getID(), &WeaponTypes::Irradiate)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Parasite", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Parasite)); -tableWeaponType.insert(std::pair(WeaponTypes::Parasite.getID(), &WeaponTypes::Parasite)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spawn_Broodlings", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Spawn_Broodlings)); -tableWeaponType.insert(std::pair(WeaponTypes::Spawn_Broodlings.getID(), &WeaponTypes::Spawn_Broodlings)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ensnare", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Ensnare)); -tableWeaponType.insert(std::pair(WeaponTypes::Ensnare.getID(), &WeaponTypes::Ensnare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dark_Swarm", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Dark_Swarm)); -tableWeaponType.insert(std::pair(WeaponTypes::Dark_Swarm.getID(), &WeaponTypes::Dark_Swarm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Plague", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Plague)); -tableWeaponType.insert(std::pair(WeaponTypes::Plague.getID(), &WeaponTypes::Plague)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Consume", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Consume)); -tableWeaponType.insert(std::pair(WeaponTypes::Consume.getID(), &WeaponTypes::Consume)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stasis_Field", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Stasis_Field)); -tableWeaponType.insert(std::pair(WeaponTypes::Stasis_Field.getID(), &WeaponTypes::Stasis_Field)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Storm", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psionic_Storm)); -tableWeaponType.insert(std::pair(WeaponTypes::Psionic_Storm.getID(), &WeaponTypes::Psionic_Storm)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Disruption_Web", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Disruption_Web)); -tableWeaponType.insert(std::pair(WeaponTypes::Disruption_Web.getID(), &WeaponTypes::Disruption_Web)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Restoration", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Restoration)); -tableWeaponType.insert(std::pair(WeaponTypes::Restoration.getID(), &WeaponTypes::Restoration)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Mind_Control", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Mind_Control)); -tableWeaponType.insert(std::pair(WeaponTypes::Mind_Control.getID(), &WeaponTypes::Mind_Control)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Feedback", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Feedback)); -tableWeaponType.insert(std::pair(WeaponTypes::Feedback.getID(), &WeaponTypes::Feedback)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Optical_Flare", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Optical_Flare)); -tableWeaponType.insert(std::pair(WeaponTypes::Optical_Flare.getID(), &WeaponTypes::Optical_Flare)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Maelstrom", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Maelstrom)); -tableWeaponType.insert(std::pair(WeaponTypes::Maelstrom.getID(), &WeaponTypes::Maelstrom)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::None)); -tableWeaponType.insert(std::pair(WeaponTypes::None.getID(), &WeaponTypes::None)); -env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Unknown)); -tableWeaponType.insert(std::pair(WeaponTypes::Unknown.getID(), &WeaponTypes::Unknown)); -println("Connecting to Broodwar..."); - reconnect(); - println("Connection successful, starting match..."); - - cls = env->GetObjectClass(obj); - jclass gamecls = env->FindClass("Lbwapi/Game;"); - jclass unitCls = env->FindClass("Lbwapi/Unit;"); - jclass playerCls = env->FindClass("Lbwapi/Player;"); - jclass posCls = env->FindClass("Lbwapi/Position;"); - jobject moduleObj = env->GetObjectField(obj, env->GetFieldID(cls, "module", "Lbwapi/AIModule;")); - jclass moduleCls = env->GetObjectClass(moduleObj); - env->SetObjectField(obj, env->GetFieldID(cls, "game", "Lbwapi/Game;"), env->CallStaticObjectMethod(gamecls, env->GetStaticMethodID(gamecls, "get", "(J)Lbwapi/Game;"), (long)BroodwarPtr)); - - jmethodID updateMethodID = env->GetMethodID(env->GetObjectClass(obj), "update", "()V"); - jmethodID matchStartCallback = env->GetMethodID(moduleCls, "onStart", "()V"); - jmethodID matchEndCallback = env->GetMethodID(moduleCls, "onEnd", "(Z)V"); - jmethodID matchFrameCallback = env->GetMethodID(moduleCls, "onFrame", "()V"); - jmethodID sendTextCallback = env->GetMethodID(moduleCls, "onSendText", "(Ljava/lang/String;)V"); - jmethodID receiveTextCallback = env->GetMethodID(moduleCls, "onReceiveText", "(Lbwapi/Player;Ljava/lang/String;)V"); - jmethodID playerLeftCallback = env->GetMethodID(moduleCls, "onPlayerLeft", "(Lbwapi/Player;)V"); - jmethodID nukeDetectCallback = env->GetMethodID(moduleCls, "onNukeDetect", "(Lbwapi/Position;)V"); - jmethodID unitDiscoverCallback = env->GetMethodID(moduleCls, "onUnitDiscover", "(Lbwapi/Unit;)V"); - jmethodID unitEvadeCallback = env->GetMethodID(moduleCls, "onUnitEvade", "(Lbwapi/Unit;)V"); - jmethodID unitShowCallback = env->GetMethodID(moduleCls, "onUnitShow", "(Lbwapi/Unit;)V"); - jmethodID unitHideCallback = env->GetMethodID(moduleCls, "onUnitHide", "(Lbwapi/Unit;)V"); - jmethodID unitCreateCallback = env->GetMethodID(moduleCls, "onUnitCreate", "(Lbwapi/Unit;)V"); - jmethodID unitDestroyCallback = env->GetMethodID(moduleCls, "onUnitDestroy", "(Lbwapi/Unit;)V"); - jmethodID unitMorphCallback = env->GetMethodID(moduleCls, "onUnitMorph", "(Lbwapi/Unit;)V"); - jmethodID unitRenegadeCallback = env->GetMethodID(moduleCls, "onUnitRenegade", "(Lbwapi/Unit;)V"); - jmethodID saveGameCallback = env->GetMethodID(moduleCls, "onSaveGame", "(Ljava/lang/String;)V"); - jmethodID unitCompleteCallback = env->GetMethodID(moduleCls, "onUnitComplete", "(Lbwapi/Unit;)V"); - jmethodID playerDroppedCallback = env->GetMethodID(moduleCls, "onPlayerDropped", "(Lbwapi/Player;)V"); - while (true) { - - println("Waiting..."); -while ( !Broodwar->isInGame() ) - { - BWAPI::BWAPIClient.update(); - if (!BWAPI::BWAPIClient.isConnected()) - { - println("Reconnecting..."); - reconnect(); - } - } - println("Game ready!!!"); - - while (Broodwar->isInGame()) { - - env->CallVoidMethod(obj, updateMethodID); - - - for(std::list::const_iterator it = Broodwar->getEvents().begin(); it!=Broodwar->getEvents().end(); it++) - { - switch (it->getType()) { - case EventType::MatchStart: - env->CallVoidMethod(moduleObj, matchStartCallback); - break; - case EventType::MatchEnd: - env->CallVoidMethod(moduleObj, matchEndCallback, it->isWinner()); - break; - case EventType::MatchFrame: - env->CallVoidMethod(moduleObj, matchFrameCallback); - break; - case EventType::SendText: - env->CallVoidMethod(moduleObj, sendTextCallback, env->NewStringUTF(it->getText().c_str())); - break; - case EventType::ReceiveText: - env->CallVoidMethod(moduleObj, receiveTextCallback, env->CallStaticObjectMethod(playerCls, env->GetStaticMethodID(playerCls, "get", "(J)Lbwapi/Player;"), (jlong)it->getPlayer()), env->NewStringUTF(it->getText().c_str())); - break; - case EventType::PlayerLeft: - env->CallVoidMethod(moduleObj, playerLeftCallback, env->CallStaticObjectMethod(playerCls, env->GetStaticMethodID(playerCls, "get", "(J)Lbwapi/Player;"), (jlong)it->getPlayer())); - break; - case EventType::NukeDetect: - env->CallVoidMethod(moduleObj, nukeDetectCallback, env->NewObject(posCls, env->GetMethodID(posCls,"", "(II)V"), it->getPosition().x, it->getPosition().y)); - break; - case EventType::UnitDiscover: - env->CallVoidMethod(moduleObj, unitDiscoverCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); - break; - case EventType::UnitEvade: - env->CallVoidMethod(moduleObj, unitEvadeCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); - break; - case EventType::UnitShow: - env->CallVoidMethod(moduleObj, unitShowCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); - break; - case EventType::UnitHide: - env->CallVoidMethod(moduleObj, unitHideCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); - break; - case EventType::UnitCreate: - env->CallVoidMethod(moduleObj, unitCreateCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); - break; - case EventType::UnitDestroy: - env->CallVoidMethod(moduleObj, unitDestroyCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); - break; - case EventType::UnitMorph: - env->CallVoidMethod(moduleObj, unitMorphCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); - break; - case EventType::UnitRenegade: - env->CallVoidMethod(moduleObj, unitRenegadeCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); - break; - case EventType::SaveGame: - env->CallVoidMethod(moduleObj, saveGameCallback, env->NewStringUTF(it->getText().c_str())); - break; - case EventType::UnitComplete: - env->CallVoidMethod(moduleObj, unitCompleteCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); - break; - - } - } - BWAPIClient.update(); - if (!BWAPI::BWAPIClient.isConnected()) { - println("Reconnecting..."); - reconnect(); - } - } -println("Match ended."); } -} - diff --git a/generator/pom.xml b/generator/pom.xml new file mode 100644 index 0000000..f602914 --- /dev/null +++ b/generator/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + bwmirror + generator + 1.0 + jar + + + + org.jsoup + jsoup + 1.7.3 + + + commons-io + commons-io + 2.5 + + + + BWMirror Generator + Tool for preparing BWMirror Java sources and generating JNI C++ sources for integration with BWAPI and BWTA2. + + + + GNU Lesser General Public License v3.0 + https://www.gnu.org/licenses/lgpl.html + + + + + 1.7 + 1.7 + + + \ No newline at end of file diff --git a/src/api/DefaultEventListener.java b/generator/src/main/java/bwmirror/api/DefaultEventListener.java similarity index 80% rename from src/api/DefaultEventListener.java rename to generator/src/main/java/bwmirror/api/DefaultEventListener.java index 571512b..14bfeae 100644 --- a/src/api/DefaultEventListener.java +++ b/generator/src/main/java/bwmirror/api/DefaultEventListener.java @@ -1,14 +1,10 @@ -package api; +package bwmirror.api; -import c.CClass; -import c.CDeclaration; -import c.Param; -import generator.Generator; -import generator.MirrorContext; -import generator.PackageProcessOptions; -import impl.Function; +import bwmirror.c.CDeclaration; +import bwmirror.generator.Generator; +import bwmirror.generator.MirrorContext; +import bwmirror.generator.PackageProcessOptions; -import java.util.ArrayList; import java.util.List; /** diff --git a/src/api/GeneratorEventListener.java b/generator/src/main/java/bwmirror/api/GeneratorEventListener.java similarity index 79% rename from src/api/GeneratorEventListener.java rename to generator/src/main/java/bwmirror/api/GeneratorEventListener.java index deb6582..4394ab3 100644 --- a/src/api/GeneratorEventListener.java +++ b/generator/src/main/java/bwmirror/api/GeneratorEventListener.java @@ -1,9 +1,9 @@ -package api; +package bwmirror.api; -import c.CDeclaration; -import generator.Generator; -import generator.MirrorContext; -import generator.PackageProcessOptions; +import bwmirror.c.CDeclaration; +import bwmirror.generator.Generator; +import bwmirror.generator.MirrorContext; +import bwmirror.generator.PackageProcessOptions; import java.util.List; diff --git a/src/c/CClass.java b/generator/src/main/java/bwmirror/c/CClass.java similarity index 92% rename from src/c/CClass.java rename to generator/src/main/java/bwmirror/c/CClass.java index 89fdc87..12aaf4e 100644 --- a/src/c/CClass.java +++ b/generator/src/main/java/bwmirror/c/CClass.java @@ -1,4 +1,4 @@ -package c; +package bwmirror.c; import java.util.List; diff --git a/src/c/CDeclaration.java b/generator/src/main/java/bwmirror/c/CDeclaration.java similarity index 93% rename from src/c/CDeclaration.java rename to generator/src/main/java/bwmirror/c/CDeclaration.java index 2a91452..2c8f287 100644 --- a/src/c/CDeclaration.java +++ b/generator/src/main/java/bwmirror/c/CDeclaration.java @@ -1,4 +1,4 @@ -package c; +package bwmirror.c; /** * Created with IntelliJ IDEA. diff --git a/src/c/CEnum.java b/generator/src/main/java/bwmirror/c/CEnum.java similarity index 92% rename from src/c/CEnum.java rename to generator/src/main/java/bwmirror/c/CEnum.java index 04dd535..889703d 100644 --- a/src/c/CEnum.java +++ b/generator/src/main/java/bwmirror/c/CEnum.java @@ -1,4 +1,4 @@ -package c; +package bwmirror.c; import java.util.List; diff --git a/src/c/Constant.java b/generator/src/main/java/bwmirror/c/Constant.java similarity index 89% rename from src/c/Constant.java rename to generator/src/main/java/bwmirror/c/Constant.java index 43b69e2..4a3b365 100644 --- a/src/c/Constant.java +++ b/generator/src/main/java/bwmirror/c/Constant.java @@ -1,4 +1,4 @@ -package c; +package bwmirror.c; /** * Created with IntelliJ IDEA. diff --git a/src/c/DeclarationType.java b/generator/src/main/java/bwmirror/c/DeclarationType.java similarity index 88% rename from src/c/DeclarationType.java rename to generator/src/main/java/bwmirror/c/DeclarationType.java index e1a8293..7df3378 100644 --- a/src/c/DeclarationType.java +++ b/generator/src/main/java/bwmirror/c/DeclarationType.java @@ -1,4 +1,4 @@ -package c; +package bwmirror.c; /** * User: PC diff --git a/src/c/EnumValue.java b/generator/src/main/java/bwmirror/c/EnumValue.java similarity index 81% rename from src/c/EnumValue.java rename to generator/src/main/java/bwmirror/c/EnumValue.java index d36d089..178099e 100644 --- a/src/c/EnumValue.java +++ b/generator/src/main/java/bwmirror/c/EnumValue.java @@ -1,6 +1,6 @@ -package c; +package bwmirror.c; -import util.Pair; +import bwmirror.util.Pair; /** * User: PC diff --git a/src/c/Field.java b/generator/src/main/java/bwmirror/c/Field.java similarity index 90% rename from src/c/Field.java rename to generator/src/main/java/bwmirror/c/Field.java index 0a0609d..fdda9d6 100644 --- a/src/c/Field.java +++ b/generator/src/main/java/bwmirror/c/Field.java @@ -1,4 +1,4 @@ -package c; +package bwmirror.c; /** * Created with IntelliJ IDEA. diff --git a/src/c/Method.java b/generator/src/main/java/bwmirror/c/Method.java similarity index 83% rename from src/c/Method.java rename to generator/src/main/java/bwmirror/c/Method.java index 36daa90..ccc7351 100644 --- a/src/c/Method.java +++ b/generator/src/main/java/bwmirror/c/Method.java @@ -1,7 +1,4 @@ -package c; - -import util.Pair; -import util.Triple; +package bwmirror.c; import java.util.List; diff --git a/src/c/Param.java b/generator/src/main/java/bwmirror/c/Param.java similarity index 89% rename from src/c/Param.java rename to generator/src/main/java/bwmirror/c/Param.java index 51421bb..2619151 100644 --- a/src/c/Param.java +++ b/generator/src/main/java/bwmirror/c/Param.java @@ -1,6 +1,6 @@ -package c; +package bwmirror.c; -import util.Triple; +import bwmirror.util.Triple; /** * Created with IntelliJ IDEA. diff --git a/src/c/Variable.java b/generator/src/main/java/bwmirror/c/Variable.java similarity index 87% rename from src/c/Variable.java rename to generator/src/main/java/bwmirror/c/Variable.java index 95a80e3..cd0db82 100644 --- a/src/c/Variable.java +++ b/generator/src/main/java/bwmirror/c/Variable.java @@ -1,4 +1,4 @@ -package c; +package bwmirror.c; /** * Created with IntelliJ IDEA. diff --git a/src/compile/JavaSourceFile.java b/generator/src/main/java/bwmirror/compile/JavaSourceFile.java similarity index 88% rename from src/compile/JavaSourceFile.java rename to generator/src/main/java/bwmirror/compile/JavaSourceFile.java index 6784034..55dd6e4 100644 --- a/src/compile/JavaSourceFile.java +++ b/generator/src/main/java/bwmirror/compile/JavaSourceFile.java @@ -1,6 +1,6 @@ -package compile; +package bwmirror.compile; -import util.FileToString; +import bwmirror.util.FileToString; import javax.tools.SimpleJavaFileObject; import java.io.File; diff --git a/src/generator/CJavaPipeline.java b/generator/src/main/java/bwmirror/generator/CJavaPipeline.java similarity index 51% rename from src/generator/CJavaPipeline.java rename to generator/src/main/java/bwmirror/generator/CJavaPipeline.java index 69ceee8..c7a7d34 100644 --- a/src/generator/CJavaPipeline.java +++ b/generator/src/main/java/bwmirror/generator/CJavaPipeline.java @@ -1,23 +1,24 @@ -package generator; +package bwmirror.generator; -import api.DefaultEventListener; -import api.GeneratorEventListener; -import c.CClass; -import c.CDeclaration; -import c.CEnum; -import c.DeclarationType; -import generator.c.Bind; -import generator.c.HeaderMaker; -import generator.c.IdCache; -import generator.c.TypeTable; -import generator.ccalls.CallImplementer; -import impl.CApiParser; -import impl.Clazz; -import inject.GetPolygonPointsInjector; -import util.FileUtils; +import bwmirror.api.DefaultEventListener; +import bwmirror.api.GeneratorEventListener; +import bwmirror.c.CClass; +import bwmirror.c.CDeclaration; +import bwmirror.c.CEnum; +import bwmirror.c.DeclarationType; +import bwmirror.generator.c.Bind; +import bwmirror.generator.c.HeaderMaker; +import bwmirror.generator.c.IdCache; +import bwmirror.generator.c.TypeTable; +import bwmirror.generator.ccalls.CallImplementer; +import bwmirror.impl.CApiParser; +import bwmirror.impl.Clazz; +import bwmirror.inject.GetPolygonPointsInjector; +import org.apache.commons.io.FileUtils; import java.io.*; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.util.*; @@ -30,20 +31,29 @@ import java.util.*; @SuppressWarnings("ConstantConditions") public class CJavaPipeline { - public static final int BWAPI_V3 = 3; - - public static final int BWAPI_V4 = 4; - - - public static int BWAPI_VERSION = BWAPI_V4; - /** * Classes from BWAPI 4 that don't need mirroring - * Not used in mirroring BWAPI 3 */ - private static final List ignoredClasses = new ArrayList<>(Arrays.asList("Client", "Vectorset", "ConstVectorset", "VSetIterator", "GameWrapper", - "Interface", "RectangleArray", "UnitImpl", "PlayerImpl", "GameImpl", "BulletImpl", "ForceImpl", "TournamentModule", "RegionImpl", "SetContainer", "InterfaceEvent", "PositionOrUnit", "Point")); - + private static final List ignoredClasses = new ArrayList<>(Arrays.asList( + "Client", + "Vectorset", + "ConstVectorset", + "VSetIterator", + "GameWrapper", + "Interface", + "RectangleArray", + "UnitImpl", + "PlayerImpl", + "GameImpl", + "BulletImpl", + "ForceImpl", + "TournamentModule", + "RegionImpl", + "SetContainer", + "InterfaceEvent", + "PositionOrUnit", + "Point" + )); private static final HashMap superClasses = new HashMap<>(); @@ -60,13 +70,46 @@ public class CJavaPipeline { listener = new GetPolygonPointsInjector(); } - public void run(PackageProcessOptions[] packages, Properties processingOptions) { + public void run(PackageProcessOptions[] packages, Properties processingOptions) throws Exception { + PackageProcessOptions bwapiOptions = packages[0]; + PackageProcessOptions bwtaOptions = packages[1]; + + System.out.println("BWAPI package processing options:"); + System.out.println(" cHeadersDir = " + bwapiOptions.cHeadersDir); + System.out.println(" manualCopyClassesDir = " + bwapiOptions.manualCopyClassesDir); + System.out.println(); + + System.out.println("BWTA package processing options:"); + System.out.println(" cHeadersDir = " + bwtaOptions.cHeadersDir); + System.out.println(" manualCopyClassesDir = " + bwtaOptions.manualCopyClassesDir); + System.out.println(); + + System.out.println("Processing options:"); + for (String propKey : processingOptions.stringPropertyNames()) + System.out.println(" " + propKey + " = " + processingOptions.getProperty(propKey)); + + // some input path/files sanity checking first ... + if (bwapiOptions.cHeadersDir != null && !bwapiOptions.cHeadersDir.exists()) + throw new FileNotFoundException("BWAPI cHeadersDir not found: " + bwapiOptions.cHeadersDir.toString()); + if (bwapiOptions.manualCopyClassesDir != null && !bwapiOptions.manualCopyClassesDir.exists()) + throw new FileNotFoundException("BWAPI manualCopyClassesDir not found: " + bwapiOptions.manualCopyClassesDir.toString()); + if (bwtaOptions.cHeadersDir != null && !bwtaOptions.cHeadersDir.exists()) + throw new FileNotFoundException("BWTA cHeadersDir not found: " + bwtaOptions.cHeadersDir.toString()); + if (bwtaOptions.manualCopyClassesDir != null && !bwtaOptions.manualCopyClassesDir.exists()) + throw new FileNotFoundException("BWTA manualCopyClassesDir not found: " + bwtaOptions.manualCopyClassesDir.toString()); + /** Init */ + System.out.println("\n\nInit"); + System.out.println("Cleaning existing generated output"); for (PackageProcessOptions pkg : packages) { - FileUtils.deleteDirectory(new File(pkg.packageName)); + FileUtils.deleteDirectory(new File(processingOptions.getProperty(GENERATE_TO_DIR) + "/" + pkg.packageName)); } + FileUtils.deleteDirectory(new File(processingOptions.getProperty(HEADERS_DIR_PROPERTY))); + FileUtils.deleteDirectory(new File(processingOptions.getProperty(COMPILE_DIR_PROPERTY))); + FileUtils.deleteDirectory(new File(processingOptions.getProperty(C_IMPLEMENTATION_FILE_PROPERTY)).getParentFile()); + FileUtils.deleteDirectory(new File(processingOptions.getProperty(HEADER_FILE_PROPERTY)).getParentFile()); MirrorContext context = new MirrorContext(); Generator generator = new Generator(context); @@ -76,6 +119,7 @@ public class CJavaPipeline { /** * Phase 1 & 2 - parse headers and create .java source files */ + System.out.println("\n\nPhase 1 & 2 - parse headers and create .java source files"); for (PackageProcessOptions pkg : packages) { CApiParser parser = new CApiParser(); @@ -125,11 +169,15 @@ public class CJavaPipeline { /** * Phase 3 - copy additional classes into api, such as Mirror.java, AIModule, EventListener, etc */ + System.out.println("\n\nPhase 3 - copy additional classes into api, such as Mirror.java, AIModule, EventListener, etc"); for (PackageProcessOptions pkg : packages) { if (pkg.manualCopyClassesDir != null) { try { for (File file : pkg.manualCopyClassesDir.listFiles()) { - Files.copy(file.getAbsoluteFile().toPath(), new File(processingOptions.get(GENERATE_TO_DIR) + "/" + pkg.packageName + "/" + file.getName()).getAbsoluteFile().toPath(), StandardCopyOption.REPLACE_EXISTING); + Path source = file.getAbsoluteFile().toPath(); + Path target = new File(processingOptions.get(GENERATE_TO_DIR) + "/" + pkg.packageName + "/" + file.getName()).getAbsoluteFile().toPath(); + System.out.println("File copy: " + source + " --> " + target); + Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING); } } catch (IOException e) { e.printStackTrace(); @@ -141,18 +189,25 @@ public class CJavaPipeline { /** * Phase 4 - compile .java sources */ + System.out.println("\n\nPhase 4 - compile .java sources"); File javaOut = new File(processingOptions.getProperty(COMPILE_DIR_PROPERTY)); MyJavaCompiler compiler = new MyJavaCompiler(); for (PackageProcessOptions pkg : packages) { - compiler.run(new File(processingOptions.get(GENERATE_TO_DIR) + "/" + pkg.packageName), javaOut); + if (!compiler.run(new File(processingOptions.get(GENERATE_TO_DIR) + "/" + pkg.packageName), javaOut)) { + System.out.println("\n\nAborting due to compile errors (see above)."); + System.exit(1); + return; + } } /** * Phase 5 - run javah to create header files for native functions */ + System.out.println("\n\nPhase 5 - run javah to create header files for native functions"); List packageDirNames = new ArrayList<>(); for (PackageProcessOptions pkg : packages) { + System.out.println("Adding package: " + pkg.packageName); packageDirNames.add(pkg.packageName); } HeaderMaker hm = new HeaderMaker(); @@ -161,12 +216,18 @@ public class CJavaPipeline { /** * Phase 6 - implementation of native functions */ - + System.out.println("\n\nPhase 6 - implementation of native functions"); JavaContext javaContext = new JavaContext(); CallImplementer callImplementer = new CallImplementer(javaContext); TypeTable typeTable = new TypeTable(); + File cImplFile = new File(processingOptions.getProperty(C_IMPLEMENTATION_FILE_PROPERTY)); + System.out.println("Using output native implementation source file: " + cImplFile); + File cImplDir = cImplFile.getParentFile(); + if (!cImplDir.exists()) + cImplDir.mkdirs(); + PrintStream out = null; try { out = new PrintStream(new FileOutputStream(new File(processingOptions.getProperty(C_IMPLEMENTATION_FILE_PROPERTY)))); @@ -180,6 +241,7 @@ public class CJavaPipeline { /** * Phase 6.1 - implement caches */ + System.out.println("\n\nPhase 6.1 - implement caches"); //caches for constants typeTable.implementTypeTable(allDecs); @@ -191,7 +253,7 @@ public class CJavaPipeline { /** * Phase 6.2 - implement the native function bodies */ - + System.out.println("\n\nPhase 6.2 - implement the native function bodies"); File headersDir = new File(processingOptions.getProperty(HEADERS_DIR_PROPERTY)); for (PackageProcessOptions pkg : packages) { @@ -210,6 +272,7 @@ public class CJavaPipeline { //pair each .java file with its native header file File header = new File(headersDir, pkg.packageName + "_" + file.getName().substring(0, file.getName().lastIndexOf(".")) + ".h"); + System.out.println("implementing natives in " + file + " using native header " + header); try { //implement the native method bodies callImplementer.implementMethodCalls(file, header); @@ -225,64 +288,74 @@ public class CJavaPipeline { * Phase 6.3 - bind the remaining part of the java API to the C part: * Bind constants together and create initialisation function */ - + System.out.println("\n\nPhase 6.3 - bind the remaining part of the java API to the C part"); javaContext.setPackageName(packages[0].packageName); Bind bind = new Bind(javaContext); bind.setOut(out); bind.implementBind(allDecs); + System.out.println("\n\nAll done."); } public static void main(String... args) { + String basePathString; + if (args.length > 0) + basePathString = args[0]; + else + // assumes running from this project's directory, which means the correct path to use in the + // current un-altered git repository layout is one level up from this one + basePathString = ".."; - if (BWAPI_VERSION == BWAPI_V3) { + File basePath = new File(basePathString); - PackageProcessOptions bwapiOptions = new PackageProcessOptions(); - bwapiOptions.packageName = "bwapi"; - bwapiOptions.cHeadersDir = new File("bwapi-master"); - bwapiOptions.manualCopyClassesDir = new File("manual-bwapi"); - - PackageProcessOptions bwtaOptions = new PackageProcessOptions(); - bwtaOptions.packageName = "bwta"; - bwtaOptions.cHeadersDir = new File("bwta-c"); - bwtaOptions.additionalImportClasses = Arrays.asList("bwapi.Position", "bwapi.TilePosition", "bwapi.Player"); - bwtaOptions.globalClassName = "BWTA"; - - Properties props = new Properties(); - props.put(COMPILE_DIR_PROPERTY, "compiled"); - props.put(HEADERS_DIR_PROPERTY, "headers"); - props.put(HEADER_FILE_PROPERTY, "concat_header.h"); - props.put(C_IMPLEMENTATION_FILE_PROPERTY, "c/impl.cpp"); - props.put(GENERATE_TO_DIR, "."); - - new CJavaPipeline().run(new PackageProcessOptions[]{bwapiOptions, bwtaOptions}, props); + if (!basePath.exists()) { + System.out.println("Working directory \"" + basePath + "\" does not exist. Exiting."); + System.exit(1); + return; } - if (BWAPI_VERSION == BWAPI_V4) { + System.out.println("Using base path: " + basePath.getPath()); + if (!basePath.isAbsolute()) + System.out.println("Absolute base path: " + basePath.getAbsolutePath()); + System.out.println(); + if (System.getenv("BWAPI_HOME") == null || !(new File(System.getenv("BWAPI_HOME")).exists())) { + System.out.println("Missing or unable to read environment variable BWAPI_HOME."); + System.exit(1); + return; + } + + if (System.getenv("BWTA_HOME") == null || !(new File(System.getenv("BWTA_HOME")).exists())) { + System.out.println("Missing or unable to read environment variable BWTA_HOME."); + System.exit(1); + return; + } + + try { ignoredClasses.add("Position"); PackageProcessOptions bwapiOptions = new PackageProcessOptions(); bwapiOptions.packageName = "bwapi"; - bwapiOptions.cHeadersDir = new File("bwapi4-includes"); - bwapiOptions.manualCopyClassesDir = new File("manual-bwapi4"); + bwapiOptions.cHeadersDir = new File(System.getenv("BWAPI_HOME") + "/include"); + bwapiOptions.manualCopyClassesDir = new File(basePath.getPath() + "/manual-bwapi-src"); PackageProcessOptions bwtaOptions = new PackageProcessOptions(); bwtaOptions.packageName = "bwta"; - bwtaOptions.cHeadersDir = new File("bwta2-c"); + bwtaOptions.cHeadersDir = new File(System.getenv("BWTA_HOME") + "/include"); bwtaOptions.additionalImportClasses = Arrays.asList("bwapi.Position", "bwapi.TilePosition", "bwapi.Player", "bwapi.Unit", "bwapi.Pair"); bwtaOptions.globalClassName = "BWTA"; Properties props = new Properties(); - props.put(COMPILE_DIR_PROPERTY, "compiled4"); - props.put(HEADERS_DIR_PROPERTY, "headers4"); - props.put(HEADER_FILE_PROPERTY, "concat_header4.h"); - props.put(C_IMPLEMENTATION_FILE_PROPERTY, "c4/impl.cpp"); - props.put(GENERATE_TO_DIR, "generated"); + props.put(COMPILE_DIR_PROPERTY, basePath.getPath() + "/output/compiled"); + props.put(HEADERS_DIR_PROPERTY, basePath.getPath() + "/output/headers"); + props.put(HEADER_FILE_PROPERTY, basePath.getPath() + "/output/bwapi_bridge_src/concat_header.h"); + props.put(C_IMPLEMENTATION_FILE_PROPERTY, basePath.getPath() + "/output/bwapi_bridge_src/impl.cpp"); + props.put(GENERATE_TO_DIR, basePath.getPath() + "/bwmirror/src/main/java"); new CJavaPipeline().run(new PackageProcessOptions[]{bwapiOptions, bwtaOptions}, props); + } catch (Exception ex) { + ex.printStackTrace(); } - } private static final String COMPILE_DIR_PROPERTY = "compiled_dir"; @@ -290,9 +363,4 @@ public class CJavaPipeline { private static final String C_IMPLEMENTATION_FILE_PROPERTY = "impl_file"; private static final String HEADER_FILE_PROPERTY = "header_file"; private static final String GENERATE_TO_DIR = "generate_to_dir"; - - public static boolean isBWAPI3() { - return BWAPI_VERSION == BWAPI_V3; - } - } diff --git a/src/generator/Generator.java b/generator/src/main/java/bwmirror/generator/Generator.java similarity index 91% rename from src/generator/Generator.java rename to generator/src/main/java/bwmirror/generator/Generator.java index 0b78b91..6ebb100 100644 --- a/src/generator/Generator.java +++ b/generator/src/main/java/bwmirror/generator/Generator.java @@ -1,9 +1,9 @@ -package generator; +package bwmirror.generator; -import c.CClass; -import c.CEnum; -import generator.java.ClassMirror; -import generator.java.EnumMirror; +import bwmirror.c.CClass; +import bwmirror.c.CEnum; +import bwmirror.generator.java.ClassMirror; +import bwmirror.generator.java.EnumMirror; import java.io.File; import java.util.ArrayList; diff --git a/src/generator/JavaContext.java b/generator/src/main/java/bwmirror/generator/JavaContext.java similarity index 96% rename from src/generator/JavaContext.java rename to generator/src/main/java/bwmirror/generator/JavaContext.java index 89fd545..6a67cb4 100644 --- a/src/generator/JavaContext.java +++ b/generator/src/main/java/bwmirror/generator/JavaContext.java @@ -1,8 +1,7 @@ -package generator; +package bwmirror.generator; -import util.Generic; -import util.PointerTest; -import util.StringUtils; +import bwmirror.util.Generic; +import bwmirror.util.PointerTest; import java.util.Arrays; import java.util.HashMap; @@ -213,13 +212,6 @@ public class JavaContext { return implementCopyReturn(javaType, "cresult"); } - public static String checkBWAPI3brackets() { - if (CJavaPipeline.isBWAPI3()) { - return "()"; - } - return ""; - } - public String implementCopyReturn(String javaType, String fieldName) { switch (javaType) { case "Integer": @@ -238,8 +230,8 @@ public class JavaContext { case "Position": case "WalkPosition": case "Point": - return ", " + fieldName + ".x" + checkBWAPI3brackets() + - ", " + fieldName + ".y" + checkBWAPI3brackets(); + return ", " + fieldName + ".x" + + ", " + fieldName + ".y"; case "Color": return ", " + fieldName + ".red()" + ", " + fieldName + ".green()" + diff --git a/src/generator/MirrorContext.java b/generator/src/main/java/bwmirror/generator/MirrorContext.java similarity index 99% rename from src/generator/MirrorContext.java rename to generator/src/main/java/bwmirror/generator/MirrorContext.java index 540f013..1773f71 100644 --- a/src/generator/MirrorContext.java +++ b/generator/src/main/java/bwmirror/generator/MirrorContext.java @@ -1,4 +1,4 @@ -package generator; +package bwmirror.generator; import java.io.File; import java.util.ArrayList; diff --git a/src/generator/MyJavaCompiler.java b/generator/src/main/java/bwmirror/generator/MyJavaCompiler.java similarity index 63% rename from src/generator/MyJavaCompiler.java rename to generator/src/main/java/bwmirror/generator/MyJavaCompiler.java index ee1046f..394ca1c 100644 --- a/src/generator/MyJavaCompiler.java +++ b/generator/src/main/java/bwmirror/generator/MyJavaCompiler.java @@ -1,6 +1,6 @@ -package generator; +package bwmirror.generator; -import compile.JavaSourceFile; +import bwmirror.compile.JavaSourceFile; import javax.tools.*; import java.io.File; @@ -19,43 +19,57 @@ public class MyJavaCompiler { JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); @SuppressWarnings("ConstantConditions") - public void run(File inDir, File outDir) { - outDir.delete(); - outDir.mkdir(); + public boolean run(File inDir, File outDir) throws Exception { + System.out.println("Compiling " + inDir + ", output " + outDir); + outDir.mkdirs(); List javaFileObjects = new ArrayList(); DiagnosticCollector diagnostics = new DiagnosticCollector(); - Iterable compilationOptions = Arrays.asList("-d", outDir.getName()); + Iterable compilationOptions = Arrays.asList("-d", outDir.getPath(), "-cp", outDir.getPath()); + System.out.print("Compile options: "); + for (String option : compilationOptions) { + System.out.print(option + " "); + } + System.out.println(); + System.out.println("Compiling source files:"); for (File file : inDir.listFiles()) { if(file.isDirectory()){ for(File ffile : file.listFiles()){ if(ffile.isDirectory()){ for(File fffile : ffile.listFiles()){ + System.out.println(fffile); javaFileObjects.add(new JavaSourceFile(fffile)); } continue; } + System.out.println(ffile); javaFileObjects.add(new JavaSourceFile(ffile)); } continue; } + System.out.println(file); javaFileObjects.add(new JavaSourceFile(file)); } + System.out.println("\nCompiling ..."); JavaCompiler.CompilationTask compilerTask = compiler.getTask(null, compiler.getStandardFileManager(null, Locale.getDefault(), null), diagnostics, compilationOptions, null, javaFileObjects); - try { - boolean status = compilerTask.call(); + boolean status = false; - for (Diagnostic diagnostic : diagnostics.getDiagnostics()){ - System.out.format("Error on line %d in %s", diagnostic.getLineNumber(), diagnostic); - } + try { + status = compilerTask.call(); + + for (Diagnostic diagnostic : diagnostics.getDiagnostics()) { + System.out.format("Error on line %d in %s", diagnostic.getLineNumber(), diagnostic); + } } catch (Exception e) { e.printStackTrace(); } + System.out.println(); + return status; } } diff --git a/src/generator/PackageProcessOptions.java b/generator/src/main/java/bwmirror/generator/PackageProcessOptions.java similarity index 96% rename from src/generator/PackageProcessOptions.java rename to generator/src/main/java/bwmirror/generator/PackageProcessOptions.java index 9c427f2..0d92ffa 100644 --- a/src/generator/PackageProcessOptions.java +++ b/generator/src/main/java/bwmirror/generator/PackageProcessOptions.java @@ -1,4 +1,4 @@ -package generator; +package bwmirror.generator; import java.io.File; import java.util.List; diff --git a/src/generator/c/Bind.java b/generator/src/main/java/bwmirror/generator/c/Bind.java similarity index 79% rename from src/generator/c/Bind.java rename to generator/src/main/java/bwmirror/generator/c/Bind.java index e03358b..33c9a90 100644 --- a/src/generator/c/Bind.java +++ b/generator/src/main/java/bwmirror/generator/c/Bind.java @@ -1,18 +1,15 @@ -package generator.c; +package bwmirror.generator.c; -import c.CClass; -import c.CDeclaration; -import c.DeclarationType; -import c.Field; -import generator.CJavaPipeline; -import generator.JavaContext; -import impl.ClassVariable; +import bwmirror.c.CClass; +import bwmirror.c.CDeclaration; +import bwmirror.c.DeclarationType; +import bwmirror.c.Field; +import bwmirror.generator.JavaContext; +import bwmirror.impl.ClassVariable; import java.io.PrintStream; import java.util.List; -import static generator.JavaContext.checkBWAPI3brackets; - /** * User: PC * Date: 18. 6. 2014 @@ -33,38 +30,17 @@ public class Bind { this.context = context; } - private void implementBWAPIInit() { - out.println("println(\"Attempting to init BWAPI...\");"); - out.println("\t\tBWAPI_init();"); - out.println("\t\tprintln(\"BWAPI ready.\");"); - } - - private void implementConnectionRoutine() { - if (CJavaPipeline.isBWAPI3()) { - out.println(" if (Broodwar != NULL) {\n" + - "\t\t\t\tprintln(\"Waiting...\");\n" + - " while (!Broodwar->isInGame()) {\n" + - " BWAPIClient.update();\n" + - "\t\t\t\t\tif (Broodwar == NULL) {\n" + - " println(\"Match ended.\");\n" + - " return;\n" + - " }\n" + - " }\n" + - " }\n" + - "\n"); - } else { - out.println("\t\t\t\tprintln(\"Waiting...\");\n" + - "while ( !Broodwar->isInGame() )\n" + - " {\n" + - " BWAPI::BWAPIClient.update();\n" + - " if (!BWAPI::BWAPIClient.isConnected())\n" + - " {\n" + - " println(\"Reconnecting...\");\n" + - " reconnect();\n" + - " }\n" + - " }"); - } + out.println("\t\t\t\tprintln(\"Waiting...\");\n" + + "while ( !Broodwar->isInGame() )\n" + + " {\n" + + " BWAPI::BWAPIClient.update();\n" + + " if (!BWAPI::BWAPIClient.isConnected())\n" + + " {\n" + + " println(\"Reconnecting...\");\n" + + " reconnect();\n" + + " }\n" + + " }"); } @@ -81,7 +57,7 @@ public class Bind { "\t\tjobject moduleObj = env->GetObjectField(obj, env->GetFieldID(cls, \"module\", \"L" + context.getPackageName() + "/AIModule;\"));\n" + "\t\tjclass moduleCls = env->GetObjectClass(moduleObj);\n" + "\t\tenv->SetObjectField(obj, env->GetFieldID(cls, \"game\", \"L" + context.getPackageName() + "/Game;\"), " + - "env->CallStaticObjectMethod(gamecls, env->GetStaticMethodID(gamecls, \"get\", \"(J)L" + context.getPackageName() + "/Game;\"), (long)Broodwar" + (CJavaPipeline.isBWAPI3() ? "" : "Ptr")+"));\n" + + "env->CallStaticObjectMethod(gamecls, env->GetStaticMethodID(gamecls, \"get\", \"(J)L" + context.getPackageName() + "/Game;\"), (long)BroodwarPtr));\n" + "\n" + "\t\tjmethodID updateMethodID = env->GetMethodID(env->GetObjectClass(obj), \"update\", \"()V\");"); @@ -117,12 +93,6 @@ public class Bind { "\t\t\t\t\t switch (it->getType()) {\n" + "\t\t\t\t\t\t case EventType::MatchStart:\n" + - (CJavaPipeline.isBWAPI3() ? - "\t\t\t\t\t\t\t BWTA::BWTA_Result::regions.clear();\n" + - "\t\t\t\t\t\t\t BWTA::BWTA_Result::baselocations.clear();\n" + - "\t\t\t\t\t\t\t BWTA::BWTA_Result::startlocations.clear();\n" + - "\t\t\t\t\t\t\t BWTA::BWTA_Result::chokepoints.clear();\n" + - "\t\t\t\t\t\t\t BWTA::BWTA_Result::unwalkablePolygons.clear();\n" : "") + "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, matchStartCallback);\n" + "\t\t\t\t\t\t break;\n" + "\t\t\t\t\t\t case EventType::MatchEnd:\n" + @@ -141,7 +111,7 @@ public class Bind { "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, playerLeftCallback, env->CallStaticObjectMethod(playerCls, env->GetStaticMethodID(playerCls, \"get\", \"(J)L" + context.getPackageName() + "/Player;\"), (jlong)it->getPlayer()));\n" + "\t\t\t\t\t\t break;\n" + "\t\t\t\t\t\t case EventType::NukeDetect:\n" + - "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, nukeDetectCallback, env->NewObject(posCls, env->GetMethodID(posCls,\"\", \"(II)V\"), it->getPosition().x" + checkBWAPI3brackets() + ", it->getPosition().y" + checkBWAPI3brackets() + "));\n" + + "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, nukeDetectCallback, env->NewObject(posCls, env->GetMethodID(posCls,\"\", \"(II)V\"), it->getPosition().x, it->getPosition().y));\n" + "\t\t\t\t\t\t break;\n" + "\t\t\t\t\t\t case EventType::UnitDiscover:\n" + "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, unitDiscoverCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, \"get\", \"(J)L" + context.getPackageName() + "/Unit;\"), (jlong)it->getUnit()));\n" + @@ -173,11 +143,6 @@ public class Bind { "\t\t\t\t\t\t case EventType::UnitComplete:\n" + "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, unitCompleteCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, \"get\", \"(J)L" + context.getPackageName() + "/Unit;\"), (jlong)it->getUnit()));\n" + "\t\t\t\t\t\t break;\n" + - (CJavaPipeline.isBWAPI3() ? - "\t\t\t\t\t\t case EventType::PlayerDropped:\n" + - "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, playerDroppedCallback, env->CallStaticObjectMethod(playerCls, env->GetStaticMethodID(playerCls, \"get\", \"(J)L" + context.getPackageName() + "/Player;\")));\n" + - "\t\t\t\t\t\t break;\n" - : "") + "\n" + "\t\t\t\t\t }\n" + "\t\t\t\t }"); @@ -188,30 +153,19 @@ public class Bind { "\t\t\t\t\t\treconnect();\n" + "\t\t\t\t}\n" + "\t\t\t}\n" + - (CJavaPipeline.isBWAPI3() ? "" : "println(\"Match ended.\");") + + "println(\"Match ended.\");" + "\t\t}"); } private void implementHelpers() { - if (CJavaPipeline.isBWAPI3()) { - out.println("void reconnect()\n" + - "{\n" + - "\twhile (!BWAPIClient.connect()) {\n" + - " Sleep(1000);\n" + - " }\n" + - "}\n" + - "\n" + - "\n"); - } else { - out.println("void reconnect()\n" + - "{\n" + - "\twhile (!BWAPIClient.connect()) {\n" + - " std::this_thread::sleep_for(std::chrono::milliseconds{ 1000 });\n" + - " }\n" + - "}\n" + - "\n" + - "\n"); - } + out.println("void reconnect()\n" + + "{\n" + + "\twhile (!BWAPIClient.connect()) {\n" + + " std::this_thread::sleep_for(std::chrono::milliseconds{ 1000 });\n" + + " }\n" + + "}\n" + + "\n" + + "\n"); out.println( "void flushPrint(const char * text){\n" + @@ -229,9 +183,6 @@ public class Bind { private void implementMirrorInit(List declarationList) { implementHelpers(); out.println("JNIEXPORT void JNICALL Java_" + context.getPackageName() + "_Mirror_startGame(JNIEnv * env, jobject obj){"); - if (CJavaPipeline.isBWAPI3()) { - implementBWAPIInit(); - } implementVariablesBind(declarationList); implementGameStart(); out.println("}"); diff --git a/src/generator/c/HeaderMaker.java b/generator/src/main/java/bwmirror/generator/c/HeaderMaker.java similarity index 68% rename from src/generator/c/HeaderMaker.java rename to generator/src/main/java/bwmirror/generator/c/HeaderMaker.java index 3350ccb..d8d6315 100644 --- a/src/generator/c/HeaderMaker.java +++ b/generator/src/main/java/bwmirror/generator/c/HeaderMaker.java @@ -1,4 +1,4 @@ -package generator.c; +package bwmirror.generator.c; import java.io.*; import java.util.List; @@ -33,11 +33,8 @@ public class HeaderMaker { return result.toString(); } - public void run(List javaRoot, File clpath, String outputFile, String outputDir) { - String command; - - command = "javah -o " + outputFile +" -classpath " + clpath.toString() + prepareClassList(javaRoot, clpath); -// System.out.println(command); + private void runCommand(String command) { + System.out.println(command); try { Process process = Runtime.getRuntime().exec(command); //process.getErrorStream() @@ -49,18 +46,14 @@ public class HeaderMaker { } catch (IOException e) { e.printStackTrace(); } - /*command = "javah -d " + outputDir +" -classpath " + clpath.toString() + prepareClassList(javaRoot, clpath); - try { - Process process = Runtime.getRuntime().exec(command); - //process.getErrorStream() - BufferedReader br = new BufferedReader(new InputStreamReader(process.getErrorStream())); - String s; - while ((s = br.readLine()) != null) { - System.out.println(s); - } - } catch (IOException e) { - e.printStackTrace(); - } */ + } + + public void run(List javaRoot, File clpath, String outputFile, String outputDir) { + // need to run javah twice. once to generate all the individual header files (one per class) + // and then again to generate a combined header. unfortunately javah will only use the "-d" + // option if we pass in both "-o" and "-d" + runCommand("javah -o " + outputFile + " -classpath " + clpath.toString() + prepareClassList(javaRoot, clpath)); + runCommand("javah -d " + outputDir + " -classpath " + clpath.toString() + prepareClassList(javaRoot, clpath)); } } diff --git a/src/generator/c/IdCache.java b/generator/src/main/java/bwmirror/generator/c/IdCache.java similarity index 99% rename from src/generator/c/IdCache.java rename to generator/src/main/java/bwmirror/generator/c/IdCache.java index b917b1b..52a0374 100644 --- a/src/generator/c/IdCache.java +++ b/generator/src/main/java/bwmirror/generator/c/IdCache.java @@ -1,4 +1,4 @@ -package generator.c; +package bwmirror.generator.c; import java.io.PrintStream; diff --git a/src/generator/c/TypeTable.java b/generator/src/main/java/bwmirror/generator/c/TypeTable.java similarity index 87% rename from src/generator/c/TypeTable.java rename to generator/src/main/java/bwmirror/generator/c/TypeTable.java index e53fd94..c8a43f6 100644 --- a/src/generator/c/TypeTable.java +++ b/generator/src/main/java/bwmirror/generator/c/TypeTable.java @@ -1,11 +1,9 @@ -package generator.c; +package bwmirror.generator.c; -import c.CClass; -import c.CDeclaration; -import c.DeclarationType; -import c.Field; -import generator.CJavaPipeline; -import util.PointerTest; +import bwmirror.c.CClass; +import bwmirror.c.CDeclaration; +import bwmirror.c.DeclarationType; +import bwmirror.c.Field; import java.io.PrintStream; import java.util.List; diff --git a/src/generator/ccalls/CallImplementer.java b/generator/src/main/java/bwmirror/generator/ccalls/CallImplementer.java similarity index 97% rename from src/generator/ccalls/CallImplementer.java rename to generator/src/main/java/bwmirror/generator/ccalls/CallImplementer.java index 13989f0..f985ac5 100644 --- a/src/generator/ccalls/CallImplementer.java +++ b/generator/src/main/java/bwmirror/generator/ccalls/CallImplementer.java @@ -1,10 +1,9 @@ -package generator.ccalls; +package bwmirror.generator.ccalls; -import c.Param; -import generator.CJavaPipeline; -import generator.JavaContext; -import util.Generic; -import util.PointerTest; +import bwmirror.c.Param; +import bwmirror.generator.JavaContext; +import bwmirror.util.Generic; +import bwmirror.util.PointerTest; import java.io.BufferedReader; import java.io.File; @@ -52,14 +51,14 @@ public class CallImplementer { public void setOut(PrintStream out) { this.out = out; - out.print("#include \"../concat_header" + (CJavaPipeline.isBWAPI3() ? "" : "4") + ".h\"\n" + + out.print("#include \"concat_header.h\"\n" + "#include \n" + "#include \n" + "#include \n" + - (CJavaPipeline.isBWAPI3() ? "" : "#include \n" + "#include \n") + + "#include \n" + + "#include \n" + "#include \n" + "#include \n" + - (CJavaPipeline.isBWAPI3() ? "#include \"../BWTA_Result.h\"" : "") + "\n" + "using namespace BWAPI;\n\n"); } @@ -85,7 +84,7 @@ public class CallImplementer { if (javaContext.isCollection(param.third)) { String genericType = Generic.extractGeneric(param.third); - if (CJavaPipeline.isBWAPI3() || javaContext.isValueType(genericType)) { + if (javaContext.isValueType(genericType)) { out.println("std::set<" + PointerTest.test(genericType) + "> " + param.second + SEMICOLON); } else { out.println(genericType + "set " + param.second + SEMICOLON); @@ -186,7 +185,7 @@ public class CallImplementer { private String wrapInCCollection(String genericType, String javaMethodName) { String buffer = ""; - boolean isBWAPI4Collection = !CJavaPipeline.isBWAPI3() && !genericType.startsWith("BWTA::"); + boolean isBWAPI4Collection = !genericType.startsWith("BWTA::"); if (!isBWAPI4Collection) { if (javaMethodName.equals("getHoles")) { buffer += "std::vector<"; @@ -207,7 +206,7 @@ public class CallImplementer { buffer += "set"; } - if (buffer.equals("set") && !CJavaPipeline.isBWAPI3()) { + if (buffer.equals("set")) { if (javaContext.getPackageName().equals("bwta")) { return "std::vector<" + genericType + ">"; } diff --git a/src/generator/java/ClassMirror.java b/generator/src/main/java/bwmirror/generator/java/ClassMirror.java similarity index 98% rename from src/generator/java/ClassMirror.java rename to generator/src/main/java/bwmirror/generator/java/ClassMirror.java index 1780a05..dd5c9cf 100644 --- a/src/generator/java/ClassMirror.java +++ b/generator/src/main/java/bwmirror/generator/java/ClassMirror.java @@ -1,7 +1,7 @@ -package generator.java; +package bwmirror.generator.java; -import c.*; -import generator.MirrorContext; +import bwmirror.c.*; +import bwmirror.generator.MirrorContext; import java.io.File; import java.io.PrintStream; diff --git a/src/generator/java/EnumMirror.java b/generator/src/main/java/bwmirror/generator/java/EnumMirror.java similarity index 94% rename from src/generator/java/EnumMirror.java rename to generator/src/main/java/bwmirror/generator/java/EnumMirror.java index 4f3a467..1fdde5a 100644 --- a/src/generator/java/EnumMirror.java +++ b/generator/src/main/java/bwmirror/generator/java/EnumMirror.java @@ -1,9 +1,9 @@ -package generator.java; +package bwmirror.generator.java; -import c.CDeclaration; -import c.CEnum; -import c.EnumValue; -import generator.MirrorContext; +import bwmirror.c.CDeclaration; +import bwmirror.c.CEnum; +import bwmirror.c.EnumValue; +import bwmirror.generator.MirrorContext; import java.io.File; import java.io.PrintStream; diff --git a/src/generator/java/Mirror.java b/generator/src/main/java/bwmirror/generator/java/Mirror.java similarity index 68% rename from src/generator/java/Mirror.java rename to generator/src/main/java/bwmirror/generator/java/Mirror.java index 8dd4d68..9793e44 100644 --- a/src/generator/java/Mirror.java +++ b/generator/src/main/java/bwmirror/generator/java/Mirror.java @@ -1,13 +1,11 @@ -package generator.java; +package bwmirror.generator.java; -import c.CClass; -import c.CDeclaration; -import generator.CJavaPipeline; -import generator.MirrorContext; -import javadoc.Crawler; -import javadoc.CrawlerBWAPI4; -import javadoc.Documentation; -import javadoc.DocumentedField; +import bwmirror.c.CClass; +import bwmirror.c.CDeclaration; +import bwmirror.generator.MirrorContext; +import bwmirror.javadoc.CrawlerBWAPI4; +import bwmirror.javadoc.Documentation; +import bwmirror.javadoc.DocumentedField; import java.io.PrintStream; @@ -56,27 +54,14 @@ public abstract class Mirror { } } else { if (field instanceof CClass) { - if (CJavaPipeline.isBWAPI3() /*|| context.getPackage().equals("bwta")*/) { - - Crawler cl = new Crawler(); - if (context.getPackage().equals("bwta")) { - cl.setBaseUrl("https://code.google.com/p/bwta/wiki/"); - } - documentation = cl.request(getDecl().getName()); - if (documentation != null) { - printJavadoc(documentation.header); - } - } else { - CrawlerBWAPI4 cl = new CrawlerBWAPI4(); - if (context.getPackage().equals("bwta")) { - cl.setBaseUrl("https://code.google.com/p/bwta/wiki/"); - } - documentation = cl.request(getDecl().getName()); - if (documentation != null) { - printJavadoc(documentation.header); - } + CrawlerBWAPI4 cl = new CrawlerBWAPI4(); + if (context.getPackage().equals("bwta")) { + cl.setBaseUrl("https://code.google.com/p/bwta/wiki/"); + } + documentation = cl.request(getDecl().getName()); + if (documentation != null) { + printJavadoc(documentation.header); } - } if (documentation == null) { return; diff --git a/src/impl/CApiParser.java b/generator/src/main/java/bwmirror/impl/CApiParser.java similarity index 95% rename from src/impl/CApiParser.java rename to generator/src/main/java/bwmirror/impl/CApiParser.java index 58b3472..12b59ce 100644 --- a/src/impl/CApiParser.java +++ b/generator/src/main/java/bwmirror/impl/CApiParser.java @@ -1,7 +1,6 @@ -package impl; +package bwmirror.impl; -import c.*; -import generator.CJavaPipeline; +import bwmirror.c.*; import java.io.BufferedReader; import java.io.File; @@ -113,14 +112,6 @@ public class CApiParser { return LineState.END; } - if(CJavaPipeline.isBWAPI3()) { - if (line.endsWith("Types")) { - return LineState.END; - } - if (line.equals("Races")) { - return LineState.END; - } - } return LineState.SKIP; } @@ -256,10 +247,6 @@ public class CApiParser { System.err.println("function skipped - GameData* return (" + function.name + ")"); return null; } - if (CJavaPipeline.isBWAPI3() && function.returnType.equals("UnitCommand")) { - System.err.println("function skipped - UnitCommand return (" + function.name + ")"); - return null; - } if (function.returnType.equals("Event")) { System.err.println("function skipped - Event return (" + function.name + ")"); return null; @@ -513,13 +500,11 @@ public class CApiParser { } Clazz clz = new Clazz(clazzName); - if(!CJavaPipeline.isBWAPI3()){ - if(clazzName.endsWith("Type") || clazzName.equals("Error") || clazzName.equals("Race") || clazzName.equals("Order")){ - Function function = new Function(); - function.name = "toString"; - function.returnType = "string"; - clz.fields.add(function); - } + if(clazzName.endsWith("Type") || clazzName.equals("Error") || clazzName.equals("Race") || clazzName.equals("Order")){ + Function function = new Function(); + function.name = "toString"; + function.returnType = "string"; + clz.fields.add(function); } if (javadoc != null) { diff --git a/src/impl/ClassVariable.java b/generator/src/main/java/bwmirror/impl/ClassVariable.java similarity index 90% rename from src/impl/ClassVariable.java rename to generator/src/main/java/bwmirror/impl/ClassVariable.java index e6a481e..cfc766a 100644 --- a/src/impl/ClassVariable.java +++ b/generator/src/main/java/bwmirror/impl/ClassVariable.java @@ -1,7 +1,7 @@ -package impl; +package bwmirror.impl; -import c.DeclarationType; -import c.Variable; +import bwmirror.c.DeclarationType; +import bwmirror.c.Variable; /** * User: PC diff --git a/src/impl/Clazz.java b/generator/src/main/java/bwmirror/impl/Clazz.java similarity index 89% rename from src/impl/Clazz.java rename to generator/src/main/java/bwmirror/impl/Clazz.java index a2f7e74..e07dda5 100644 --- a/src/impl/Clazz.java +++ b/generator/src/main/java/bwmirror/impl/Clazz.java @@ -1,8 +1,8 @@ -package impl; +package bwmirror.impl; -import c.CClass; -import c.DeclarationType; -import c.Field; +import bwmirror.c.CClass; +import bwmirror.c.DeclarationType; +import bwmirror.c.Field; import java.util.List; diff --git a/src/impl/Enum.java b/generator/src/main/java/bwmirror/impl/Enum.java similarity index 92% rename from src/impl/Enum.java rename to generator/src/main/java/bwmirror/impl/Enum.java index 4a02943..aac963a 100644 --- a/src/impl/Enum.java +++ b/generator/src/main/java/bwmirror/impl/Enum.java @@ -1,8 +1,8 @@ -package impl; +package bwmirror.impl; -import c.CEnum; -import c.DeclarationType; -import c.EnumValue; +import bwmirror.c.CEnum; +import bwmirror.c.DeclarationType; +import bwmirror.c.EnumValue; import java.util.ArrayList; import java.util.List; diff --git a/src/impl/FieldList.java b/generator/src/main/java/bwmirror/impl/FieldList.java similarity index 92% rename from src/impl/FieldList.java rename to generator/src/main/java/bwmirror/impl/FieldList.java index 99c2876..b16882f 100644 --- a/src/impl/FieldList.java +++ b/generator/src/main/java/bwmirror/impl/FieldList.java @@ -1,4 +1,4 @@ -package impl; +package bwmirror.impl; import java.util.ArrayList; diff --git a/src/impl/Function.java b/generator/src/main/java/bwmirror/impl/Function.java similarity index 96% rename from src/impl/Function.java rename to generator/src/main/java/bwmirror/impl/Function.java index 20ad650..97b8b4e 100644 --- a/src/impl/Function.java +++ b/generator/src/main/java/bwmirror/impl/Function.java @@ -1,8 +1,8 @@ -package impl; +package bwmirror.impl; -import c.DeclarationType; -import c.Method; -import c.Param; +import bwmirror.c.DeclarationType; +import bwmirror.c.Method; +import bwmirror.c.Param; import java.util.ArrayList; import java.util.List; diff --git a/src/inject/GetPolygonPointsInjector.java b/generator/src/main/java/bwmirror/inject/GetPolygonPointsInjector.java similarity index 70% rename from src/inject/GetPolygonPointsInjector.java rename to generator/src/main/java/bwmirror/inject/GetPolygonPointsInjector.java index 3f6589b..9a91660 100644 --- a/src/inject/GetPolygonPointsInjector.java +++ b/generator/src/main/java/bwmirror/inject/GetPolygonPointsInjector.java @@ -1,11 +1,11 @@ -package inject; +package bwmirror.inject; -import api.DefaultEventListener; -import c.CClass; -import c.CDeclaration; -import c.Param; -import generator.PackageProcessOptions; -import impl.Function; +import bwmirror.api.DefaultEventListener; +import bwmirror.c.CClass; +import bwmirror.c.CDeclaration; +import bwmirror.c.Param; +import bwmirror.generator.PackageProcessOptions; +import bwmirror.impl.Function; import java.util.ArrayList; diff --git a/src/javadoc/Crawler.java b/generator/src/main/java/bwmirror/javadoc/Crawler.java similarity index 99% rename from src/javadoc/Crawler.java rename to generator/src/main/java/bwmirror/javadoc/Crawler.java index b527a48..9bfbc72 100644 --- a/src/javadoc/Crawler.java +++ b/generator/src/main/java/bwmirror/javadoc/Crawler.java @@ -1,4 +1,4 @@ -package javadoc; +package bwmirror.javadoc; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; diff --git a/src/javadoc/CrawlerBWAPI4.java b/generator/src/main/java/bwmirror/javadoc/CrawlerBWAPI4.java similarity index 98% rename from src/javadoc/CrawlerBWAPI4.java rename to generator/src/main/java/bwmirror/javadoc/CrawlerBWAPI4.java index fe8a948..bb1f6cc 100644 --- a/src/javadoc/CrawlerBWAPI4.java +++ b/generator/src/main/java/bwmirror/javadoc/CrawlerBWAPI4.java @@ -1,4 +1,4 @@ -package javadoc; +package bwmirror.javadoc; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; diff --git a/src/javadoc/Documentation.java b/generator/src/main/java/bwmirror/javadoc/Documentation.java similarity index 89% rename from src/javadoc/Documentation.java rename to generator/src/main/java/bwmirror/javadoc/Documentation.java index 39390a8..9e483df 100644 --- a/src/javadoc/Documentation.java +++ b/generator/src/main/java/bwmirror/javadoc/Documentation.java @@ -1,4 +1,4 @@ -package javadoc; +package bwmirror.javadoc; import java.util.HashMap; diff --git a/src/javadoc/DocumentedField.java b/generator/src/main/java/bwmirror/javadoc/DocumentedField.java similarity index 95% rename from src/javadoc/DocumentedField.java rename to generator/src/main/java/bwmirror/javadoc/DocumentedField.java index cdb74b0..4ea84b4 100644 --- a/src/javadoc/DocumentedField.java +++ b/generator/src/main/java/bwmirror/javadoc/DocumentedField.java @@ -1,4 +1,4 @@ -package javadoc; +package bwmirror.javadoc; /** * User: PC diff --git a/src/util/FileToString.java b/generator/src/main/java/bwmirror/util/FileToString.java similarity index 95% rename from src/util/FileToString.java rename to generator/src/main/java/bwmirror/util/FileToString.java index fea2216..7a7924e 100644 --- a/src/util/FileToString.java +++ b/generator/src/main/java/bwmirror/util/FileToString.java @@ -1,4 +1,4 @@ -package util; +package bwmirror.util; import java.io.IOException; import java.net.URI; diff --git a/src/util/Generic.java b/generator/src/main/java/bwmirror/util/Generic.java similarity index 96% rename from src/util/Generic.java rename to generator/src/main/java/bwmirror/util/Generic.java index dd581ff..3a36d2d 100644 --- a/src/util/Generic.java +++ b/generator/src/main/java/bwmirror/util/Generic.java @@ -1,4 +1,4 @@ -package util; +package bwmirror.util; /** * User: PC diff --git a/src/util/Intend.java b/generator/src/main/java/bwmirror/util/Intend.java similarity index 89% rename from src/util/Intend.java rename to generator/src/main/java/bwmirror/util/Intend.java index 88ba4c7..0c9b2b3 100644 --- a/src/util/Intend.java +++ b/generator/src/main/java/bwmirror/util/Intend.java @@ -1,4 +1,4 @@ -package util; +package bwmirror.util; /** * Created with IntelliJ IDEA. diff --git a/src/util/Pair.java b/generator/src/main/java/bwmirror/util/Pair.java similarity index 97% rename from src/util/Pair.java rename to generator/src/main/java/bwmirror/util/Pair.java index a03300d..95cec9c 100644 --- a/src/util/Pair.java +++ b/generator/src/main/java/bwmirror/util/Pair.java @@ -1,4 +1,4 @@ -package util; +package bwmirror.util; /** * Created with IntelliJ IDEA. diff --git a/src/util/PointerTest.java b/generator/src/main/java/bwmirror/util/PointerTest.java similarity index 82% rename from src/util/PointerTest.java rename to generator/src/main/java/bwmirror/util/PointerTest.java index c5f1771..edab304 100644 --- a/src/util/PointerTest.java +++ b/generator/src/main/java/bwmirror/util/PointerTest.java @@ -1,6 +1,4 @@ -package util; - -import generator.CJavaPipeline; +package bwmirror.util; import java.util.Arrays; import java.util.List; @@ -24,9 +22,6 @@ public class PointerTest { public static String test(String cls, boolean print) { - if (CJavaPipeline.isBWAPI3()) { - return (print ? cls : "" )+ "*"; - } return (print ? cls : "" ) + (testCls(cls) ? "*" : ""); } diff --git a/src/util/StringUtils.java b/generator/src/main/java/bwmirror/util/StringUtils.java similarity index 90% rename from src/util/StringUtils.java rename to generator/src/main/java/bwmirror/util/StringUtils.java index 5049f35..7b452ed 100644 --- a/src/util/StringUtils.java +++ b/generator/src/main/java/bwmirror/util/StringUtils.java @@ -1,4 +1,4 @@ -package util; +package bwmirror.util; /** * User: PC diff --git a/src/util/Triple.java b/generator/src/main/java/bwmirror/util/Triple.java similarity index 95% rename from src/util/Triple.java rename to generator/src/main/java/bwmirror/util/Triple.java index 9db4547..d7cd45b 100644 --- a/src/util/Triple.java +++ b/generator/src/main/java/bwmirror/util/Triple.java @@ -1,4 +1,4 @@ -package util; +package bwmirror.util; /** * Created with IntelliJ IDEA. diff --git a/src/test/FunctionRegexTest.java b/generator/src/test/java/bwmirror/FunctionRegexTest.java similarity index 96% rename from src/test/FunctionRegexTest.java rename to generator/src/test/java/bwmirror/FunctionRegexTest.java index 87189de..b78749f 100644 --- a/src/test/FunctionRegexTest.java +++ b/generator/src/test/java/bwmirror/FunctionRegexTest.java @@ -1,6 +1,4 @@ -package test; - -import impl.CApiParser; +package bwmirror; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/test/JavadocTest.java b/generator/src/test/java/bwmirror/JavadocTest.java similarity index 75% rename from src/test/JavadocTest.java rename to generator/src/test/java/bwmirror/JavadocTest.java index 72b7cca..30e0eec 100644 --- a/src/test/JavadocTest.java +++ b/generator/src/test/java/bwmirror/JavadocTest.java @@ -1,7 +1,6 @@ -package test; +package bwmirror; -import javadoc.Crawler; -import javadoc.CrawlerBWAPI4; +import bwmirror.javadoc.CrawlerBWAPI4; /** * User: PC diff --git a/gmp-vc90-mt.dll b/gmp-vc90-mt.dll deleted file mode 100644 index c439a93..0000000 Binary files a/gmp-vc90-mt.dll and /dev/null differ diff --git a/lib/jsoup-1.7.3.jar b/lib/jsoup-1.7.3.jar deleted file mode 100644 index aa5c798..0000000 Binary files a/lib/jsoup-1.7.3.jar and /dev/null differ diff --git a/manual-bwapi4/AIModule.java b/manual-bwapi-src/AIModule.java similarity index 100% rename from manual-bwapi4/AIModule.java rename to manual-bwapi-src/AIModule.java diff --git a/manual-bwapi4/AbstractPoint.java b/manual-bwapi-src/AbstractPoint.java similarity index 100% rename from manual-bwapi4/AbstractPoint.java rename to manual-bwapi-src/AbstractPoint.java diff --git a/manual-bwapi4/BWEventListener.java b/manual-bwapi-src/BWEventListener.java similarity index 100% rename from manual-bwapi4/BWEventListener.java rename to manual-bwapi-src/BWEventListener.java diff --git a/manual-bwapi4/BestUnitFilter.java b/manual-bwapi-src/BestUnitFilter.java similarity index 100% rename from manual-bwapi4/BestUnitFilter.java rename to manual-bwapi-src/BestUnitFilter.java diff --git a/manual-bwapi/CenteredObject.java b/manual-bwapi-src/CenteredObject.java similarity index 100% rename from manual-bwapi/CenteredObject.java rename to manual-bwapi-src/CenteredObject.java diff --git a/manual-bwapi/Color.java b/manual-bwapi-src/Color.java similarity index 100% rename from manual-bwapi/Color.java rename to manual-bwapi-src/Color.java diff --git a/manual-bwapi4/DefaultBWListener.java b/manual-bwapi-src/DefaultBWListener.java similarity index 100% rename from manual-bwapi4/DefaultBWListener.java rename to manual-bwapi-src/DefaultBWListener.java diff --git a/manual-bwapi-src/Mirror.java b/manual-bwapi-src/Mirror.java new file mode 100644 index 0000000..78296b1 --- /dev/null +++ b/manual-bwapi-src/Mirror.java @@ -0,0 +1,166 @@ +package bwapi; + +import bwapi.AIModule; +import bwapi.BWEventListener; + +import java.io.*; +import java.io.File; +import java.lang.Exception; +import java.lang.UnsupportedOperationException; +import java.util.*; +import java.util.regex.Pattern; +import java.util.zip.*; + +/** + *

The API entry point. Standard use case:

+ *
    + *
  • Create a Mirror object and use {@link #getModule()} and then set an {@link AIModule}'s {@link BWEventListener}
    + *
  • Call {@link #startGame()} to init the API and connect to Broodwar, then launch Broodwar from ChaosLauncher.
  • + *
  • In you {@link BWEventListener#onStart()} method, receive the Game object by calling {@link #getGame()}
  • + *
+ *
+ * Example + *
+ *     {@code
+ *
+ *     mirror.getModule().setEventListener(new DefaultBWListener()
+ *     {
+ *            public void onStart() {
+ *                game = mirror.getGame();
+ *                self = game.self();
+ *                //initialization
+ *                ....
+ *            }
+ *
+ *           public void onUpdate() {
+ *               for (Unit myUnit : self.getUnits()) {
+ *                   //give orders to unit
+ *                   ...
+ *                }
+ *           }
+ *        });
+ *     }
+ *     mirror.startGame();
+ * 
+ + *

Note: The Game object is initialized during the {@link #startGame()} as well as other BWMirror API's constants. + * Do not use any API releated methods/fields prior to {@link #startGame()}.

+ + */ +public class Mirror { + + private Game game; + + private AIModule module = new AIModule(); + + private FrameCallback frameCallback; + + private static final boolean EXTRACT_JAR = true; + + private static void extractResourceFile(String resourceFilename, String outputFilename) throws Exception { + InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourceFilename); + if (in == null) + throw new FileNotFoundException("Resource file not found: " + resourceFilename); + FileOutputStream out; + try { + out = new FileOutputStream(outputFilename); + } catch (Exception e) { + throw new FileNotFoundException("Could not open output file: " + outputFilename); + } + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = in.read(buffer, 0, buffer.length)) != -1) { + out.write(buffer, 0, bytesRead); + } + out.close(); + in.close(); + } + + private static boolean extractAndLoadNativeLibraries() { + try { + System.out.println("Extracting bwapi_bridge.dll"); + extractResourceFile("bwapi_bridge.dll", "./bwapi_bridge.dll"); + + System.out.println("Extracting libgmp-10.dll"); + extractResourceFile("libgmp-10.dll", "./libgmp-10.dll"); + + System.out.println("Extracting libmpfr-4.dll"); + extractResourceFile("libmpfr-4.dll", "./libmpfr-4.dll"); + + System.out.println("Loading native library bwapi_bridge.dll"); + System.load(new File("./bwapi_bridge.dll").getAbsolutePath()); + + } catch (Exception e) { + e.printStackTrace(); + return false; + } + + return true; + } + + private static boolean extractBwtaDataFiles() { + try { + Collection bwtaFilenames = ResourceList.getResources(Pattern.compile("bwapi\\-data/BWTA2/[a-zA-Z0-9]+\\.bwta")); + + System.out.println("Creating ./bwapi-data/BWTA2 directory"); + new File("./bwapi-data/BWTA2").mkdirs(); + + System.out.println("Extracting " + bwtaFilenames.size() + " BWTA2 files:"); + for (String filename : bwtaFilenames) { + System.out.println(filename); + String outputFilename = "./" + filename; + extractResourceFile(filename, outputFilename); + } + + } catch (Exception e) { + e.printStackTrace(); + return false; + } + + return true; + } + + static { + String arch = System.getProperty("os.arch"); + if(!arch.equals("x86")){ + throw new UnsupportedOperationException("BWMirror API supports only x86 architecture."); + } + + if (!extractAndLoadNativeLibraries()) + System.exit(1); + if (!extractBwtaDataFiles()) + System.exit(1); + } + + public Game getGame() { + return game; + } + + public AIModule getModule() { + return module; + } + + /** + * Starts the API, initializes all constants ( {@link UnitType}, {@link WeaponType} ) and the {@link Game} object. + * This method blocks until the end of game. + */ + public native void startGame(); + + private void update() { + if (frameCallback != null) { + frameCallback.update(); + } + } + + /*public void setFrameCallback(bwapi.Mirror.FrameCallback frameCallback) { + this.frameCallback = frameCallback; + } */ + + /** + * The simplest interface to receive update event from Broodwar. The {@link #update()} method is called once each frame. + * For a simple bot and implementation of this interface is enough, to receive all in game events, implement {@link BWEventListener}. + */ + /*public*/ private interface FrameCallback { + public void update(); + } +} \ No newline at end of file diff --git a/manual-bwapi4/Pair.java b/manual-bwapi-src/Pair.java similarity index 100% rename from manual-bwapi4/Pair.java rename to manual-bwapi-src/Pair.java diff --git a/manual-bwapi4/Position.java b/manual-bwapi-src/Position.java similarity index 100% rename from manual-bwapi4/Position.java rename to manual-bwapi-src/Position.java diff --git a/manual-bwapi4/PositionOrUnit.java b/manual-bwapi-src/PositionOrUnit.java similarity index 100% rename from manual-bwapi4/PositionOrUnit.java rename to manual-bwapi-src/PositionOrUnit.java diff --git a/manual-bwapi/PositionedObject.java b/manual-bwapi-src/PositionedObject.java similarity index 100% rename from manual-bwapi/PositionedObject.java rename to manual-bwapi-src/PositionedObject.java diff --git a/manual-bwapi-src/ResourceList.java b/manual-bwapi-src/ResourceList.java new file mode 100644 index 0000000..80b1052 --- /dev/null +++ b/manual-bwapi-src/ResourceList.java @@ -0,0 +1,143 @@ +package bwapi; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Enumeration; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipFile; + +/** + * Get a list of all resources that exist on the classpath that match + * a given java.util.regex.Pattern. + * + * All elements listed in the system property "java.class.path" will be searched + * and whether it is a JAR file or directory will be handled automatically. + * + * Resources that are listed with this class can be loaded using a ClassLoader. + * e.g. Thread.currentThread().getContextClassLoader().getResourceAsStream(...) + */ +public class ResourceList { + + /** + * Returns a list of all resources within the classpath matching the given pattern. + * + * NOTE: If your pattern includes paths, you should use forward slashes between + * directory and filenames instead of backslashes, even when running on Windows. + * Internally, paths will be converted to forward slashes before the pattern is + * matched for consistency reasons. + * + * @param pattern the pattern to match + * @return the resources in the order they are found + */ + public static Collection getResources(final Pattern pattern) { + final ArrayList retval = new ArrayList<>(); + final String classPath = System.getProperty("java.class.path", "."); + final String[] classPathElements = classPath.split(File.pathSeparator); + for (final String element : classPathElements) { + retval.addAll(getResources(element, pattern)); + } + return retval; + } + + private static Collection getResources(final String element, + final Pattern pattern) { + final ArrayList retval = new ArrayList<>(); + final File file = new File(element); + if (file.isDirectory()) { + String baseDirectory; + try { + baseDirectory = file.getCanonicalPath() + File.separator; + } catch (final IOException e) { + throw new java.lang.Error(e); + } + retval.addAll(getResourcesFromDirectory(file, baseDirectory, pattern)); + } else { + retval.addAll(getResourcesFromJarFile(file, pattern)); + } + return retval; + } + + private static Collection getResourcesFromJarFile(final File file, final Pattern pattern) { + final ArrayList retval = new ArrayList<>(); + ZipFile zf; + try { + zf = new ZipFile(file); + } catch (final ZipException e) { + throw new java.lang.Error(e); + } catch (final IOException e) { + throw new java.lang.Error(e); + } + final Enumeration e = zf.entries(); + while (e.hasMoreElements()) { + final ZipEntry ze = (ZipEntry) e.nextElement(); + final String fileName = ze.getName(); + final boolean accept = pattern.matcher(fileName).matches(); + if (accept) { + retval.add(fileName); + } + } + try { + zf.close(); + } catch (final IOException e1) { + throw new java.lang.Error(e1); + } + return retval; + } + + private static Collection getResourcesFromDirectory(final File directory, final String baseDirectory, final Pattern pattern) { + final ArrayList retval = new ArrayList<>(); + final File[] fileList = directory.listFiles(); + for (final File file : fileList) { + if (file.isDirectory()) { + retval.addAll(getResourcesFromDirectory(file, baseDirectory, pattern)); + } else { + try { + // the below call to file.getCanonicalPath will return an absolute path. + // since JAR file paths will all be relative, we trim off the absolute path's + // base directory prefix before doing the regex match. + // + // also convert the remaining sub-path to use forward slashes. this is a convenience thing + // as the _ONLY_ time a path being matched in this entire class will have backslashes + // is in this method (when checking local directories only) and ONLY on Windows. + // checking JAR file paths (getResourcesFromJarFile) will have forward slashes, even + // on Windows... + // so let's just force forward slashes everywhere to be consistent, shall we? + final String fileName = file.getCanonicalPath().substring(baseDirectory.length()).replaceAll("\\\\", "/"); + final boolean accept = pattern.matcher(fileName).matches(); + if (accept) { + // also note that we are adding the slash-converted sub-path to the list of files, NOT + // the absolute path initially obtained! this is so that this path can be passed + // directly into a call to getResourceAsStream() or similar + retval.add(fileName); + } + } catch (final IOException e) { + throw new java.lang.Error(e); + } + } + } + return retval; + } + + /** + * list the resources that match args[0] + * + * @param args args[0] is the pattern to match, or list all resources if + * there are no args + */ + public static void main(final String[] args) { + Pattern pattern; + if (args.length < 1) { + pattern = Pattern.compile(".*"); + } else { + pattern = Pattern.compile(args[0]); + } + final Collection list = ResourceList.getResources(pattern); + for (final String name : list) { + System.out.println(name); + } + } +} diff --git a/manual-bwapi4/TilePosition.java b/manual-bwapi-src/TilePosition.java similarity index 100% rename from manual-bwapi4/TilePosition.java rename to manual-bwapi-src/TilePosition.java diff --git a/manual-bwapi4/UnitCommand.java b/manual-bwapi-src/UnitCommand.java similarity index 100% rename from manual-bwapi4/UnitCommand.java rename to manual-bwapi-src/UnitCommand.java diff --git a/manual-bwapi4/UnitFilter.java b/manual-bwapi-src/UnitFilter.java similarity index 100% rename from manual-bwapi4/UnitFilter.java rename to manual-bwapi-src/UnitFilter.java diff --git a/manual-bwapi/Utils.java b/manual-bwapi-src/Utils.java similarity index 100% rename from manual-bwapi/Utils.java rename to manual-bwapi-src/Utils.java diff --git a/manual-bwapi4/WalkPosition.java b/manual-bwapi-src/WalkPosition.java similarity index 100% rename from manual-bwapi4/WalkPosition.java rename to manual-bwapi-src/WalkPosition.java diff --git a/manual-bwapi/AIModule.java b/manual-bwapi/AIModule.java deleted file mode 100644 index 13811cb..0000000 --- a/manual-bwapi/AIModule.java +++ /dev/null @@ -1,130 +0,0 @@ -package bwapi; - -import bwapi.BWEventListener; - -/** - * This class receives all events from Broodwar. - * To process them, receive an AIModule's instance from {@link bwapi.Mirror} and call {@link #setEventListener(BWEventListener)} - * to set you own {@link bwapi.BWEventListener listener}. - * There's also a stub class ({@link bwapi.DefaultBWListener}) provided, so you don't have to implement all of the methods. - */ -public class AIModule { - - AIModule(){} - - private BWEventListener eventListener; - - public void setEventListener(BWEventListener eventListener) { - this.eventListener = eventListener; - } - - public void onStart() { - if (eventListener != null) { - eventListener.onStart(); - } - } - - public void onEnd(boolean isWinner) { - if (eventListener != null) { - eventListener.onEnd(isWinner); - } - } - - public void onFrame() { - if (eventListener != null) { - eventListener.onFrame(); - } - } - - public void onSendText(String text) { - if (eventListener != null) - { - eventListener.onSendText(text); - } - } - - public void onReceiveText(Player player, String text) { - if (eventListener != null) { - eventListener.onReceiveText(player, text); - } - } - - public void onPlayerLeft(Player player) { - if (eventListener != null) { - eventListener.onPlayerLeft(player); - } - } - - public void onNukeDetect(Position target) { - if (eventListener != null) { - eventListener.onNukeDetect(target); - } - } - - public void onUnitDiscover(Unit unit) { - if (eventListener != null) { - eventListener.onUnitDiscover(unit); - } - } - - public void onUnitEvade(Unit unit) { - if (eventListener != null) { - eventListener.onUnitEvade(unit); - } - } - - public void onUnitShow(Unit unit) { - if (eventListener != null) { - eventListener.onUnitShow(unit); - } - } - - public void onUnitHide(Unit unit) { - if (eventListener != null) { - eventListener.onUnitHide(unit); - } - } - - public void onUnitCreate(Unit unit) { - if (eventListener != null) { - eventListener.onUnitCreate(unit); - } - } - - public void onUnitDestroy(Unit unit) { - if (eventListener != null) { - eventListener.onUnitDestroy(unit); - } - } - - public void onUnitMorph(Unit unit) { - if (eventListener != null) { - eventListener.onUnitMorph(unit); - } - } - - public void onUnitRenegade(Unit unit) { - if (eventListener != null) { - eventListener.onUnitRenegade(unit); - } - } - - public void onSaveGame(String gameName) { - if (eventListener != null) { - eventListener.onSaveGame(gameName); - } - } - - public void onUnitComplete(Unit unit) { - if (eventListener != null) { - eventListener.onUnitComplete(unit); - } - } - - public void onPlayerDropped(Player player) { - if (eventListener != null) { - eventListener.onPlayerDropped(player); - } - } - -} diff --git a/manual-bwapi/AbstractPoint.java b/manual-bwapi/AbstractPoint.java deleted file mode 100644 index 88c4b74..0000000 --- a/manual-bwapi/AbstractPoint.java +++ /dev/null @@ -1,30 +0,0 @@ -package bwapi; - -/** - * Common ancestor for location based objects to simplify distance computation. - * This will be refactored into interface with default methods when java 8 becomes widely used. - * - * Idea by Rafał Poniatowski - */ -public abstract class AbstractPoint { - - public abstract T getPoint(); - - public int getX(){ - return getPoint().getX(); - } - - public int getY(){ - return getPoint().getY(); - } - - public double distanceTo(AbstractPoint otherPosition) { - return distanceTo(otherPosition.getX(), otherPosition.getY()); - } - - public double distanceTo(int x, int y) { - double dx = x - getX(); - double dy = y - getY(); - return Math.sqrt(dx * dx + dy * dy); - } -} \ No newline at end of file diff --git a/manual-bwapi/BWEventListener.java b/manual-bwapi/BWEventListener.java deleted file mode 100644 index 841ec66..0000000 --- a/manual-bwapi/BWEventListener.java +++ /dev/null @@ -1,53 +0,0 @@ -package bwapi; - -import bwapi.*; - -import java.util.Map; -import java.util.HashMap; -import java.util.Collection; -import java.util.List; - -/** - * Implement this interface and call {@link bwapi.AIModule#setEventListener(bwapi.BWEventListener)} to receive all of the in game events. - */ -public interface BWEventListener { - - public void onStart(); - - public void onEnd(boolean isWinner); - - public void onFrame(); - - public void onSendText(String text); - - public void onReceiveText(Player player, String text); - - public void onPlayerLeft(Player player); - - public void onNukeDetect(Position target); - - public void onUnitDiscover(Unit unit); - - public void onUnitEvade(Unit unit); - - public void onUnitShow(Unit unit); - - public void onUnitHide(Unit unit); - - public void onUnitCreate(Unit unit); - - public void onUnitDestroy(Unit unit); - - public void onUnitMorph(Unit unit); - - public void onUnitRenegade(Unit unit); - - public void onSaveGame(String gameName); - - public void onUnitComplete(Unit unit); - - public void onPlayerDropped(Player player); - -} - - diff --git a/manual-bwapi/DefaultBWListener.java b/manual-bwapi/DefaultBWListener.java deleted file mode 100644 index 43ad13e..0000000 --- a/manual-bwapi/DefaultBWListener.java +++ /dev/null @@ -1,103 +0,0 @@ -package bwapi; - -import bwapi.BWEventListener; -import bwapi.Player; -import bwapi.Position; -import bwapi.Unit; - -/** - * A utility stub class providing a default implementation of {@link bwapi.BWEventListener}, - * override it's methods if you want to handle only some events. - */ -public class DefaultBWListener implements BWEventListener { - - @Override - public void onStart() { - - } - - @Override - public void onEnd(boolean b) { - - } - - @Override - public void onFrame() { - - } - - @Override - public void onSendText(String s) { - - } - - @Override - public void onReceiveText(Player player, String s) { - - } - - @Override - public void onPlayerLeft(Player player) { - - } - - @Override - public void onNukeDetect(Position position) { - - } - - @Override - public void onUnitDiscover(Unit unit) { - - } - - @Override - public void onUnitEvade(Unit unit) { - - } - - @Override - public void onUnitShow(Unit unit) { - - } - - @Override - public void onUnitHide(Unit unit) { - - } - - @Override - public void onUnitCreate(Unit unit) { - - } - - @Override - public void onUnitDestroy(Unit unit) { - - } - - @Override - public void onUnitMorph(Unit unit) { - - } - - @Override - public void onUnitRenegade(Unit unit) { - - } - - @Override - public void onSaveGame(String s) { - - } - - @Override - public void onUnitComplete(Unit unit) { - - } - - @Override - public void onPlayerDropped(Player player) { - - } -} diff --git a/manual-bwapi/Error.java b/manual-bwapi/Error.java deleted file mode 100644 index db32480..0000000 --- a/manual-bwapi/Error.java +++ /dev/null @@ -1,100 +0,0 @@ -package bwapi; - -import java.util.HashMap; -import java.util.Map; - -/** - * Functions in BWAPI may set an error code. To retrieve the error code, call Game::getLastError. - */ -public class Error { - - private int id; - - private Error(int id) { - this.id = id; - } - - - public static Error Unit_Does_Not_Exist; - - public static Error Unit_Not_Visible; - - public static Error Unit_Not_Owned; - - public static Error Unit_Busy; - - public static Error Incompatible_UnitType; - - public static Error Incompatible_TechType; - - public static Error Incompatible_State; - - public static Error Already_Researched; - - public static Error Fully_Upgraded; - - public static Error Currently_Researching; - - public static Error Currently_Upgrading; - - public static Error Insufficient_Minerals; - - public static Error Insufficient_Gas; - - public static Error Insufficient_Supply; - - public static Error Insufficient_Energy; - - public static Error Insufficient_Tech; - - public static Error Insufficient_Ammo; - - public static Error Insufficient_Space; - - public static Error Invalid_Tile_Position; - - public static Error Unbuildable_Location; - - public static Error Unreachable_Location; - - public static Error Out_Of_Range; - - public static Error Unable_To_Hit; - - public static Error Access_Denied; - - public static Error File_Not_Found; - - public static Error Invalid_Parameter; - - public static Error None; - - public static Error Unknown; - - private static Map instances = new HashMap(); - - private Error(long pointer) { - this.pointer = pointer; - } - - private static Error get(long pointer) { - Error instance = instances.get(pointer); - if (instance == null) { - instance = new Error(pointer); - instances.put(pointer, instance); - } - return instance; - } - - private long pointer; - - public String c_str() { - return c_str_native(pointer); - } - - public String toString(){ - return c_str(); - } - - private native String c_str_native(long pointer); -} \ No newline at end of file diff --git a/manual-bwapi/Mirror.java b/manual-bwapi/Mirror.java deleted file mode 100644 index 6f0e31f..0000000 --- a/manual-bwapi/Mirror.java +++ /dev/null @@ -1,262 +0,0 @@ -package bwapi; - -import bwapi.AIModule; -import bwapi.BWEventListener; - -import java.io.*; -import java.io.File; -import java.lang.Exception; -import java.lang.UnsupportedOperationException; -import java.util.*; -import java.util.zip.*; - -/** - *

The API entry point. Standard use case:

- *
    - *
  • Create a Mirror object and use {@link #getModule()} and then set an {@link bwapi.AIModule}'s {@link bwapi.BWEventListener}
    - *
  • Call {@link #startGame()} to init the API and connect to Broodwar, then launch Broodwar from ChaosLauncher.
  • - *
  • In you {@link bwapi.BWEventListener#onStart()} method, receive the Game object by calling {@link #getGame()}
  • - *
- *
- * Example - *
- *     {@code
- *
- *     mirror.getModule().setEventListener(new DefaultBWListener()
- *     {
- *            public void onStart() {
- *                game = mirror.getGame();
- *                self = game.self();
- *                //initialization
- *                ....
- *            }
- *
- *           public void onUpdate() {
- *               for (Unit myUnit : self.getUnits()) {
- *                   //give orders to unit
- *                   ...
- *                }
- *           }
- *        });
- *     }
- *     mirror.startGame();
- * 
- - *

Note: The Game object is initialized during the {@link #startGame()} as well as other BWMirror API's constants. - * Do not use any API releated methods/fields prior to {@link #startGame()}.

- - */ -public class Mirror { - - private Game game; - - private AIModule module = new AIModule(); - - private FrameCallback frameCallback; - - private static final boolean EXTRACT_JAR = true; - - private static final String VERSION = "1_2"; - - static { - String arch = System.getProperty("os.arch"); - String dllNames[] = {"bwapi_bridge" + VERSION, "gmp-vc90-mt", "mpfr-vc90-mt"}; - if(!arch.equals("x86")){ - throw new UnsupportedOperationException("BWMirror API supports only x86 architecture."); - } - try { - if (EXTRACT_JAR) { - System.setProperty("java.library.path", "."); - java.lang.reflect.Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths"); - fieldSysPath.setAccessible(true); - fieldSysPath.set(null, null); - - String path = Mirror.class.getProtectionDomain().getCodeSource().getLocation().getPath(); - String decodedPath = java.net.URLDecoder.decode(path, "UTF-8"); - - for (String dllName : dllNames) { - String dllNameExt = dllName + ".dll"; - if (!new File(dllNameExt).exists()) { - JarResources jar = new JarResources(path); - byte[] correctDllData = jar.getResource(dllNameExt); - FileOutputStream funnyStream = new FileOutputStream(dllNameExt); - funnyStream.write(correctDllData); - funnyStream.close(); - } - } - } - } catch (Exception e) { - System.err.println("Failed to extract native libraries.\n" + e); - } - - System.loadLibrary(dllNames[0]); - - File dataDir = new File("bwapi-data/BWTA"); - if(!dataDir.exists()){ - try { - dataDir.mkdirs(); - } catch (Exception e) { - System.err.println("Unable to create /bwapi-data/BWTA folder, BWTA analysis will not be saved."); - } - } - } - - public Game getGame() { - return game; - } - - public AIModule getModule() { - return module; - } - - /** - * Starts the API, initializes all constants ( {@link bwapi.UnitType}, {@link bwapi.WeaponType} ) and the {@link bwapi.Game} object. - * This method blocks until the end of game. - */ - public native void startGame(); - - private void update() { - if (frameCallback != null) { - frameCallback.update(); - } - } - - /*public void setFrameCallback(bwapi.Mirror.FrameCallback frameCallback) { - this.frameCallback = frameCallback; - } */ - - /** - * The simplest interface to receive update event from Broodwar. The {@link #update()} method is called once each frame. - * For a simple bot and implementation of this interface is enough, to receive all in game events, implement {@link bwapi.BWEventListener}. - */ - /*public*/ private interface FrameCallback { - public void update(); - } - - @SuppressWarnings({"unchecked"}) - private static class JarResources { - - // external debug flag - public boolean debugOn = false; - - // jar resource mapping tables - private Hashtable htSizes = new Hashtable(); - private Hashtable htJarContents = new Hashtable(); - - // a jar file - private String jarFileName; - - /** - * creates a javabot.JarResources. It extracts all resources from a Jar - * into an internal hashtable, keyed by resource names. - * - * @param jarFileName a jar or zip file - */ - public JarResources(String jarFileName) { - this.jarFileName = jarFileName; - init(); - } - - /** - * Extracts a jar resource as a blob. - * - * @param name a resource name. - */ - public byte[] getResource(String name) { - return (byte[]) htJarContents.get(name); - } - - /** - * initializes internal hash tables with Jar file resources. - */ - private void init() { - try { - // extracts just sizes only. - ZipFile zf = new ZipFile(jarFileName); - Enumeration e = zf.entries(); - while (e.hasMoreElements()) { - ZipEntry ze = (ZipEntry) e.nextElement(); - if (debugOn) { - System.out.println(dumpZipEntry(ze)); - } - htSizes.put(ze.getName(), new Integer((int) ze.getSize())); - } - zf.close(); - - // extract resources and put them into the hashtable. - FileInputStream fis = new FileInputStream(jarFileName); - BufferedInputStream bis = new BufferedInputStream(fis); - ZipInputStream zis = new ZipInputStream(bis); - ZipEntry ze = null; - while ((ze = zis.getNextEntry()) != null) { - if (ze.isDirectory()) { - continue; - } - if (debugOn) { - System.out.println( - "ze.getName()=" + ze.getName() + "," + "getSize()=" + ze.getSize() - ); - } - int size = (int) ze.getSize(); - // -1 means unknown size. - if (size == -1) { - size = ((Integer) htSizes.get(ze.getName())).intValue(); - } - byte[] b = new byte[(int) size]; - int rb = 0; - int chunk = 0; - while (((int) size - rb) > 0) { - chunk = zis.read(b, rb, (int) size - rb); - if (chunk == -1) { - break; - } - rb += chunk; - } - // add to internal resource hashtable - htJarContents.put(ze.getName(), b); - if (debugOn) { - System.out.println( - ze.getName() + " rb=" + rb + - ",size=" + size + - ",csize=" + ze.getCompressedSize() - ); - } - } - } catch (NullPointerException e) { - System.out.println("done."); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * Dumps a zip entry into a string. - * - * @param ze a ZipEntry - */ - private String dumpZipEntry(ZipEntry ze) { - StringBuffer sb = new StringBuffer(); - if (ze.isDirectory()) { - sb.append("d "); - } else { - sb.append("f "); - } - if (ze.getMethod() == ZipEntry.STORED) { - sb.append("stored "); - } else { - sb.append("defalted "); - } - sb.append(ze.getName()); - sb.append("\t"); - sb.append("" + ze.getSize()); - if (ze.getMethod() == ZipEntry.DEFLATED) { - sb.append("/" + ze.getCompressedSize()); - } - return (sb.toString()); - } - - - } -} \ No newline at end of file diff --git a/manual-bwapi/Position.java b/manual-bwapi/Position.java deleted file mode 100644 index c321b6a..0000000 --- a/manual-bwapi/Position.java +++ /dev/null @@ -1,90 +0,0 @@ -package bwapi; - -import java.lang.Override; -import java.util.HashMap; -import java.util.Map; - -/** - * Positions are measured in pixels and are the highest resolution. - */ -public class Position extends AbstractPoint{ - - private int x, y; - - public Position(int x, int y) { - this.x = x; - this.y = y; - } - - public String toString() { - return "[" + x + ", " + y + "]"; - } - - public native boolean isValid(); - - public native Position makeValid(); - - public native double getDistance(Position position); - - public native int getApproxDistance(Position position); - - public native double getLength(); - - public native boolean hasPath(Position position); - - public int getX() { - return x; - } - - public int getY() { - return y; - } - - public static Position Invalid; - - public static Position None; - - public static Position Unknown; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof Position)) return false; - - Position position = (Position) o; - - if (x != position.x) return false; - if (y != position.y) return false; - - return true; - } - - @Override - public int hashCode() { - int result = x; - result = 31 * result + y; - return result; - } - - - private static Map instances = new HashMap(); - - private Position(long pointer) { - this.pointer = pointer; - } - - private static Position get(long pointer) { - Position instance = instances.get(pointer); - if (instance == null) { - instance = new Position(pointer); - instances.put(pointer, instance); - } - return instance; - } - - private long pointer; - - public Position getPoint(){ - return this; - } -} \ No newline at end of file diff --git a/manual-bwapi/TilePosition.java b/manual-bwapi/TilePosition.java deleted file mode 100644 index 9244647..0000000 --- a/manual-bwapi/TilePosition.java +++ /dev/null @@ -1,89 +0,0 @@ -package bwapi; - -import java.lang.Override; -import java.util.HashMap; -import java.util.Map; - -/** - * Build Tiles - each build tile is a 4x4 square of walk tiles, or a 32x32 square of pixels. - * These are called build tiles because buildability data is available at this resolution, and correspond to the tiles seen in game. - * For example, a Command Center occupies an area of 4x3 build tiles. - */ -public class TilePosition extends AbstractPoint{ - private int x, y; - - public TilePosition(int x, int y) { - this.x = x; - this.y = y; - } - - public String toString() { - return "[" + x + ", " + y + "]"; - } - - public native boolean hasPath(TilePosition position); - - public native boolean isValid(); - - public native TilePosition makeValid(); - - public native double getDistance(TilePosition position); - - public native double getLength(); - - public int getX() { - return x; - } - - public int getY() { - return y; - } - - public static TilePosition Invalid; - - public static TilePosition None; - - public static TilePosition Unknown; - - private static Map instances = new HashMap(); - - private TilePosition(long pointer) { - this.pointer = pointer; - } - - private static TilePosition get(long pointer) { - TilePosition instance = instances.get(pointer); - if (instance == null) { - instance = new TilePosition(pointer); - instances.put(pointer, instance); - } - return instance; - } - - private long pointer; - - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof TilePosition)) return false; - - TilePosition that = (TilePosition) o; - - if (x != that.x) return false; - if (y != that.y) return false; - - return true; - } - - @Override - public int hashCode() { - int result = x; - result = 31 * result + y; - return result; - } - - public TilePosition getPoint(){ - return this; - } -} \ No newline at end of file diff --git a/manual-bwapi4/CenteredObject.java b/manual-bwapi4/CenteredObject.java deleted file mode 100644 index dd751b0..0000000 --- a/manual-bwapi4/CenteredObject.java +++ /dev/null @@ -1,15 +0,0 @@ -package bwapi; - -import bwapi.Position; - -/** - * Interrmediate class used to translate getPoint() calls to getCenter() calls. - */ -public abstract class CenteredObject extends AbstractPoint { - - public Position getPoint(){ - return getCenter(); - } - - public abstract Position getCenter(); -} \ No newline at end of file diff --git a/manual-bwapi4/Color.java b/manual-bwapi4/Color.java deleted file mode 100644 index ab029c8..0000000 --- a/manual-bwapi4/Color.java +++ /dev/null @@ -1,73 +0,0 @@ -package bwapi; - -import java.lang.Override; -import java.util.HashMap; -import java.util.Map; - -/** - * Starcraft uses a 256 color palette to render everything, - * so the colors available for draw shapes using BWAPI is limited to the colors available in the Pallete. - * Several predefined colors from the pallete are provided. - */ -public class Color { - - private int r, g, b; - - /** - * Create a color using the color in the palette that is closest to the RGB color specified. This will check a number of colors in the pallet to see which is closest to the specified color so this function is relatively slow. - * @param r - * @param g - * @param b - */ - public Color(int r, int g, int b) { - this.r = r; - this.g = g; - this.b = b; - } - - public static Color Red; - - public static Color Blue; - - public static Color Teal; - - public static Color Purple; - - public static Color Orange; - - public static Color Brown; - - public static Color White; - - public static Color Yellow; - - public static Color Green; - - public static Color Cyan; - - public static Color Black; - - public static Color Grey; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof Color)) return false; - - Color color = (Color) o; - - if (b != color.b) return false; - if (g != color.g) return false; - if (r != color.r) return false; - - return true; - } - - @Override - public int hashCode() { - int result = r; - result = 31 * result + g; - result = 31 * result + b; - return result; - } -} diff --git a/manual-bwapi4/Mirror.java b/manual-bwapi4/Mirror.java deleted file mode 100644 index 887068a..0000000 --- a/manual-bwapi4/Mirror.java +++ /dev/null @@ -1,268 +0,0 @@ -package bwapi; - -import bwapi.AIModule; -import bwapi.BWEventListener; - -import java.io.*; -import java.io.File; -import java.lang.Exception; -import java.lang.UnsupportedOperationException; -import java.util.*; -import java.util.zip.*; - -/** - *

The API entry point. Standard use case:

- *
    - *
  • Create a Mirror object and use {@link #getModule()} and then set an {@link AIModule}'s {@link BWEventListener}
    - *
  • Call {@link #startGame()} to init the API and connect to Broodwar, then launch Broodwar from ChaosLauncher.
  • - *
  • In you {@link BWEventListener#onStart()} method, receive the Game object by calling {@link #getGame()}
  • - *
- *
- * Example - *
- *     {@code
- *
- *     mirror.getModule().setEventListener(new DefaultBWListener()
- *     {
- *            public void onStart() {
- *                game = mirror.getGame();
- *                self = game.self();
- *                //initialization
- *                ....
- *            }
- *
- *           public void onUpdate() {
- *               for (Unit myUnit : self.getUnits()) {
- *                   //give orders to unit
- *                   ...
- *                }
- *           }
- *        });
- *     }
- *     mirror.startGame();
- * 
- - *

Note: The Game object is initialized during the {@link #startGame()} as well as other BWMirror API's constants. - * Do not use any API releated methods/fields prior to {@link #startGame()}.

- - */ -public class Mirror { - - private Game game; - - private AIModule module = new AIModule(); - - private FrameCallback frameCallback; - - private static final boolean EXTRACT_JAR = true; - - private static final String VERSION = "2_5"; - - static { - String arch = System.getProperty("os.arch"); - String dllNames[] = {"bwapi_bridge" + VERSION, "libgmp-10", "libmpfr-4"}; - if(!arch.equals("x86")){ - throw new UnsupportedOperationException("BWMirror API supports only x86 architecture."); - } - try { - if (EXTRACT_JAR) { - System.setProperty("java.library.path", "."); - java.lang.reflect.Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths"); - fieldSysPath.setAccessible(true); - fieldSysPath.set(null, null); - - String path = Mirror.class.getProtectionDomain().getCodeSource().getLocation().getPath(); - String decodedPath = java.net.URLDecoder.decode(path, "UTF-8"); - - JarResources jar = null; - for (String dllName : dllNames) { - String dllNameExt = dllName + ".dll"; - if (!new File(dllNameExt).exists()) { - if (null == jar) { - jar = new JarResources(decodedPath); - } - byte[] correctDllData = jar.getResource(dllNameExt); - // prevents the creation of zero byte files - if (null != correctDllData) { - FileOutputStream funnyStream = new FileOutputStream(dllNameExt); - funnyStream.write(correctDllData); - funnyStream.close(); - } - } - } - } - } catch (Exception e) { - System.err.println("Failed to extract native libraries.\n" + e); - } - - System.loadLibrary(dllNames[0]); - - File dataDir = new File("bwapi-data/BWTA"); - if(!dataDir.exists()){ - try { - dataDir.mkdirs(); - } catch (Exception e) { - System.err.println("Unable to create /bwapi-data/BWTA folder, BWTA analysis will not be saved."); - } - } - } - - public Game getGame() { - return game; - } - - public AIModule getModule() { - return module; - } - - /** - * Starts the API, initializes all constants ( {@link UnitType}, {@link WeaponType} ) and the {@link Game} object. - * This method blocks until the end of game. - */ - public native void startGame(); - - private void update() { - if (frameCallback != null) { - frameCallback.update(); - } - } - - /*public void setFrameCallback(bwapi.Mirror.FrameCallback frameCallback) { - this.frameCallback = frameCallback; - } */ - - /** - * The simplest interface to receive update event from Broodwar. The {@link #update()} method is called once each frame. - * For a simple bot and implementation of this interface is enough, to receive all in game events, implement {@link BWEventListener}. - */ - /*public*/ private interface FrameCallback { - public void update(); - } - - @SuppressWarnings({"unchecked"}) - private static class JarResources { - - // external debug flag - public boolean debugOn = false; - - // jar resource mapping tables - private Hashtable htSizes = new Hashtable(); - private Hashtable htJarContents = new Hashtable(); - - // a jar file - private String jarFileName; - - /** - * creates a javabot.JarResources. It extracts all resources from a Jar - * into an internal hashtable, keyed by resource names. - * - * @param jarFileName a jar or zip file - */ - public JarResources(String jarFileName) { - this.jarFileName = jarFileName; - init(); - } - - /** - * Extracts a jar resource as a blob. - * - * @param name a resource name. - */ - public byte[] getResource(String name) { - return (byte[]) htJarContents.get(name); - } - - /** - * initializes internal hash tables with Jar file resources. - */ - private void init() { - try { - // extracts just sizes only. - ZipFile zf = new ZipFile(jarFileName); - Enumeration e = zf.entries(); - while (e.hasMoreElements()) { - ZipEntry ze = (ZipEntry) e.nextElement(); - if (debugOn) { - System.out.println(dumpZipEntry(ze)); - } - htSizes.put(ze.getName(), new Integer((int) ze.getSize())); - } - zf.close(); - - // extract resources and put them into the hashtable. - FileInputStream fis = new FileInputStream(jarFileName); - BufferedInputStream bis = new BufferedInputStream(fis); - ZipInputStream zis = new ZipInputStream(bis); - ZipEntry ze = null; - while ((ze = zis.getNextEntry()) != null) { - if (ze.isDirectory()) { - continue; - } - if (debugOn) { - System.out.println( - "ze.getName()=" + ze.getName() + "," + "getSize()=" + ze.getSize() - ); - } - int size = (int) ze.getSize(); - // -1 means unknown size. - if (size == -1) { - size = ((Integer) htSizes.get(ze.getName())).intValue(); - } - byte[] b = new byte[(int) size]; - int rb = 0; - int chunk = 0; - while (((int) size - rb) > 0) { - chunk = zis.read(b, rb, (int) size - rb); - if (chunk == -1) { - break; - } - rb += chunk; - } - // add to internal resource hashtable - htJarContents.put(ze.getName(), b); - if (debugOn) { - System.out.println( - ze.getName() + " rb=" + rb + - ",size=" + size + - ",csize=" + ze.getCompressedSize() - ); - } - } - } catch (NullPointerException e) { - System.out.println("done."); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * Dumps a zip entry into a string. - * - * @param ze a ZipEntry - */ - private String dumpZipEntry(ZipEntry ze) { - StringBuffer sb = new StringBuffer(); - if (ze.isDirectory()) { - sb.append("d "); - } else { - sb.append("f "); - } - if (ze.getMethod() == ZipEntry.STORED) { - sb.append("stored "); - } else { - sb.append("defalted "); - } - sb.append(ze.getName()); - sb.append("\t"); - sb.append("" + ze.getSize()); - if (ze.getMethod() == ZipEntry.DEFLATED) { - sb.append("/" + ze.getCompressedSize()); - } - return (sb.toString()); - } - - - } -} \ No newline at end of file diff --git a/manual-bwapi4/PositionedObject.java b/manual-bwapi4/PositionedObject.java deleted file mode 100644 index 4d40575..0000000 --- a/manual-bwapi4/PositionedObject.java +++ /dev/null @@ -1,15 +0,0 @@ -package bwapi; - -import bwapi.Position; - -/** - * Interrmediate class used to translate getPoint() calls to getPosition() calls. - */ -public abstract class PositionedObject extends AbstractPoint { - - public Position getPoint(){ - return getPosition(); - } - - public abstract Position getPosition(); -} \ No newline at end of file diff --git a/manual-bwapi4/Utils.java b/manual-bwapi4/Utils.java deleted file mode 100644 index a597123..0000000 --- a/manual-bwapi4/Utils.java +++ /dev/null @@ -1,52 +0,0 @@ -package bwapi; - -import java.lang.String; -import java.lang.System; - -/** - * - */ -public class Utils { - - public static final byte Previous = 0x01; - public static final byte Cyan = 0x02; - public static final byte Yellow = 0x03; - public static final byte White = 0x04; - public static final byte Grey = 0x05; - public static final byte Red = 0x06; - public static final byte Green = 0x07; - public static final byte Red_P1 = 0x08; - public static final byte Tab = 0x09; - public static final byte Newline = 0x0A; - public static final byte Invisible_no_override = 0x0B; - public static final byte Remove_beyond = 0x0C; - public static final byte Clear_formatting = 0x0D; - public static final byte Blue = 0x0E; - public static final byte Teal = 0x0F; - public static final byte Purple = 0x10; - public static final byte Orange = 0x11; - public static final byte Right_Align = 0x12; - public static final byte Center_Align = 0x13; - public static final byte Invisible = 0x14; - public static final byte Brown = 0x15; - public static final byte White_p7 = 0x16; - public static final byte Yellow_p8 = 0x17; - public static final byte Green_p9 = 0x18; - public static final byte Brighter_Yellow = 0x19; - public static final byte Cyan_default = 0x1A; - public static final byte Pinkish = 0x1B; - public static final byte Dark_Cyan = 0x1C; - public static final byte Greygreen = 0x1D; - public static final byte Bluegrey = 0x1E; - public static final byte Turquoise = 0x1F; - - public static String formatText(String text, byte format){ - byte[] textData = text.getBytes(); - int textDataLength = text.length(); - - byte[] newTextData = new byte[textDataLength + 1]; - newTextData[0] = format; - System.arraycopy(textData, 0, newTextData, 1, textDataLength); - return new String(newTextData); - } -} \ No newline at end of file diff --git a/mpfr-vc90-mt.dll b/mpfr-vc90-mt.dll deleted file mode 100644 index 1f8513b..0000000 Binary files a/mpfr-vc90-mt.dll and /dev/null differ diff --git a/src/util/FileUtils.java b/src/util/FileUtils.java deleted file mode 100644 index 69b8a81..0000000 --- a/src/util/FileUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -package util; - -import java.io.File; - -/** - * User: PC - * Date: 14. 8. 2014 - * Time: 10:11 - */ -public class FileUtils { - - @SuppressWarnings("ResultOfMethodCallIgnored") - public static void deleteDirectory(File directory) { - if (directory.exists()) { - File[] files = directory.listFiles(); - if (files != null) { - for (File file : files) { - if (file.isDirectory()) { - deleteDirectory(file); - } else { - file.delete(); - } - } - } - } - } - -}