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 © 2007 Free Software Foundation, Inc. <<http://fsf.org/>>
-
-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/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