diff --git a/BWTA_Result.h b/BWTA_Result.h new file mode 100644 index 0000000..abd9055 --- /dev/null +++ b/BWTA_Result.h @@ -0,0 +1,19 @@ +#pragma once +#include +namespace BWTA +{ + namespace BWTA_Result + { + extern std::set regions; + extern std::set chokepoints; + extern std::set baselocations; + extern std::set startlocations; + extern std::set unwalkablePolygons; + extern RectangleArray getRegion; + extern RectangleArray getChokepoint; + extern RectangleArray getBaseLocation; + extern RectangleArray getChokepointW; + extern RectangleArray getBaseLocationW; + extern RectangleArray getUnwalkablePolygon; + }; +} \ No newline at end of file diff --git a/bwapi4-includes/BWAPI.h b/bwapi4-includes/BWAPI.h index f9d3f40..fa4bc90 100644 --- a/bwapi4-includes/BWAPI.h +++ b/bwapi4-includes/BWAPI.h @@ -1,4 +1,7 @@ #pragma once +#ifndef __BWAPI_H__ +#define __BWAPI_H__ + #include #include #include @@ -40,8 +43,8 @@ #include #include #include -#include #include +#include namespace BWAPI { @@ -61,3 +64,5 @@ namespace BWAPI /// @threadsafe bool BWAPI_isDebug(); } + +#endif diff --git a/bwapi4-includes/BWAPI/BulletType.h b/bwapi4-includes/BWAPI/BulletType.h index 00ee493..f88caec 100644 --- a/bwapi4-includes/BWAPI/BulletType.h +++ b/bwapi4-includes/BWAPI/BulletType.h @@ -72,49 +72,46 @@ namespace BWAPI /// Retrieves the set of all the BulletTypes. /// /// @returns Set of BulletTypes. - const BulletType::const_set& allBulletTypes(); + const BulletType::set& allBulletTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const BulletType x - BWAPI_DECL(Melee); - BWAPI_DECL(Fusion_Cutter_Hit); - BWAPI_DECL(Gauss_Rifle_Hit); - BWAPI_DECL(C_10_Canister_Rifle_Hit); - BWAPI_DECL(Gemini_Missiles); - BWAPI_DECL(Fragmentation_Grenade); - BWAPI_DECL(Longbolt_Missile); - BWAPI_DECL(ATS_ATA_Laser_Battery); - BWAPI_DECL(Burst_Lasers); - BWAPI_DECL(Arclite_Shock_Cannon_Hit); - BWAPI_DECL(EMP_Missile); - BWAPI_DECL(Dual_Photon_Blasters_Hit); - BWAPI_DECL(Particle_Beam_Hit); - BWAPI_DECL(Anti_Matter_Missile); - BWAPI_DECL(Pulse_Cannon); - BWAPI_DECL(Psionic_Shockwave_Hit); - BWAPI_DECL(Psionic_Storm); - BWAPI_DECL(Yamato_Gun); - BWAPI_DECL(Phase_Disruptor); - BWAPI_DECL(STA_STS_Cannon_Overlay); - BWAPI_DECL(Sunken_Colony_Tentacle); - BWAPI_DECL(Acid_Spore); - BWAPI_DECL(Glave_Wurm); - BWAPI_DECL(Seeker_Spores); - BWAPI_DECL(Queen_Spell_Carrier); - BWAPI_DECL(Plague_Cloud); - BWAPI_DECL(Consume); - BWAPI_DECL(Ensnare); - BWAPI_DECL(Needle_Spine_Hit); - BWAPI_DECL(Invisible); - BWAPI_DECL(Optical_Flare_Grenade); - BWAPI_DECL(Halo_Rockets); - BWAPI_DECL(Subterranean_Spines); - BWAPI_DECL(Corrosive_Acid_Shot); - BWAPI_DECL(Neutron_Flare); - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + 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 index 819992e..aa6fec3 100644 --- a/bwapi4-includes/BWAPI/Bulletset.h +++ b/bwapi4-includes/BWAPI/Bulletset.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "SetContainer.h" namespace BWAPI { @@ -7,12 +7,9 @@ namespace BWAPI class BulletInterface; typedef BulletInterface *Bullet; - class Bulletset : public Vectorset + class Bulletset : public SetContainer> { public: - Bulletset(size_t initialSize = 16); - Bulletset(const Bulletset &other); - Bulletset(Bulletset &&other); }; } diff --git a/bwapi4-includes/BWAPI/Client.h b/bwapi4-includes/BWAPI/Client.h index 480931d..a55dd7a 100644 --- a/bwapi4-includes/BWAPI/Client.h +++ b/bwapi4-includes/BWAPI/Client.h @@ -14,4 +14,4 @@ #include #include #include -#include \ No newline at end of file +#include diff --git a/bwapi4-includes/BWAPI/Client/Client.h b/bwapi4-includes/BWAPI/Client/Client.h index d6a5e81..cea780b 100644 --- a/bwapi4-includes/BWAPI/Client/Client.h +++ b/bwapi4-includes/BWAPI/Client/Client.h @@ -1,5 +1,4 @@ #pragma once -#include #include "GameData.h" #include "GameImpl.h" #include "ForceImpl.h" @@ -7,6 +6,8 @@ #include "UnitImpl.h" #include "GameTable.h" +#include "../WindowsTypes.h" + namespace BWAPI { @@ -16,7 +17,7 @@ namespace BWAPI Client(); ~Client(); - bool isConnected(); + bool isConnected() const; bool connect(); void disconnect(); void update(); diff --git a/bwapi4-includes/BWAPI/Client/ForceImpl.h b/bwapi4-includes/BWAPI/Client/ForceImpl.h index 8426893..640107a 100644 --- a/bwapi4-includes/BWAPI/Client/ForceImpl.h +++ b/bwapi4-includes/BWAPI/Client/ForceImpl.h @@ -5,10 +5,6 @@ namespace BWAPI { - class Game; - class PlayerInterface; - typedef PlayerInterface *Player; - class ForceImpl : public ForceInterface { private: diff --git a/bwapi4-includes/BWAPI/Client/GameData.h b/bwapi4-includes/BWAPI/Client/GameData.h index 95078f6..5b2745b 100644 --- a/bwapi4-includes/BWAPI/Client/GameData.h +++ b/bwapi4-includes/BWAPI/Client/GameData.h @@ -144,7 +144,7 @@ namespace BWAPI //strings (used in shapes and commands) int stringCount; - char strings[MAX_STRINGS][256]; + char strings[MAX_STRINGS][1024]; //shapes, commands, unitCommands, from client to server int shapeCount; diff --git a/bwapi4-includes/BWAPI/Client/GameImpl.h b/bwapi4-includes/BWAPI/Client/GameImpl.h index 0350562..d1695d3 100644 --- a/bwapi4-includes/BWAPI/Client/GameImpl.h +++ b/bwapi4-includes/BWAPI/Client/GameImpl.h @@ -1,5 +1,6 @@ #pragma once #include + #include "GameData.h" #include "Client.h" #include "Shape.h" @@ -10,15 +11,10 @@ #include "RegionImpl.h" #include "UnitImpl.h" #include "BulletImpl.h" + #include #include -#include -#include -#include -#include -#include - namespace BWAPI { class ForceInterface; @@ -54,12 +50,12 @@ namespace BWAPI Unitset staticGeysers; Unitset staticNeutralUnits; Bulletset bullets; - Position::set nukeDots; + Position::list nukeDots; Unitset selectedUnits; Unitset pylons; Regionset regionsList; - TilePosition::set startLocations; + TilePosition::list startLocations; std::list< Event > events; bool flagEnabled[2]; Player thePlayer; @@ -94,7 +90,7 @@ namespace BWAPI virtual const Unitset& getStaticNeutralUnits() const override; virtual const Bulletset& getBullets() const override; - virtual const Position::set& getNukeDots() const override; + virtual const Position::list& getNukeDots() const override; virtual const std::list< Event>& getEvents() const override; virtual Force getForce(int forceID) const override; @@ -143,7 +139,7 @@ namespace BWAPI 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::set& getStartLocations() const 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; @@ -191,7 +187,6 @@ namespace BWAPI virtual int getAPM(bool includeSelects = false) const override; virtual bool setMap(const char *mapFileName) override; virtual void setFrameSkip(int frameSkip) override; - virtual bool hasPath(Position source, Position destination) const 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; diff --git a/bwapi4-includes/BWAPI/Client/PlayerImpl.h b/bwapi4-includes/BWAPI/Client/PlayerImpl.h index 7df3194..c4b7e20 100644 --- a/bwapi4-includes/BWAPI/Client/PlayerImpl.h +++ b/bwapi4-includes/BWAPI/Client/PlayerImpl.h @@ -25,8 +25,8 @@ namespace BWAPI virtual Race getRace() const override; virtual PlayerType getType() const override; virtual Force getForce() const override; - virtual bool isAlly(Player player) const override; - virtual bool isEnemy(Player player) 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; diff --git a/bwapi4-includes/BWAPI/Client/UnitImpl.h b/bwapi4-includes/BWAPI/Client/UnitImpl.h index 374297d..23353e9 100644 --- a/bwapi4-includes/BWAPI/Client/UnitImpl.h +++ b/bwapi4-includes/BWAPI/Client/UnitImpl.h @@ -74,7 +74,7 @@ namespace BWAPI virtual int getStimTimer() const override; virtual UnitType getBuildType() const override; - virtual UnitType::set getTrainingQueue() const override; + virtual UnitType::list getTrainingQueue() const override; virtual TechType getTech() const override; virtual UpgradeType getUpgrade() const override; virtual int getRemainingBuildTime() const override; diff --git a/bwapi4-includes/BWAPI/Color.h b/bwapi4-includes/BWAPI/Color.h index 4589332..6469581 100644 --- a/bwapi4-includes/BWAPI/Color.h +++ b/bwapi4-includes/BWAPI/Color.h @@ -66,7 +66,7 @@ namespace BWAPI /// The default color for Player 6. extern const Color Brown; - /// The default color for Player 7. + /// A bright white. Note that this is lighter than Player 7's white. extern const Color White; /// The default color for Player 8. @@ -206,4 +206,6 @@ namespace BWAPI /// @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/DamageType.h b/bwapi4-includes/BWAPI/DamageType.h index 25d1d60..642061b 100644 --- a/bwapi4-includes/BWAPI/DamageType.h +++ b/bwapi4-includes/BWAPI/DamageType.h @@ -28,25 +28,26 @@ namespace BWAPI /// @copydoc Type::Type(int) DamageType(int id = DamageTypes::Enum::None); }; - /// Namespace containing damage types + /// Namespace containing damage types. + /// + /// [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 { /// Retrieves the set of all the DamageTypes. /// /// @returns Set of DamageTypes. - const DamageType::const_set& allDamageTypes(); + const DamageType::set& allDamageTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const DamageType x - BWAPI_DECL(Independent); - BWAPI_DECL(Explosive); - BWAPI_DECL(Concussive); - BWAPI_DECL(Normal); - BWAPI_DECL(Ignore_Armor); - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + 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 index 9248e72..387377f 100644 --- a/bwapi4-includes/BWAPI/Error.h +++ b/bwapi4-includes/BWAPI/Error.h @@ -64,40 +64,37 @@ namespace BWAPI /// Retrieves the set of all the error codes. /// /// @returns Set of error types. - const Error::const_set& allErrors(); + const Error::set& allErrors(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const Error x - BWAPI_DECL(Unit_Does_Not_Exist); - BWAPI_DECL(Unit_Not_Visible); - BWAPI_DECL(Unit_Not_Owned); - BWAPI_DECL(Unit_Busy); - BWAPI_DECL(Incompatible_UnitType); - BWAPI_DECL(Incompatible_TechType); - BWAPI_DECL(Incompatible_State); - BWAPI_DECL(Already_Researched); - BWAPI_DECL(Fully_Upgraded); - BWAPI_DECL(Currently_Researching); - BWAPI_DECL(Currently_Upgrading); - BWAPI_DECL(Insufficient_Minerals); - BWAPI_DECL(Insufficient_Gas); - BWAPI_DECL(Insufficient_Supply); - BWAPI_DECL(Insufficient_Energy); - BWAPI_DECL(Insufficient_Tech); - BWAPI_DECL(Insufficient_Ammo); - BWAPI_DECL(Insufficient_Space); - BWAPI_DECL(Invalid_Tile_Position); - BWAPI_DECL(Unbuildable_Location); - BWAPI_DECL(Unreachable_Location); - BWAPI_DECL(Out_Of_Range); - BWAPI_DECL(Unable_To_Hit); - BWAPI_DECL(Access_Denied); - BWAPI_DECL(File_Not_Found); - BWAPI_DECL(Invalid_Parameter); - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + 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/ExplosionType.h b/bwapi4-includes/BWAPI/ExplosionType.h index 2c2d664..575a75c 100644 --- a/bwapi4-includes/BWAPI/ExplosionType.h +++ b/bwapi4-includes/BWAPI/ExplosionType.h @@ -53,37 +53,34 @@ namespace BWAPI /// Retrieves the set of all ExplosionTypes. /// /// @returns Set of ExplosionTypes. - const ExplosionType::const_set& allExplosionTypes(); + const ExplosionType::set& allExplosionTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const ExplosionType x - BWAPI_DECL(None); - BWAPI_DECL(Normal); - BWAPI_DECL(Radial_Splash); - BWAPI_DECL(Enemy_Splash); - BWAPI_DECL(Lockdown); - BWAPI_DECL(Nuclear_Missile); - BWAPI_DECL(Parasite); - BWAPI_DECL(Broodlings); - BWAPI_DECL(EMP_Shockwave); - BWAPI_DECL(Irradiate); - BWAPI_DECL(Ensnare); - BWAPI_DECL(Plague); - BWAPI_DECL(Stasis_Field); - BWAPI_DECL(Dark_Swarm); - BWAPI_DECL(Consume); - BWAPI_DECL(Yamato_Gun); - BWAPI_DECL(Restoration); - BWAPI_DECL(Disruption_Web); - BWAPI_DECL(Corrosive_Acid); - BWAPI_DECL(Mind_Control); - BWAPI_DECL(Feedback); - BWAPI_DECL(Optical_Flare); - BWAPI_DECL(Maelstrom); - BWAPI_DECL(Air_Splash); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + 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 index 32a462d..c478bd5 100644 --- a/bwapi4-includes/BWAPI/Filters.h +++ b/bwapi4-includes/BWAPI/Filters.h @@ -25,169 +25,448 @@ namespace BWAPI namespace Filter { - // presets + /// A unary filter that checks if the unit type is a transport (has capacity). 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/Forceset.h b/bwapi4-includes/BWAPI/Forceset.h index 8f7866a..753e54f 100644 --- a/bwapi4-includes/BWAPI/Forceset.h +++ b/bwapi4-includes/BWAPI/Forceset.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "SetContainer.h" namespace BWAPI { @@ -11,12 +11,9 @@ namespace BWAPI /// A container that holds a group of Forces. /// /// @see BWAPI::Force, BWAPI::Vectorset - class Forceset : public Vectorset + class Forceset : public SetContainer> { public: - Forceset(size_t initialSize = 5); - Forceset(const Forceset &other); - Forceset(Forceset &&other); /// @copydoc ForceInterface::getPlayers Playerset getPlayers() const; diff --git a/bwapi4-includes/BWAPI/Game.h b/bwapi4-includes/BWAPI/Game.h index ced6d21..7086db5 100644 --- a/bwapi4-includes/BWAPI/Game.h +++ b/bwapi4-includes/BWAPI/Game.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include #include @@ -114,7 +115,7 @@ namespace BWAPI /// @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::set& getNukeDots() const = 0; + virtual const Position::list& getNukeDots() const = 0; /// Retrieves the list of all unhandled game events. /// @@ -605,6 +606,10 @@ namespace BWAPI /// 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. + /// /// @param position /// Indicates the tile position that the top left corner of the structure is intended to go. /// @param type @@ -671,10 +676,10 @@ namespace BWAPI /// 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::set containing all the TilePosition objects that indicate a start + /// @returns A TilePosition::list containing all the TilePosition objects that indicate a start /// location. /// @see PlayerInterface::getStartLocation - virtual const TilePosition::set& getStartLocations() const = 0; + 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 @@ -1206,8 +1211,7 @@ namespace BWAPI virtual void setGUI(bool enabled) = 0; /// Retrieves the Starcraft instance number recorded by BWAPI to identify which Starcraft - /// instance an AI module belongs to. This only applies to users running multiple instances - /// of Starcraft. + /// instance an AI module belongs to. The very first instance should return 1. /// /// @returns /// An integer value representing the instance number. @@ -1243,6 +1247,8 @@ namespace BWAPI /// @param frameSkip /// 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 @@ -1257,7 +1263,7 @@ namespace BWAPI /// /// @retval true if there is a path between the two positions /// @retval false if there is no path - virtual bool hasPath(Position source, Position destination) const = 0; + bool hasPath(Position source, Position destination) const; /// Sets the alliance state of the current player with the target player. /// @@ -1511,14 +1517,14 @@ namespace BWAPI /// Output stream operator for printing text to Broodwar. Using this operator invokes /// Game::printf when a newline character is encountered. template < class T > - GameWrapper &operator <<(const T &in) + inline GameWrapper &operator <<(const T &in) { // Pass whatever into the stream ss << in; return *this; }; /// @overload - GameWrapper &operator <<( const ostream_manipulator &fn ); + GameWrapper &operator <<(ostream_manipulator fn); /// Flushes the Broodwar stream, printing all text in the stream to the screen. void flush(); diff --git a/bwapi4-includes/BWAPI/GameType.h b/bwapi4-includes/BWAPI/GameType.h index d08d80c..e271f98 100644 --- a/bwapi4-includes/BWAPI/GameType.h +++ b/bwapi4-includes/BWAPI/GameType.h @@ -47,27 +47,24 @@ namespace BWAPI /// Retrieves the set of all the valid GameTypes. /// /// @returns Set of available GameTypes. - const GameType::const_set& allGameTypes(); + const GameType::set& allGameTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const GameType x - BWAPI_DECL(Melee); - BWAPI_DECL(Free_For_All); - BWAPI_DECL(One_on_One); - BWAPI_DECL(Capture_The_Flag); - BWAPI_DECL(Greed); - BWAPI_DECL(Slaughter); - BWAPI_DECL(Sudden_Death); - BWAPI_DECL(Ladder); - BWAPI_DECL(Use_Map_Settings); - BWAPI_DECL(Team_Melee); - BWAPI_DECL(Team_Free_For_All); - BWAPI_DECL(Team_Capture_The_Flag); - BWAPI_DECL(Top_vs_Bottom); - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + 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/InterfaceEvent.h b/bwapi4-includes/BWAPI/InterfaceEvent.h index dd2ec76..75898b2 100644 --- a/bwapi4-includes/BWAPI/InterfaceEvent.h +++ b/bwapi4-includes/BWAPI/InterfaceEvent.h @@ -11,8 +11,8 @@ namespace BWAPI InterfaceEvent() : condProc(nullptr) , execProc(nullptr) - , runCount(0) , runFreq(0) + , runCount(0) , step(0) {}; @@ -61,7 +61,7 @@ namespace BWAPI /// /// @retval true If the event has completed all runs and/or is marked for removal. /// @retval false If the event should continue execution. - bool isFinished() + bool isFinished() const { return this->runCount == 0; }; diff --git a/bwapi4-includes/BWAPI/Order.h b/bwapi4-includes/BWAPI/Order.h index 5b8558b..c397b06 100644 --- a/bwapi4-includes/BWAPI/Order.h +++ b/bwapi4-includes/BWAPI/Order.h @@ -224,168 +224,165 @@ namespace BWAPI /// Retrieves the set of all the Orders. /// /// @returns Set of all Order types. - const Order::const_set& allOrders(); + const Order::set& allOrders(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const Order x - BWAPI_DECL(Die); - BWAPI_DECL(Stop); - BWAPI_DECL(Guard); - BWAPI_DECL(PlayerGuard); - BWAPI_DECL(TurretGuard); - BWAPI_DECL(BunkerGuard); - BWAPI_DECL(Move); - BWAPI_DECL(AttackUnit); - BWAPI_DECL(AttackTile); - BWAPI_DECL(Hover); - BWAPI_DECL(AttackMove); - BWAPI_DECL(InfestedCommandCenter); - BWAPI_DECL(UnusedNothing); - BWAPI_DECL(UnusedPowerup); - BWAPI_DECL(TowerGuard); - BWAPI_DECL(VultureMine); - BWAPI_DECL(Nothing); - BWAPI_DECL(CastInfestation); - BWAPI_DECL(InfestingCommandCenter); - BWAPI_DECL(PlaceBuilding); - BWAPI_DECL(CreateProtossBuilding); - BWAPI_DECL(ConstructingBuilding); - BWAPI_DECL(Repair); - BWAPI_DECL(PlaceAddon); - BWAPI_DECL(BuildAddon); - BWAPI_DECL(Train); - BWAPI_DECL(RallyPointUnit); - BWAPI_DECL(RallyPointTile); - BWAPI_DECL(ZergBirth); - BWAPI_DECL(ZergUnitMorph); - BWAPI_DECL(ZergBuildingMorph); - BWAPI_DECL(IncompleteBuilding); - BWAPI_DECL(BuildNydusExit); - BWAPI_DECL(EnterNydusCanal); - BWAPI_DECL(Follow); - BWAPI_DECL(Carrier); - BWAPI_DECL(ReaverCarrierMove); - BWAPI_DECL(CarrierIgnore2); - BWAPI_DECL(Reaver); - BWAPI_DECL(TrainFighter); - BWAPI_DECL(InterceptorAttack); - BWAPI_DECL(ScarabAttack); - BWAPI_DECL(RechargeShieldsUnit); - BWAPI_DECL(RechargeShieldsBattery); - BWAPI_DECL(ShieldBattery); - BWAPI_DECL(InterceptorReturn); - BWAPI_DECL(BuildingLand); - BWAPI_DECL(BuildingLiftOff); - BWAPI_DECL(DroneLiftOff); - BWAPI_DECL(LiftingOff); - BWAPI_DECL(ResearchTech); - BWAPI_DECL(Upgrade); - BWAPI_DECL(Larva); - BWAPI_DECL(SpawningLarva); - BWAPI_DECL(Harvest1); - BWAPI_DECL(Harvest2); - BWAPI_DECL(MoveToGas); - BWAPI_DECL(WaitForGas); - BWAPI_DECL(HarvestGas); - BWAPI_DECL(ReturnGas); - BWAPI_DECL(MoveToMinerals); - BWAPI_DECL(WaitForMinerals); - BWAPI_DECL(MiningMinerals); - BWAPI_DECL(Harvest3); - BWAPI_DECL(Harvest4); - BWAPI_DECL(ReturnMinerals); - BWAPI_DECL(Interrupted); - BWAPI_DECL(EnterTransport); - BWAPI_DECL(PickupIdle); - BWAPI_DECL(PickupTransport); - BWAPI_DECL(PickupBunker); - BWAPI_DECL(Pickup4); - BWAPI_DECL(PowerupIdle); - BWAPI_DECL(Sieging); - BWAPI_DECL(Unsieging); - BWAPI_DECL(InitCreepGrowth); - BWAPI_DECL(SpreadCreep); - BWAPI_DECL(StoppingCreepGrowth); - BWAPI_DECL(GuardianAspect); - BWAPI_DECL(ArchonWarp); - BWAPI_DECL(CompletingArchonSummon); - BWAPI_DECL(HoldPosition); - BWAPI_DECL(Cloak); - BWAPI_DECL(Decloak); - BWAPI_DECL(Unload); - BWAPI_DECL(MoveUnload); - BWAPI_DECL(FireYamatoGun); - BWAPI_DECL(CastLockdown); - BWAPI_DECL(Burrowing); - BWAPI_DECL(Burrowed); - BWAPI_DECL(Unburrowing); - BWAPI_DECL(CastDarkSwarm); - BWAPI_DECL(CastParasite); - BWAPI_DECL(CastSpawnBroodlings); - BWAPI_DECL(CastEMPShockwave); - BWAPI_DECL(NukeWait); - BWAPI_DECL(NukeTrain); - BWAPI_DECL(NukeLaunch); - BWAPI_DECL(NukePaint); - BWAPI_DECL(NukeUnit); - BWAPI_DECL(CastNuclearStrike); - BWAPI_DECL(NukeTrack); - BWAPI_DECL(CloakNearbyUnits); - BWAPI_DECL(PlaceMine); - BWAPI_DECL(RightClickAction); - BWAPI_DECL(CastRecall); - BWAPI_DECL(Teleport); - BWAPI_DECL(CastScannerSweep); - BWAPI_DECL(Scanner); - BWAPI_DECL(CastDefensiveMatrix); - BWAPI_DECL(CastPsionicStorm); - BWAPI_DECL(CastIrradiate); - BWAPI_DECL(CastPlague); - BWAPI_DECL(CastConsume); - BWAPI_DECL(CastEnsnare); - BWAPI_DECL(CastStasisField); - BWAPI_DECL(CastHallucination); - BWAPI_DECL(Hallucination2); - BWAPI_DECL(ResetCollision); - BWAPI_DECL(Patrol); - BWAPI_DECL(CTFCOPInit); - BWAPI_DECL(CTFCOPStarted); - BWAPI_DECL(CTFCOP2); - BWAPI_DECL(ComputerAI); - BWAPI_DECL(AtkMoveEP); - BWAPI_DECL(HarassMove); - BWAPI_DECL(AIPatrol); - BWAPI_DECL(GuardPost); - BWAPI_DECL(RescuePassive); - BWAPI_DECL(Neutral); - BWAPI_DECL(ComputerReturn); - BWAPI_DECL(SelfDestructing); - BWAPI_DECL(Critter); - BWAPI_DECL(HiddenGun); - BWAPI_DECL(OpenDoor); - BWAPI_DECL(CloseDoor); - BWAPI_DECL(HideTrap); - BWAPI_DECL(RevealTrap); - BWAPI_DECL(EnableDoodad); - BWAPI_DECL(DisableDoodad); - BWAPI_DECL(WarpIn); - BWAPI_DECL(Medic); - BWAPI_DECL(MedicHeal); - BWAPI_DECL(HealMove); - BWAPI_DECL(MedicHealToIdle); - BWAPI_DECL(CastRestoration); - BWAPI_DECL(CastDisruptionWeb); - BWAPI_DECL(CastMindControl); - BWAPI_DECL(DarkArchonMeld); - BWAPI_DECL(CastFeedback); - BWAPI_DECL(CastOpticalFlare); - BWAPI_DECL(CastMaelstrom); - BWAPI_DECL(JunkYardDog); - BWAPI_DECL(Fatal); - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + extern const Order Die; + extern const Order Stop; + extern const Order Guard; + extern const Order PlayerGuard; + extern const Order TurretGuard; + extern const Order BunkerGuard; + extern const Order Move; + extern const Order AttackUnit; + extern const Order AttackTile; + extern const Order Hover; + extern const Order AttackMove; + extern const Order InfestedCommandCenter; + extern const Order UnusedNothing; + extern const Order UnusedPowerup; + extern const Order TowerGuard; + extern const Order VultureMine; + extern const Order Nothing; + extern const Order CastInfestation; + extern const Order InfestingCommandCenter; + extern const Order PlaceBuilding; + extern const Order CreateProtossBuilding; + extern const Order ConstructingBuilding; + extern const Order Repair; + extern const Order PlaceAddon; + extern const Order BuildAddon; + extern const Order Train; + extern const Order RallyPointUnit; + extern const Order RallyPointTile; + extern const Order ZergBirth; + extern const Order ZergUnitMorph; + extern const Order ZergBuildingMorph; + extern const Order IncompleteBuilding; + extern const Order BuildNydusExit; + extern const Order EnterNydusCanal; + extern const Order Follow; + extern const Order Carrier; + extern const Order ReaverCarrierMove; + extern const Order CarrierIgnore2; + extern const Order Reaver; + extern const Order TrainFighter; + extern const Order InterceptorAttack; + extern const Order ScarabAttack; + extern const Order RechargeShieldsUnit; + extern const Order RechargeShieldsBattery; + extern const Order ShieldBattery; + extern const Order InterceptorReturn; + extern const Order BuildingLand; + extern const Order BuildingLiftOff; + extern const Order DroneLiftOff; + extern const Order LiftingOff; + extern const Order ResearchTech; + extern const Order Upgrade; + extern const Order Larva; + extern const Order SpawningLarva; + extern const Order Harvest1; + extern const Order Harvest2; + extern const Order MoveToGas; + extern const Order WaitForGas; + extern const Order HarvestGas; + extern const Order ReturnGas; + extern const Order MoveToMinerals; + extern const Order WaitForMinerals; + extern const Order MiningMinerals; + extern const Order Harvest3; + extern const Order Harvest4; + extern const Order ReturnMinerals; + extern const Order Interrupted; + extern const Order EnterTransport; + extern const Order PickupIdle; + extern const Order PickupTransport; + extern const Order PickupBunker; + extern const Order Pickup4; + extern const Order PowerupIdle; + extern const Order Sieging; + extern const Order Unsieging; + extern const Order InitCreepGrowth; + extern const Order SpreadCreep; + extern const Order StoppingCreepGrowth; + extern const Order GuardianAspect; + extern const Order ArchonWarp; + extern const Order CompletingArchonSummon; + extern const Order HoldPosition; + extern const Order Cloak; + extern const Order Decloak; + extern const Order Unload; + extern const Order MoveUnload; + extern const Order FireYamatoGun; + extern const Order CastLockdown; + extern const Order Burrowing; + extern const Order Burrowed; + extern const Order Unburrowing; + extern const Order CastDarkSwarm; + extern const Order CastParasite; + extern const Order CastSpawnBroodlings; + extern const Order CastEMPShockwave; + extern const Order NukeWait; + extern const Order NukeTrain; + extern const Order NukeLaunch; + extern const Order NukePaint; + extern const Order NukeUnit; + extern const Order CastNuclearStrike; + extern const Order NukeTrack; + extern const Order CloakNearbyUnits; + extern const Order PlaceMine; + extern const Order RightClickAction; + extern const Order CastRecall; + extern const Order Teleport; + extern const Order CastScannerSweep; + extern const Order Scanner; + extern const Order CastDefensiveMatrix; + extern const Order CastPsionicStorm; + extern const Order CastIrradiate; + extern const Order CastPlague; + extern const Order CastConsume; + extern const Order CastEnsnare; + extern const Order CastStasisField; + extern const Order CastHallucination; + extern const Order Hallucination2; + extern const Order ResetCollision; + extern const Order Patrol; + extern const Order CTFCOPInit; + extern const Order CTFCOPStarted; + extern const Order CTFCOP2; + extern const Order ComputerAI; + extern const Order AtkMoveEP; + extern const Order HarassMove; + extern const Order AIPatrol; + extern const Order GuardPost; + extern const Order RescuePassive; + extern const Order Neutral; + extern const Order ComputerReturn; + extern const Order SelfDestructing; + extern const Order Critter; + extern const Order HiddenGun; + extern const Order OpenDoor; + extern const Order CloseDoor; + extern const Order HideTrap; + extern const Order RevealTrap; + extern const Order EnableDoodad; + extern const Order DisableDoodad; + extern const Order WarpIn; + extern const Order Medic; + extern const Order MedicHeal; + extern const Order HealMove; + extern const Order MedicHealToIdle; + extern const Order CastRestoration; + extern const Order CastDisruptionWeb; + extern const Order CastMindControl; + extern const Order DarkArchonMeld; + extern const Order CastFeedback; + extern const Order CastOpticalFlare; + extern const Order CastMaelstrom; + extern const Order JunkYardDog; + extern const Order Fatal; + extern const Order None; + extern const Order Unknown; }; + + static_assert(sizeof(Order) == sizeof(int), "Expected type to resolve to primitive size."); } diff --git a/bwapi4-includes/BWAPI/Player.h b/bwapi4-includes/BWAPI/Player.h index 71006e4..3609748 100644 --- a/bwapi4-includes/BWAPI/Player.h +++ b/bwapi4-includes/BWAPI/Player.h @@ -130,7 +130,7 @@ namespace BWAPI /// if \p player is neutral or an observer. /// /// @see isEnemy - virtual bool isAlly(Player player) const = 0; + virtual bool isAlly(const Player player) const = 0; /// Checks if this player is unallied to the specified player. /// @@ -144,7 +144,7 @@ namespace BWAPI /// \p player is neutral or an observer. /// /// @see isAlly - virtual bool isEnemy(Player player) const = 0; + virtual bool isEnemy(const Player player) const = 0; /// Checks if this player is the neutral player. /// diff --git a/bwapi4-includes/BWAPI/PlayerType.h b/bwapi4-includes/BWAPI/PlayerType.h index 3a370aa..1912537 100644 --- a/bwapi4-includes/BWAPI/PlayerType.h +++ b/bwapi4-includes/BWAPI/PlayerType.h @@ -43,23 +43,20 @@ namespace BWAPI /// Retrieves the set of all the PlayerTypes. /// /// @returns Set consisting of all valid PlayerTypes. - const PlayerType::const_set& allPlayerTypes(); + const PlayerType::set& allPlayerTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const PlayerType x - BWAPI_DECL(None); - BWAPI_DECL(Computer); - BWAPI_DECL(Player); - BWAPI_DECL(RescuePassive); - BWAPI_DECL(EitherPreferComputer); - BWAPI_DECL(EitherPreferHuman); - BWAPI_DECL(Neutral); - BWAPI_DECL(Closed); - BWAPI_DECL(PlayerLeft); - BWAPI_DECL(ComputerLeft); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + extern const PlayerType None; + extern const PlayerType Computer; + extern const PlayerType Player; + extern const PlayerType RescuePassive; + extern const PlayerType EitherPreferComputer; + extern const PlayerType EitherPreferHuman; + extern const PlayerType Neutral; + extern const PlayerType Closed; + extern const PlayerType PlayerLeft; + extern const PlayerType ComputerLeft; + extern const PlayerType Unknown; } + + static_assert(sizeof(PlayerType) == sizeof(int), "Expected type to resolve to primitive size."); } diff --git a/bwapi4-includes/BWAPI/Playerset.h b/bwapi4-includes/BWAPI/Playerset.h index 914a1b8..880683a 100644 --- a/bwapi4-includes/BWAPI/Playerset.h +++ b/bwapi4-includes/BWAPI/Playerset.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "SetContainer.h" #include #include @@ -11,12 +11,9 @@ namespace BWAPI typedef PlayerInterface *Player; class Unitset; - class Playerset : public Vectorset + class Playerset : public SetContainer> { public: - Playerset(size_t initialSize = 16); - Playerset(const Playerset &other); - Playerset(Playerset &&other); /// Returns the set of all units that every /// player in this set owns. diff --git a/bwapi4-includes/BWAPI/Position.h b/bwapi4-includes/BWAPI/Position.h index 1fc8f28..efa7038 100644 --- a/bwapi4-includes/BWAPI/Position.h +++ b/bwapi4-includes/BWAPI/Position.h @@ -3,15 +3,12 @@ #include #include #include - -#include - -#ifndef _MAKE_POSITION_TEMPLATE +#include #ifdef SWIG -#define _MAKE_POSITION_TEMPLATE(_n,_t,_s) typedef BWAPI::Point<_t,_s> _n; +#define BWAPI_MAKE_POSITION_TEMPLATE(_n,T,_s) typedef BWAPI::Point _n; #else -#define _MAKE_POSITION_TEMPLATE(_n,_t,_s) typedef BWAPI::Point<_t,_s> _n; \ +#define BWAPI_MAKE_POSITION_TEMPLATE(_n,T,_s) typedef BWAPI::Point _n; \ namespace _n ## s \ { const _n Invalid(32000/_s,32000/_s); \ const _n None(32000/_s,32032/_s); \ @@ -20,90 +17,146 @@ } #endif -#define _OPERATOR_OP_PT(op) Point operator op (const Point &pos) const \ - { return Point(this->x op pos.x, this->y op pos.y); }; \ - Point &operator op ## = (const Point &pos) \ - { this->x op ## = pos.x; this->y op ## = pos.y; \ - return *this; }; - -#define _OPERATOR_OP_VAL(op) Point operator op (const _T &val) const \ - { return Point(this->x op val, this->y op val); }; \ - Point &operator op ## = (const _T &val) \ - { this->x op ## = val; this->y op ## = val; \ - return *this; }; - -#define _OPERATOR_OP_VAL_CHK(op) Point operator op (const _T &val) const \ - { if ( val == 0 ) return Point(32000/__Scale,32000/__Scale); \ - return Point(this->x op val, this->y op val); }; \ - Point &operator op ## = (const _T &val) \ - { if ( val == 0 ) { this->x = 32000/__Scale; this->y = 32000/__Scale; } \ - else { this->x op ## = val; this->y op ## = val; } \ - return *this; }; - -#endif - namespace BWAPI { // Declaration - template + template class Point; // Restrictions (no division by 0 or types too small to contain map positions) - template class Point<_T, 0> {}; - template class Point {}; - template class Point {}; - template class Point {}; + template class Point {}; + template class Point {}; + template class Point {}; + template class Point {}; // ------------------------------------------------------ Point template ---------------- - template + template class Point { public: - typedef Vectorset< Point<_T,__Scale> > set; + typedef std::deque< Point > list; // Constructors - Point(_T _x = 0, _T _y = 0) : x(_x), y(_y) {}; - template Point(const Point<_NT, __Scale> &pt) : x( (_T)pt.x ), y( (_T)pt.y ) {}; + Point() : x(T{}), y(T{}) {} + Point(T _x, T _y) : x(_x), y(_y) {} + template Point(const Point<_NT, Scale> &pt) : x( (T)pt.x ), y( (T)pt.y ) {} #pragma warning( push ) #pragma warning( disable: 4723 ) // Conversion constructor template explicit Point(const Point<_NT, __NScale> &pt) - : x( (_T)(__NScale > __Scale ? pt.x*(__NScale/__Scale) : pt.x/(__Scale/__NScale)) ) - , y( (_T)(__NScale > __Scale ? pt.y*(__NScale/__Scale) : pt.y/(__Scale/__NScale)) ) { }; + : x((T)(__NScale > Scale ? pt.x*(__NScale / Scale) : pt.x / (Scale / __NScale))) + , y((T)(__NScale > Scale ? pt.y*(__NScale / Scale) : pt.y / (Scale / __NScale))) { } #pragma warning( pop ) - // Conversion restriction constructor - template Point(const Point<_NT, 0> &pt) : x(0), y(0) {}; - // Operators - operator bool() const { return this->isValid(); }; + explicit operator bool() const { return this->isValid(); }; - bool operator == (const Point<_T,__Scale> &pos) const + bool operator == (const Point &pos) const { return std::tie(this->x, this->y) == std::tie(pos.x, pos.y); }; - bool operator != (const Point<_T,__Scale> &pos) const + bool operator != (const Point &pos) const { return !(*this == pos); }; - bool operator < (const Point<_T,__Scale> &position) const + bool operator < (const Point &position) const { return std::tie(this->x, this->y) < std::tie(position.x, position.y); }; - _OPERATOR_OP_PT(+) - _OPERATOR_OP_PT(-) + inline Point &operator += (const Point &p) + { + x += p.x; + y += p.y; + return *this; + }; + inline Point operator + (const Point &p) const + { + Point r(*this); + return r += p; + }; + inline Point &operator -= (const Point &p) + { + x -= p.x; + y -= p.y; + return *this; + }; + inline Point operator - (const Point &p) const + { + Point r(*this); + return r -= p; + }; - _OPERATOR_OP_VAL(*) - _OPERATOR_OP_VAL(&) - _OPERATOR_OP_VAL(|) - _OPERATOR_OP_VAL(^) + inline Point &operator *= (const T &v) + { + x *= v; + y *= v; + return *this; + }; + inline Point operator *(const T &v) const + { + Point r(*this); + return r *= v; + }; + inline Point &operator |= (const T &v) + { + x |= v; + y |= v; + return *this; + }; + inline Point operator |(const T &v) const + { + Point r(*this); + return r |= v; + }; + inline Point &operator &= (const T &v) + { + x &= v; + y &= v; + return *this; + }; + inline Point operator &(const T &v) const + { + Point r(*this); + return r &= v; + }; + inline Point &operator ^= (const T &v) + { + x ^= v; + y ^= v; + return *this; + }; + inline Point operator ^(const T &v) const + { + Point r(*this); + return r ^= v; + }; + + Point operator / (const T &v) const + { + Point result(*this); + return result /= v; + }; + Point &operator /= (const T &val) + { + if (val == 0) { x = 32000 / Scale; y = 32000 / Scale; } + else { x /= val; y /= val; } + return *this; + }; + Point operator %(const T &v) const + { + Point result(*this); + return result %= v; + }; + Point &operator %= (const T &val) + { + if (val == 0) { x = 32000 / Scale; y = 32000 / Scale; } + else { x %= val; y %= val; } + return *this; + }; - _OPERATOR_OP_VAL_CHK(/) - _OPERATOR_OP_VAL_CHK(%) - /// Ouput stream operator overload. Outputs the Point in the format "(x,y)" without /// quotations. /// @@ -112,10 +165,14 @@ namespace BWAPI /// @param pt /// Point to output. /// @returns Output stream \p out. - friend std::ostream &operator << (std::ostream &out, const Point<_T,__Scale> &pt) + friend std::ostream &operator << (std::ostream &out, const Point &pt) { return out << '(' << pt.x << ',' << pt.y << ')'; }; + friend std::wostream &operator << (std::wostream &out, const Point &pt) + { + return out << L'(' << pt.x << L',' << pt.y << L')'; + }; /// Input stream operator overload. Reads the input in the form "x y" without quotations. /// The x and y values are read as type T(typically int or float) and stored into pt. @@ -125,7 +182,11 @@ namespace BWAPI /// @param pt /// The receiving variable. /// @returns Input stream \p in. - friend std::istream &operator >> (std::istream &in, Point<_T,__Scale> &pt) + friend std::istream &operator >> (std::istream &in, Point &pt) + { + return in >> pt.x >> pt.y; + }; + friend std::wistream &operator >> (std::wistream &in, Point &pt) { return in >> pt.x >> pt.y; }; @@ -160,7 +221,7 @@ namespace BWAPI /// /// @returns A double representing the distance between this point and \p position. /// @see getApproxDistance - double getDistance(const Point<_T,__Scale> &position) const + double getDistance(const Point &position) const { return ((*this) - position).getLength(); }; @@ -189,7 +250,7 @@ namespace BWAPI /// /// @returns An integer representing the distance between this point and \p position. /// @see getDistance - int getApproxDistance(const Point<_T,__Scale> &position) const + int getApproxDistance(const Point &position) const { unsigned int min = abs((int)(this->x - position.x)); unsigned int max = abs((int)(this->y - position.y)); @@ -213,7 +274,7 @@ namespace BWAPI /// /// @returns A reference to itself. /// @see setMin - Point &setMax(_T max_x, _T max_y) + Point &setMax(T max_x, T max_y) { if ( x > max_x ) x = max_x; @@ -222,7 +283,7 @@ namespace BWAPI return *this; }; /// @overload - Point &setMax(const Point<_T,__Scale> &max) + Point &setMax(const Point &max) { this->setMax(max.x, max.y); return *this; @@ -238,7 +299,7 @@ namespace BWAPI /// /// @returns A reference to itself. /// @see setMax - Point &setMin(_T min_x, _T min_y) + Point &setMin(T min_x, T min_y) { if ( x < min_x ) x = min_x; @@ -247,7 +308,7 @@ namespace BWAPI return *this; }; /// @overload - Point &setMin(const Point<_T,__Scale> &min) + Point &setMin(const Point &min) { this->setMin(min.x, min.y); return *this; @@ -256,11 +317,10 @@ namespace BWAPI /// The x and y members for this class. /// /// Simply reference these members when retrieving a position's x and y values. - _T x, y; + T x, y; }; - _MAKE_POSITION_TEMPLATE(WalkPosition,int,8) - _MAKE_POSITION_TEMPLATE(Position,int,1) - _MAKE_POSITION_TEMPLATE(TilePosition,int,32) + BWAPI_MAKE_POSITION_TEMPLATE(WalkPosition,int,8) + BWAPI_MAKE_POSITION_TEMPLATE(Position,int,1) + BWAPI_MAKE_POSITION_TEMPLATE(TilePosition,int,32) } - diff --git a/bwapi4-includes/BWAPI/Race.h b/bwapi4-includes/BWAPI/Race.h index 397a3d3..b8c462d 100644 --- a/bwapi4-includes/BWAPI/Race.h +++ b/bwapi4-includes/BWAPI/Race.h @@ -87,18 +87,15 @@ namespace BWAPI /// Retrieves the set of all races. /// /// @returns Race::set containing all the Race types. - const Race::const_set& allRaces(); + const Race::set& allRaces(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const Race x - BWAPI_DECL(Zerg); - BWAPI_DECL(Terran); - BWAPI_DECL(Protoss); - BWAPI_DECL(Random); - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + extern const Race Zerg; + extern const Race Terran; + extern const Race Protoss; + extern const Race Random; + extern const Race None; + extern const Race Unknown; } + + static_assert(sizeof(Race) == sizeof(int), "Expected type to resolve to primitive size."); } diff --git a/bwapi4-includes/BWAPI/Regionset.h b/bwapi4-includes/BWAPI/Regionset.h index 5d68756..c4bde43 100644 --- a/bwapi4-includes/BWAPI/Regionset.h +++ b/bwapi4-includes/BWAPI/Regionset.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "SetContainer.h" #include #include @@ -11,12 +11,9 @@ namespace BWAPI class Unitset; - class Regionset : public Vectorset + class Regionset : public SetContainer> { public: - Regionset(size_t initialSize = 16); - Regionset(const Regionset &other); - Regionset(Regionset &&other); /// @copydoc RegionInterface::getCenter Position getCenter() const; diff --git a/bwapi4-includes/BWAPI/SetContainer.h b/bwapi4-includes/BWAPI/SetContainer.h new file mode 100644 index 0000000..5187f51 --- /dev/null +++ b/bwapi4-includes/BWAPI/SetContainer.h @@ -0,0 +1,52 @@ +#pragma once +#include +#include + +namespace BWAPI +{ + template + using SetContainerUnderlyingT = std::unordered_set < T, HashT >; + + /// This container is used to wrap convenience functions for BWAPI and be used as a bridge with + /// a built-in set type. + /// + /// @tparam T + /// Type that this set contains. + /// @tparam HashT + /// Hash type. Defaults to integral hashing for BWAPI usage. + template > + class SetContainer : public SetContainerUnderlyingT < T, HashT > + { + public: + SetContainer() : SetContainerUnderlyingT() {} + SetContainer(SetContainer const &other) : SetContainerUnderlyingT(other) {} + SetContainer(SetContainer &&other) : SetContainerUnderlyingT(std::forward(other)) {} + SetContainer(std::initializer_list ilist) : SetContainerUnderlyingT(ilist) {} + + template + SetContainer(IterT _begin, IterT _end) : SetContainerUnderlyingT(_begin, _end) {} + + /// Iterates the set and erases each element x where pred(x) returns true. + /// + /// @param pred + /// Predicate for removing elements. + template + void erase_if(const Pred& pred) { + auto it = this->begin(); + while (it != this->end()) { + if (pred(*it)) it = this->erase(it); + else ++it; + } + }; + + /// Checks if this set contains a specific value. + /// + /// @param value + /// Value to search for. + bool contains(T const &value) const + { + return count(value) != 0; + } + }; + +} diff --git a/bwapi4-includes/BWAPI/TechType.h b/bwapi4-includes/BWAPI/TechType.h index b538dd5..0b8bedd 100644 --- a/bwapi4-includes/BWAPI/TechType.h +++ b/bwapi4-includes/BWAPI/TechType.h @@ -4,6 +4,7 @@ namespace BWAPI { + class UnitType; class WeaponType; class Order; class Race; @@ -125,7 +126,7 @@ namespace BWAPI /// Retrieves the set of all UnitTypes that are capable of using this ability. /// /// @returns Set of UnitTypes that can use this ability when researched. - const UnitType::const_set& whatUses() const; + const UnitType::set& whatUses() const; /// Retrieves the Order that a Unit uses when using this ability. /// @@ -138,48 +139,45 @@ namespace BWAPI /// Retrieves the set of all the TechTypes. /// /// @returns Set of all available TechTypes. - const TechType::const_set& allTechTypes(); + const TechType::set& allTechTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const TechType x - BWAPI_DECL(Stim_Packs); - BWAPI_DECL(Lockdown); - BWAPI_DECL(EMP_Shockwave); - BWAPI_DECL(Spider_Mines); - BWAPI_DECL(Scanner_Sweep); - BWAPI_DECL(Tank_Siege_Mode); - BWAPI_DECL(Defensive_Matrix); - BWAPI_DECL(Irradiate); - BWAPI_DECL(Yamato_Gun); - BWAPI_DECL(Cloaking_Field); - BWAPI_DECL(Personnel_Cloaking); - BWAPI_DECL(Burrowing); - BWAPI_DECL(Infestation); - BWAPI_DECL(Spawn_Broodlings); - BWAPI_DECL(Dark_Swarm); - BWAPI_DECL(Plague); - BWAPI_DECL(Consume); - BWAPI_DECL(Ensnare); - BWAPI_DECL(Parasite); - BWAPI_DECL(Psionic_Storm); - BWAPI_DECL(Hallucination); - BWAPI_DECL(Recall); - BWAPI_DECL(Stasis_Field); - BWAPI_DECL(Archon_Warp); - BWAPI_DECL(Restoration); - BWAPI_DECL(Disruption_Web); - BWAPI_DECL(Mind_Control); - BWAPI_DECL(Dark_Archon_Meld); - BWAPI_DECL(Feedback); - BWAPI_DECL(Optical_Flare); - BWAPI_DECL(Maelstrom); - BWAPI_DECL(Lurker_Aspect); - BWAPI_DECL(Healing); - BWAPI_DECL(None); - BWAPI_DECL(Nuclear_Strike); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + extern const TechType Stim_Packs; + extern const TechType Lockdown; + extern const TechType EMP_Shockwave; + extern const TechType Spider_Mines; + extern const TechType Scanner_Sweep; + extern const TechType Tank_Siege_Mode; + extern const TechType Defensive_Matrix; + extern const TechType Irradiate; + extern const TechType Yamato_Gun; + extern const TechType Cloaking_Field; + extern const TechType Personnel_Cloaking; + extern const TechType Burrowing; + extern const TechType Infestation; + extern const TechType Spawn_Broodlings; + extern const TechType Dark_Swarm; + extern const TechType Plague; + extern const TechType Consume; + extern const TechType Ensnare; + extern const TechType Parasite; + extern const TechType Psionic_Storm; + extern const TechType Hallucination; + extern const TechType Recall; + extern const TechType Stasis_Field; + extern const TechType Archon_Warp; + extern const TechType Restoration; + extern const TechType Disruption_Web; + extern const TechType Mind_Control; + extern const TechType Dark_Archon_Meld; + extern const TechType Feedback; + extern const TechType Optical_Flare; + extern const TechType Maelstrom; + extern const TechType Lurker_Aspect; + extern const TechType Healing; + extern const TechType None; + extern const TechType Nuclear_Strike; + extern const TechType Unknown; }; + + static_assert(sizeof(TechType) == sizeof(int), "Expected type to resolve to primitive size."); } diff --git a/bwapi4-includes/BWAPI/Type.h b/bwapi4-includes/BWAPI/Type.h index d080963..89e66b3 100644 --- a/bwapi4-includes/BWAPI/Type.h +++ b/bwapi4-includes/BWAPI/Type.h @@ -1,52 +1,15 @@ #pragma once +#include + #include #include +#include #include #include -#include - namespace BWAPI { - // @TODO Get rid of this eventually. - template - class Typeset : public Vectorset - { - public: - // Constructors - Typeset() : Vectorset() {}; - // copy ctor - Typeset(const Typeset &other) : Vectorset( other ) {}; - Typeset(const ConstVectorset &other) : Vectorset( other ) {}; - - // move ctor - Typeset(Typeset &&other) : Vectorset( std::forward< Typeset >(other) ) {}; - // type ctor - Typeset(const T &val) : Vectorset() { this->push_back(val); }; - // array ctor - Typeset(const T *pArray, size_t size) : Vectorset(pArray, size) {}; - Typeset(const int *pArray, size_t size) : Vectorset((const T*)pArray, size) {}; - - ~Typeset() {}; - - // Operators (adding elements) - Typeset operator |(const T &val) const - { - Typeset newset(*this); - newset.insert(val); - return newset; - }; - Typeset &operator |=(const T &val) - { - this->insert(val); - return *this; - }; - Typeset &operator |=(const Typeset &val) - { - this->insert(val); - return *this; - }; - }; + template class Type; /// Base superclass for all BWAPI Types. template @@ -59,6 +22,7 @@ namespace BWAPI /// Array of strings containing the type names. static const std::string typeNames[UnknownId+1]; + /// Type that maps names to their type values. typedef std::unordered_map typeMapT; private: @@ -79,7 +43,6 @@ namespace BWAPI } return result; } - public: /// Expected type constructor. If the type is an invalid type, then it becomes Types::Unknown. /// A type is invalid if its value is less than 0 or greater than Types::Unknown. @@ -90,11 +53,11 @@ namespace BWAPI /// If it is omitted, then it becomes Types::None. explicit Type(int id) : tid( id < 0 || id > UnknownId ? UnknownId : id ) {}; - /// The set that contains the current type. - typedef Typeset set; + /// A set type that contains the current type. + typedef SetContainer set; - /// The constant set that contains the current type. - typedef ConstVectorset const_set; + /// A list type that contains the current type. + typedef std::deque list; /// Conversion/convenience operator to convert this type to its primitive type. inline operator int() const { return this->tid; }; @@ -137,10 +100,15 @@ namespace BWAPI /// Output stream operator overload. Allows printing of the type without calling /// Type::getName. - friend inline std::ostream &operator << (std::ostream &out, const Type &t) + friend inline std::ostream &operator << (std::ostream &out, const Type &t) { return out << t.getName(); }; + friend inline std::wostream &operator << (std::wostream &out, const Type &t) + { + std::wstring wideName{ t.getName().begin(), t.getName().end() }; + return out << wideName; + }; /// Searches for the type associated with the given string and returns it. /// diff --git a/bwapi4-includes/BWAPI/Unit.h b/bwapi4-includes/BWAPI/Unit.h index 13b5648..4474e06 100644 --- a/bwapi4-includes/BWAPI/Unit.h +++ b/bwapi4-includes/BWAPI/Unit.h @@ -499,7 +499,7 @@ namespace BWAPI /// @returns a UnitType::set containing all the types that are in this factory's training /// queue. /// @see train, cancelTrain, isTraining - virtual UnitType::set getTrainingQueue() const = 0; + virtual UnitType::list getTrainingQueue() const = 0; /// Retrieves the technology that this unit is currently researching. /// @@ -903,7 +903,9 @@ namespace BWAPI /// @see UnitInterface::stop virtual bool isIdle() const = 0; - /** Returns true if the unit can be interrupted. */ + /// Checks if the unit can be interrupted. + /// + /// @returns true if this unit can be interrupted, or false if this unit is uninterruptable virtual bool isInterruptible() const = 0; /// Checks the invincibility state for this unit. @@ -1011,14 +1013,19 @@ namespace BWAPI /// false if it is not bool isRepairing() const; - /** Returns true if the unit is a building that is researching tech. See TechTypes for the complete list - * of available techs in Broodwar. - * \see UnitInterface::research, UnitInterface::cancelResearch, UnitInterface::getTech, UnitInterface::getRemainingResearchTime. */ + /// Checks if this unit is a structure that is currently researching a technology. + /// See TechTypes for a complete list of technologies in Broodwar. + /// + /// @returns true if this structure is researching a technology, false otherwise + /// @see research, cancelResearch, getTech, getRemainingResearchTime, + /// @implies exists(), isCompleted(), getType().isBuilding() bool isResearching() const; - /** Returns true if the unit has been selected by the user via the starcraft GUI. Only available if you - * enable Flag::UserInput during AIModule::onStart. - * \see Game::getSelectedUnits. */ + /// Checks if this unit has been selected in the user interface. This function is only available if + /// the flag Flag::UserInput is enabled. + /// + /// @returns true if this unit is currently selected, and false if this unit is not selected + /// @see Game::getSelectedUnits virtual bool isSelected() const = 0; /// Checks if this unit is currently @sieged. This is only applicable to @Siege_Tanks. @@ -1032,8 +1039,6 @@ namespace BWAPI * \see UnitInterface::attack, UnitInterface::getGroundWeaponCooldown, UnitInterface::getAirWeaponCooldown. */ virtual bool isStartingAttack() const = 0; - /** Returns true if the unit has been stasised by a Protoss Arbiter. - * \see UnitInterface::getStasisTimer. */ /// Checks if this unit is inflicted with @Stasis by an @Arbiter. /// /// @returns true if this unit is locked in a @Stasis and is unable to move, and false if it @@ -1045,8 +1050,10 @@ namespace BWAPI /// @see getStasisTimer bool isStasised() const; - /** Returns true if the unit is currently stimmed. - * \see UnitInterface::getStimTimer. */ + /// Checks if this unit is currently under the influence of a @Stim_Pack. + /// + /// @returns true if this unit has used a stim pack, false otherwise + /// @see getStimTimer bool isStimmed() const; /// Checks if this unit is currently trying to resolve a collision by randomly moving around. @@ -1088,9 +1095,12 @@ namespace BWAPI /// unpowered. virtual bool isPowered() const = 0; - /** Returns true if the unit is a building that is upgrading. See UpgradeTypes for the complete list - * of available upgrades in Broodwar. - * \see UnitInterface::upgrade, UnitInterface::cancelUpgrade, UnitInterface::getUpgrade, UnitInterface::getRemainingUpgradeTime. */ + /// Checks if this unit is a structure that is currently upgrading an upgrade. + /// See UpgradeTypes for a full list of upgrades in Broodwar. + /// + /// @returns true if this structure is upgrading, false otherwise + /// @see upgrade, cancelUpgrade, getUpgrade, getRemainingUpgradeTime + /// @implies exists(), isCompleted(), getType().isBuilding() bool isUpgrading() const; /** Returns true if the unit is visible. If the CompleteMapInformation? cheat flag is enabled, existing diff --git a/bwapi4-includes/BWAPI/UnitCommandType.h b/bwapi4-includes/BWAPI/UnitCommandType.h index 0be62fb..6885f10 100644 --- a/bwapi4-includes/BWAPI/UnitCommandType.h +++ b/bwapi4-includes/BWAPI/UnitCommandType.h @@ -73,58 +73,55 @@ namespace BWAPI /// Retrieves the set of all UnitCommandTypes. /// /// @returns Set of UnitCommandTypes. - const UnitCommandType::const_set& allUnitCommandTypes(); + const UnitCommandType::set& allUnitCommandTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const UnitCommandType x - BWAPI_DECL(Attack_Move); - BWAPI_DECL(Attack_Unit); - BWAPI_DECL(Build); - BWAPI_DECL(Build_Addon); - BWAPI_DECL(Train); - BWAPI_DECL(Morph); - BWAPI_DECL(Research); - BWAPI_DECL(Upgrade); - BWAPI_DECL(Set_Rally_Position); - BWAPI_DECL(Set_Rally_Unit); - BWAPI_DECL(Move); - BWAPI_DECL(Patrol); - BWAPI_DECL(Hold_Position); - BWAPI_DECL(Stop); - BWAPI_DECL(Follow); - BWAPI_DECL(Gather); - BWAPI_DECL(Return_Cargo); - BWAPI_DECL(Repair); - BWAPI_DECL(Burrow); - BWAPI_DECL(Unburrow); - BWAPI_DECL(Cloak); - BWAPI_DECL(Decloak); - BWAPI_DECL(Siege); - BWAPI_DECL(Unsiege); - BWAPI_DECL(Lift); - BWAPI_DECL(Land); - BWAPI_DECL(Load); - BWAPI_DECL(Unload); - BWAPI_DECL(Unload_All); - BWAPI_DECL(Unload_All_Position); - BWAPI_DECL(Right_Click_Position); - BWAPI_DECL(Right_Click_Unit); - BWAPI_DECL(Halt_Construction); - BWAPI_DECL(Cancel_Construction); - BWAPI_DECL(Cancel_Addon); - BWAPI_DECL(Cancel_Train); - BWAPI_DECL(Cancel_Train_Slot); - BWAPI_DECL(Cancel_Morph); - BWAPI_DECL(Cancel_Research); - BWAPI_DECL(Cancel_Upgrade); - BWAPI_DECL(Use_Tech); - BWAPI_DECL(Use_Tech_Position); - BWAPI_DECL(Use_Tech_Unit); - BWAPI_DECL(Place_COP); - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + extern const UnitCommandType Attack_Move; + extern const UnitCommandType Attack_Unit; + extern const UnitCommandType Build; + extern const UnitCommandType Build_Addon; + extern const UnitCommandType Train; + extern const UnitCommandType Morph; + extern const UnitCommandType Research; + extern const UnitCommandType Upgrade; + extern const UnitCommandType Set_Rally_Position; + extern const UnitCommandType Set_Rally_Unit; + extern const UnitCommandType Move; + extern const UnitCommandType Patrol; + extern const UnitCommandType Hold_Position; + extern const UnitCommandType Stop; + extern const UnitCommandType Follow; + extern const UnitCommandType Gather; + extern const UnitCommandType Return_Cargo; + extern const UnitCommandType Repair; + extern const UnitCommandType Burrow; + extern const UnitCommandType Unburrow; + extern const UnitCommandType Cloak; + extern const UnitCommandType Decloak; + extern const UnitCommandType Siege; + extern const UnitCommandType Unsiege; + extern const UnitCommandType Lift; + extern const UnitCommandType Land; + extern const UnitCommandType Load; + extern const UnitCommandType Unload; + extern const UnitCommandType Unload_All; + extern const UnitCommandType Unload_All_Position; + extern const UnitCommandType Right_Click_Position; + extern const UnitCommandType Right_Click_Unit; + extern const UnitCommandType Halt_Construction; + extern const UnitCommandType Cancel_Construction; + extern const UnitCommandType Cancel_Addon; + extern const UnitCommandType Cancel_Train; + extern const UnitCommandType Cancel_Train_Slot; + extern const UnitCommandType Cancel_Morph; + extern const UnitCommandType Cancel_Research; + extern const UnitCommandType Cancel_Upgrade; + extern const UnitCommandType Use_Tech; + extern const UnitCommandType Use_Tech_Position; + extern const UnitCommandType Use_Tech_Unit; + extern const UnitCommandType Place_COP; + extern const UnitCommandType None; + extern const UnitCommandType Unknown; } + + static_assert(sizeof(UnitCommandType) == sizeof(int), "Expected type to resolve to primitive size."); } diff --git a/bwapi4-includes/BWAPI/UnitSizeType.h b/bwapi4-includes/BWAPI/UnitSizeType.h index b311fba..0cd5d42 100644 --- a/bwapi4-includes/BWAPI/UnitSizeType.h +++ b/bwapi4-includes/BWAPI/UnitSizeType.h @@ -1,8 +1,6 @@ #pragma once #include -#define BWAPI_UNITSIZETYPEDEF(x) static const UnitSizeType x(Enum::x) /** ref x */ - namespace BWAPI { namespace UnitSizeTypes @@ -30,23 +28,22 @@ namespace BWAPI UnitSizeType(int id = UnitSizeTypes::Enum::None); }; /// Namespace containing unit size types + /// + /// [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)
namespace UnitSizeTypes { /// Retrieves the set of all UnitSizeTypes. /// /// @returns Set of all UnitSizeTypes. - const UnitSizeType::const_set& allUnitSizeTypes(); + const UnitSizeType::set& allUnitSizeTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const UnitSizeType x - BWAPI_DECL(Independent); - BWAPI_DECL(Small); - BWAPI_DECL(Medium); - BWAPI_DECL(Large); - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + extern const UnitSizeType Independent; + extern const UnitSizeType Small; + extern const UnitSizeType Medium; + extern const UnitSizeType Large; + extern const UnitSizeType None; + extern const UnitSizeType Unknown; } + + static_assert(sizeof(UnitSizeType) == sizeof(int), "Expected type to resolve to primitive size."); } diff --git a/bwapi4-includes/BWAPI/UnitType.h b/bwapi4-includes/BWAPI/UnitType.h index daa6abf..1913095 100644 --- a/bwapi4-includes/BWAPI/UnitType.h +++ b/bwapi4-includes/BWAPI/UnitType.h @@ -312,12 +312,12 @@ namespace BWAPI /// the game. /// /// @returns Set of TechTypes containing ability information. - const ConstVectorset& abilities() const; + const SetContainer& abilities() const; /// Retrieves the set of upgrades that this unit can use to enhance its fighting ability. /// /// @return Set of UpgradeTypes containing upgrade types that will impact this unit type. - const ConstVectorset& upgrades() const; + const SetContainer& upgrades() const; /// Retrieves the upgrade type used to increase the armor of this unit type. For each upgrade, /// this unit type gains +1 additional armor. @@ -553,10 +553,10 @@ namespace BWAPI * which can move once lifted. */ bool canMove() const; - /// Checks if this unit type is a flying unit. Flying units ignore ground pathing and - /// collisions. - /// - /// @returns true if this unit type is in the air by default, and false otherwise + /// Checks if this unit type is a flying unit. Flying units ignore ground pathing and + /// collisions. + /// + /// true if this unit type is in the air by default, and false otherwise bool isFlyer() const; /// Checks if this unit type can regenerate hit points. This generally applies to @Zerg units. @@ -621,7 +621,7 @@ namespace BWAPI /// if ( BWAPI::Broodwar->self() ) /// { /// BWAPI::Unitset myUnits = BWAPI::Broodwar->self()->getUnits(); - /// for ( auto u = myUnits.begin(); u != myUnits.end(); ++u ) + /// for ( auto u : myUnits ) /// { /// if ( u->isIdle() && u->getType().isResourceDepot() ) /// u->train( u->getType().getRace().getWorker() ); @@ -639,7 +639,7 @@ namespace BWAPI /// if ( BWAPI::Broodwar->self() ) /// { /// BWAPI::Unitset myUnits = BWAPI::Broodwar->self()->getUnits(); - /// for ( auto u = myUnits.begin(); u != myUnits.end(); ++u ) + /// for ( auto u : myUnits ) /// { /// if ( u->getType().isRefinery() ) /// { @@ -650,10 +650,10 @@ namespace BWAPI /// if ( pClosestIdleWorker ) /// { /// // gather from the refinery (and check if successful) - /// if ( pClosestIdleWorker->gather(*u) ) + /// if ( pClosestIdleWorker->gather(u) ) /// { /// // set a back reference for when the unit is killed or re-assigned (code not provided) - /// pClosestIdleWorker->setClientInfo(*u, 'ref'); + /// pClosestIdleWorker->setClientInfo(u, 'ref'); /// /// // Increment the number of workers assigned and associate it with the refinery /// ++nWorkersAssigned; @@ -734,13 +734,13 @@ namespace BWAPI /// @code /// BWAPI::Position myBasePosition( BWAPI::Broodwar->self()->getStartLocation() ); /// BWAPI::UnitSet unitsAroundTheBase = BWAPI::Broodwar->getUnitsInRadius(myBasePosition, 1024, !BWAPI::Filter::IsOwned && !BWAPI::Filter::IsParasited); - /// for ( auto u = unitsAroundTheBase.begin(); u != unitsAroundTheBase.end(); ++u ) + /// for ( auto u : unitsAroundTheBase ) /// { /// if ( u->getType().isCritter() && !u->isInvincible() ) /// { /// BWAPI::Unit myQueen = u->getClosestUnit(BWAPI::Filter::GetType == BWAPI::UnitTypes::Zerg_Queen && BWAPI::Filter::IsOwned); /// if ( myQueen ) - /// myQueen->useTech(BWAPI::TechTypes::Parasite, *u); + /// myQueen->useTech(BWAPI::TechTypes::Parasite, u); /// } /// } /// @endcode @@ -755,6 +755,15 @@ namespace BWAPI bool canBuildAddon() const; }; + /// The amount of shield points that a unit recovers over 256 frames. That is, 7/256 shields are regenerated per frame. + static const int SHIELD_REGEN_RATE = 7; + + /// The amount of energy that a unit with special abilities recovers over 256 frames. That is, 8/256 energy is generated per frame. + static const int ENERGY_REGEN_RATE = 8; + + /// The amount of life that a zerg unit recovers over 256 frames. That is, 4/256 life is regenerated per frame. + static const int LIFE_REGEN_RATE = 4; + /// Namespace containing unit types namespace UnitTypes { @@ -771,255 +780,251 @@ namespace BWAPI /// Retrieves the set of all unit types. /// /// @returns A constant set of all available unit types. - const UnitType::const_set& allUnitTypes(); + const UnitType::set& allUnitTypes(); /// Retrieves the set of all macro unit types. A macro type is a fake unit type, used by some /// functions. These include #AllUnits, #Men, #Buildings, and #Factories. The purpose of these /// types are to match the same ones used in Broodwar, also seen in the StarEdit map editor. /// /// @returns A constant set of all macro unit types. - const UnitType::const_set& allMacroTypes(); + const UnitType::set& allMacroTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x.
@tl ## x @scc ## x @sen ## x @wik ## x */ extern const UnitType x - - BWAPI_DECL(Terran_Marine); - BWAPI_DECL(Terran_Ghost); - BWAPI_DECL(Terran_Vulture); - BWAPI_DECL(Terran_Goliath); + extern const UnitType Terran_Marine; + extern const UnitType Terran_Ghost; + extern const UnitType Terran_Vulture; + extern const UnitType Terran_Goliath; // goliath turret 4 - BWAPI_DECL(Terran_Siege_Tank_Tank_Mode); + extern const UnitType Terran_Siege_Tank_Tank_Mode; // siege tank turret 6 - BWAPI_DECL(Terran_SCV); - BWAPI_DECL(Terran_Wraith); - BWAPI_DECL(Terran_Science_Vessel); - BWAPI_DECL(Hero_Gui_Montag); - BWAPI_DECL(Terran_Dropship); - BWAPI_DECL(Terran_Battlecruiser); - BWAPI_DECL(Terran_Vulture_Spider_Mine); - BWAPI_DECL(Terran_Nuclear_Missile); - BWAPI_DECL(Terran_Civilian); - BWAPI_DECL(Hero_Sarah_Kerrigan); - BWAPI_DECL(Hero_Alan_Schezar); + extern const UnitType Terran_SCV; + extern const UnitType Terran_Wraith; + extern const UnitType Terran_Science_Vessel; + extern const UnitType Hero_Gui_Montag; + extern const UnitType Terran_Dropship; + extern const UnitType Terran_Battlecruiser; + extern const UnitType Terran_Vulture_Spider_Mine; + extern const UnitType Terran_Nuclear_Missile; + extern const UnitType Terran_Civilian; + extern const UnitType Hero_Sarah_Kerrigan; + extern const UnitType Hero_Alan_Schezar; // alan turret 18 - BWAPI_DECL(Hero_Jim_Raynor_Vulture); - BWAPI_DECL(Hero_Jim_Raynor_Marine); - BWAPI_DECL(Hero_Tom_Kazansky); - BWAPI_DECL(Hero_Magellan); - BWAPI_DECL(Hero_Edmund_Duke_Tank_Mode); + extern const UnitType Hero_Jim_Raynor_Vulture; + extern const UnitType Hero_Jim_Raynor_Marine; + extern const UnitType Hero_Tom_Kazansky; + extern const UnitType Hero_Magellan; + extern const UnitType Hero_Edmund_Duke_Tank_Mode; // edmund duke turret 24 - BWAPI_DECL(Hero_Edmund_Duke_Siege_Mode); + extern const UnitType Hero_Edmund_Duke_Siege_Mode; // edmund duke turret siege mode 26 - BWAPI_DECL(Hero_Arcturus_Mengsk); - BWAPI_DECL(Hero_Hyperion); - BWAPI_DECL(Hero_Norad_II); - BWAPI_DECL(Terran_Siege_Tank_Siege_Mode); + extern const UnitType Hero_Arcturus_Mengsk; + extern const UnitType Hero_Hyperion; + extern const UnitType Hero_Norad_II; + extern const UnitType Terran_Siege_Tank_Siege_Mode; // siege tank siege mode turret 31 - BWAPI_DECL(Terran_Firebat); - BWAPI_DECL(Spell_Scanner_Sweep); - BWAPI_DECL(Terran_Medic); - BWAPI_DECL(Zerg_Larva); - BWAPI_DECL(Zerg_Egg); - BWAPI_DECL(Zerg_Zergling); - BWAPI_DECL(Zerg_Hydralisk); - BWAPI_DECL(Zerg_Ultralisk); - BWAPI_DECL(Zerg_Broodling); - BWAPI_DECL(Zerg_Drone); - BWAPI_DECL(Zerg_Overlord); - BWAPI_DECL(Zerg_Mutalisk); - BWAPI_DECL(Zerg_Guardian); - BWAPI_DECL(Zerg_Queen); - BWAPI_DECL(Zerg_Defiler); - BWAPI_DECL(Zerg_Scourge); - BWAPI_DECL(Hero_Torrasque); - BWAPI_DECL(Hero_Matriarch); - BWAPI_DECL(Zerg_Infested_Terran); - BWAPI_DECL(Hero_Infested_Kerrigan); - BWAPI_DECL(Hero_Unclean_One); - BWAPI_DECL(Hero_Hunter_Killer); - BWAPI_DECL(Hero_Devouring_One); - BWAPI_DECL(Hero_Kukulza_Mutalisk); - BWAPI_DECL(Hero_Kukulza_Guardian); - BWAPI_DECL(Hero_Yggdrasill); - BWAPI_DECL(Terran_Valkyrie); - BWAPI_DECL(Zerg_Cocoon); - BWAPI_DECL(Protoss_Corsair); - BWAPI_DECL(Protoss_Dark_Templar); - BWAPI_DECL(Zerg_Devourer); - BWAPI_DECL(Protoss_Dark_Archon); - BWAPI_DECL(Protoss_Probe); - BWAPI_DECL(Protoss_Zealot); - BWAPI_DECL(Protoss_Dragoon); - BWAPI_DECL(Protoss_High_Templar); - BWAPI_DECL(Protoss_Archon); - BWAPI_DECL(Protoss_Shuttle); - BWAPI_DECL(Protoss_Scout); - BWAPI_DECL(Protoss_Arbiter); - BWAPI_DECL(Protoss_Carrier); - BWAPI_DECL(Protoss_Interceptor); - BWAPI_DECL(Hero_Dark_Templar); - BWAPI_DECL(Hero_Zeratul); - BWAPI_DECL(Hero_Tassadar_Zeratul_Archon); - BWAPI_DECL(Hero_Fenix_Zealot); - BWAPI_DECL(Hero_Fenix_Dragoon); - BWAPI_DECL(Hero_Tassadar); - BWAPI_DECL(Hero_Mojo); - BWAPI_DECL(Hero_Warbringer); - BWAPI_DECL(Hero_Gantrithor); - BWAPI_DECL(Protoss_Reaver); - BWAPI_DECL(Protoss_Observer); - BWAPI_DECL(Protoss_Scarab); - BWAPI_DECL(Hero_Danimoth); - BWAPI_DECL(Hero_Aldaris); - BWAPI_DECL(Hero_Artanis); - BWAPI_DECL(Critter_Rhynadon); - BWAPI_DECL(Critter_Bengalaas); - BWAPI_DECL(Special_Cargo_Ship); - BWAPI_DECL(Special_Mercenary_Gunship); - BWAPI_DECL(Critter_Scantid); - BWAPI_DECL(Critter_Kakaru); - BWAPI_DECL(Critter_Ragnasaur); - BWAPI_DECL(Critter_Ursadon); - BWAPI_DECL(Zerg_Lurker_Egg); - BWAPI_DECL(Hero_Raszagal); - BWAPI_DECL(Hero_Samir_Duran); - BWAPI_DECL(Hero_Alexei_Stukov); - BWAPI_DECL(Special_Map_Revealer); - BWAPI_DECL(Hero_Gerard_DuGalle); - BWAPI_DECL(Zerg_Lurker); - BWAPI_DECL(Hero_Infested_Duran); - BWAPI_DECL(Spell_Disruption_Web); - BWAPI_DECL(Terran_Command_Center); - BWAPI_DECL(Terran_Comsat_Station); - BWAPI_DECL(Terran_Nuclear_Silo); - BWAPI_DECL(Terran_Supply_Depot); - BWAPI_DECL(Terran_Refinery); - BWAPI_DECL(Terran_Barracks); - BWAPI_DECL(Terran_Academy); - BWAPI_DECL(Terran_Factory); - BWAPI_DECL(Terran_Starport); - BWAPI_DECL(Terran_Control_Tower); - BWAPI_DECL(Terran_Science_Facility); - BWAPI_DECL(Terran_Covert_Ops); - BWAPI_DECL(Terran_Physics_Lab); + extern const UnitType Terran_Firebat; + extern const UnitType Spell_Scanner_Sweep; + extern const UnitType Terran_Medic; + extern const UnitType Zerg_Larva; + extern const UnitType Zerg_Egg; + extern const UnitType Zerg_Zergling; + extern const UnitType Zerg_Hydralisk; + extern const UnitType Zerg_Ultralisk; + extern const UnitType Zerg_Broodling; + extern const UnitType Zerg_Drone; + extern const UnitType Zerg_Overlord; + extern const UnitType Zerg_Mutalisk; + extern const UnitType Zerg_Guardian; + extern const UnitType Zerg_Queen; + extern const UnitType Zerg_Defiler; + extern const UnitType Zerg_Scourge; + extern const UnitType Hero_Torrasque; + extern const UnitType Hero_Matriarch; + extern const UnitType Zerg_Infested_Terran; + extern const UnitType Hero_Infested_Kerrigan; + extern const UnitType Hero_Unclean_One; + extern const UnitType Hero_Hunter_Killer; + extern const UnitType Hero_Devouring_One; + extern const UnitType Hero_Kukulza_Mutalisk; + extern const UnitType Hero_Kukulza_Guardian; + extern const UnitType Hero_Yggdrasill; + extern const UnitType Terran_Valkyrie; + extern const UnitType Zerg_Cocoon; + extern const UnitType Protoss_Corsair; + extern const UnitType Protoss_Dark_Templar; + extern const UnitType Zerg_Devourer; + extern const UnitType Protoss_Dark_Archon; + extern const UnitType Protoss_Probe; + extern const UnitType Protoss_Zealot; + extern const UnitType Protoss_Dragoon; + extern const UnitType Protoss_High_Templar; + extern const UnitType Protoss_Archon; + extern const UnitType Protoss_Shuttle; + extern const UnitType Protoss_Scout; + extern const UnitType Protoss_Arbiter; + extern const UnitType Protoss_Carrier; + extern const UnitType Protoss_Interceptor; + extern const UnitType Hero_Dark_Templar; + extern const UnitType Hero_Zeratul; + extern const UnitType Hero_Tassadar_Zeratul_Archon; + extern const UnitType Hero_Fenix_Zealot; + extern const UnitType Hero_Fenix_Dragoon; + extern const UnitType Hero_Tassadar; + extern const UnitType Hero_Mojo; + extern const UnitType Hero_Warbringer; + extern const UnitType Hero_Gantrithor; + extern const UnitType Protoss_Reaver; + extern const UnitType Protoss_Observer; + extern const UnitType Protoss_Scarab; + extern const UnitType Hero_Danimoth; + extern const UnitType Hero_Aldaris; + extern const UnitType Hero_Artanis; + extern const UnitType Critter_Rhynadon; + extern const UnitType Critter_Bengalaas; + extern const UnitType Special_Cargo_Ship; + extern const UnitType Special_Mercenary_Gunship; + extern const UnitType Critter_Scantid; + extern const UnitType Critter_Kakaru; + extern const UnitType Critter_Ragnasaur; + extern const UnitType Critter_Ursadon; + extern const UnitType Zerg_Lurker_Egg; + extern const UnitType Hero_Raszagal; + extern const UnitType Hero_Samir_Duran; + extern const UnitType Hero_Alexei_Stukov; + extern const UnitType Special_Map_Revealer; + extern const UnitType Hero_Gerard_DuGalle; + extern const UnitType Zerg_Lurker; + extern const UnitType Hero_Infested_Duran; + extern const UnitType Spell_Disruption_Web; + extern const UnitType Terran_Command_Center; + extern const UnitType Terran_Comsat_Station; + extern const UnitType Terran_Nuclear_Silo; + extern const UnitType Terran_Supply_Depot; + extern const UnitType Terran_Refinery; + extern const UnitType Terran_Barracks; + extern const UnitType Terran_Academy; + extern const UnitType Terran_Factory; + extern const UnitType Terran_Starport; + extern const UnitType Terran_Control_Tower; + extern const UnitType Terran_Science_Facility; + extern const UnitType Terran_Covert_Ops; + extern const UnitType Terran_Physics_Lab; // starbase 119 - BWAPI_DECL(Terran_Machine_Shop); + extern const UnitType Terran_Machine_Shop; // repair bay 121 - BWAPI_DECL(Terran_Engineering_Bay); - BWAPI_DECL(Terran_Armory); - BWAPI_DECL(Terran_Missile_Turret); - BWAPI_DECL(Terran_Bunker); - BWAPI_DECL(Special_Crashed_Norad_II); - BWAPI_DECL(Special_Ion_Cannon); - BWAPI_DECL(Powerup_Uraj_Crystal); - BWAPI_DECL(Powerup_Khalis_Crystal); - BWAPI_DECL(Zerg_Infested_Command_Center); - BWAPI_DECL(Zerg_Hatchery); - BWAPI_DECL(Zerg_Lair); - BWAPI_DECL(Zerg_Hive); - BWAPI_DECL(Zerg_Nydus_Canal); - BWAPI_DECL(Zerg_Hydralisk_Den); - BWAPI_DECL(Zerg_Defiler_Mound); - BWAPI_DECL(Zerg_Greater_Spire); - BWAPI_DECL(Zerg_Queens_Nest); - BWAPI_DECL(Zerg_Evolution_Chamber); - BWAPI_DECL(Zerg_Ultralisk_Cavern); - BWAPI_DECL(Zerg_Spire); - BWAPI_DECL(Zerg_Spawning_Pool); - BWAPI_DECL(Zerg_Creep_Colony); - BWAPI_DECL(Zerg_Spore_Colony); + extern const UnitType Terran_Engineering_Bay; + extern const UnitType Terran_Armory; + extern const UnitType Terran_Missile_Turret; + extern const UnitType Terran_Bunker; + extern const UnitType Special_Crashed_Norad_II; + extern const UnitType Special_Ion_Cannon; + extern const UnitType Powerup_Uraj_Crystal; + extern const UnitType Powerup_Khalis_Crystal; + extern const UnitType Zerg_Infested_Command_Center; + extern const UnitType Zerg_Hatchery; + extern const UnitType Zerg_Lair; + extern const UnitType Zerg_Hive; + extern const UnitType Zerg_Nydus_Canal; + extern const UnitType Zerg_Hydralisk_Den; + extern const UnitType Zerg_Defiler_Mound; + extern const UnitType Zerg_Greater_Spire; + extern const UnitType Zerg_Queens_Nest; + extern const UnitType Zerg_Evolution_Chamber; + extern const UnitType Zerg_Ultralisk_Cavern; + extern const UnitType Zerg_Spire; + extern const UnitType Zerg_Spawning_Pool; + extern const UnitType Zerg_Creep_Colony; + extern const UnitType Zerg_Spore_Colony; // unused zerg 1 145 - BWAPI_DECL(Zerg_Sunken_Colony); - BWAPI_DECL(Special_Overmind_With_Shell); - BWAPI_DECL(Special_Overmind); - BWAPI_DECL(Zerg_Extractor); - BWAPI_DECL(Special_Mature_Chrysalis); - BWAPI_DECL(Special_Cerebrate); - BWAPI_DECL(Special_Cerebrate_Daggoth); + extern const UnitType Zerg_Sunken_Colony; + extern const UnitType Special_Overmind_With_Shell; + extern const UnitType Special_Overmind; + extern const UnitType Zerg_Extractor; + extern const UnitType Special_Mature_Chrysalis; + extern const UnitType Special_Cerebrate; + extern const UnitType Special_Cerebrate_Daggoth; // unused zerg 2 153 - BWAPI_DECL(Protoss_Nexus); - BWAPI_DECL(Protoss_Robotics_Facility); - BWAPI_DECL(Protoss_Pylon); - BWAPI_DECL(Protoss_Assimilator); + extern const UnitType Protoss_Nexus; + extern const UnitType Protoss_Robotics_Facility; + extern const UnitType Protoss_Pylon; + extern const UnitType Protoss_Assimilator; // unused protoss 1 158 - BWAPI_DECL(Protoss_Observatory); - BWAPI_DECL(Protoss_Gateway); + extern const UnitType Protoss_Observatory; + extern const UnitType Protoss_Gateway; // unused protoss 2 161 - BWAPI_DECL(Protoss_Photon_Cannon); - BWAPI_DECL(Protoss_Citadel_of_Adun); - BWAPI_DECL(Protoss_Cybernetics_Core); - BWAPI_DECL(Protoss_Templar_Archives); - BWAPI_DECL(Protoss_Forge); - BWAPI_DECL(Protoss_Stargate); - BWAPI_DECL(Special_Stasis_Cell_Prison); - BWAPI_DECL(Protoss_Fleet_Beacon); - BWAPI_DECL(Protoss_Arbiter_Tribunal); - BWAPI_DECL(Protoss_Robotics_Support_Bay); - BWAPI_DECL(Protoss_Shield_Battery); - BWAPI_DECL(Special_Khaydarin_Crystal_Form); - BWAPI_DECL(Special_Protoss_Temple); - BWAPI_DECL(Special_XelNaga_Temple); - BWAPI_DECL(Resource_Mineral_Field); - BWAPI_DECL(Resource_Mineral_Field_Type_2); - BWAPI_DECL(Resource_Mineral_Field_Type_3); + extern const UnitType Protoss_Photon_Cannon; + extern const UnitType Protoss_Citadel_of_Adun; + extern const UnitType Protoss_Cybernetics_Core; + extern const UnitType Protoss_Templar_Archives; + extern const UnitType Protoss_Forge; + extern const UnitType Protoss_Stargate; + extern const UnitType Special_Stasis_Cell_Prison; + extern const UnitType Protoss_Fleet_Beacon; + extern const UnitType Protoss_Arbiter_Tribunal; + extern const UnitType Protoss_Robotics_Support_Bay; + extern const UnitType Protoss_Shield_Battery; + extern const UnitType Special_Khaydarin_Crystal_Form; + extern const UnitType Special_Protoss_Temple; + extern const UnitType Special_XelNaga_Temple; + extern const UnitType Resource_Mineral_Field; + extern const UnitType Resource_Mineral_Field_Type_2; + extern const UnitType Resource_Mineral_Field_Type_3; // cave 179 // cave-in 180 // cantina 181 // mining platform 182 // independant command center 183 - BWAPI_DECL(Special_Independant_Starport); + extern const UnitType Special_Independant_Starport; // independant jump gate 185 // ruins 186 // unused khaydarin crystal formation 187 - BWAPI_DECL(Resource_Vespene_Geyser); - BWAPI_DECL(Special_Warp_Gate); - BWAPI_DECL(Special_Psi_Disrupter); + extern const UnitType Resource_Vespene_Geyser; + extern const UnitType Special_Warp_Gate; + extern const UnitType Special_Psi_Disrupter; // zerg marker 191 // terran marker 192 // protoss marker 193 - BWAPI_DECL(Special_Zerg_Beacon); - BWAPI_DECL(Special_Terran_Beacon); - BWAPI_DECL(Special_Protoss_Beacon); - BWAPI_DECL(Special_Zerg_Flag_Beacon); - BWAPI_DECL(Special_Terran_Flag_Beacon); - BWAPI_DECL(Special_Protoss_Flag_Beacon); - BWAPI_DECL(Special_Power_Generator); - BWAPI_DECL(Special_Overmind_Cocoon); - BWAPI_DECL(Spell_Dark_Swarm); - BWAPI_DECL(Special_Floor_Missile_Trap); - BWAPI_DECL(Special_Floor_Hatch); - BWAPI_DECL(Special_Upper_Level_Door); - BWAPI_DECL(Special_Right_Upper_Level_Door); - BWAPI_DECL(Special_Pit_Door); - BWAPI_DECL(Special_Right_Pit_Door); - BWAPI_DECL(Special_Floor_Gun_Trap); - BWAPI_DECL(Special_Wall_Missile_Trap); - BWAPI_DECL(Special_Wall_Flame_Trap); - BWAPI_DECL(Special_Right_Wall_Missile_Trap); - BWAPI_DECL(Special_Right_Wall_Flame_Trap); - BWAPI_DECL(Special_Start_Location); - BWAPI_DECL(Powerup_Flag); - BWAPI_DECL(Powerup_Young_Chrysalis); - BWAPI_DECL(Powerup_Psi_Emitter); - BWAPI_DECL(Powerup_Data_Disk); - BWAPI_DECL(Powerup_Khaydarin_Crystal); - BWAPI_DECL(Powerup_Mineral_Cluster_Type_1); - BWAPI_DECL(Powerup_Mineral_Cluster_Type_2); - BWAPI_DECL(Powerup_Protoss_Gas_Orb_Type_1); - BWAPI_DECL(Powerup_Protoss_Gas_Orb_Type_2); - BWAPI_DECL(Powerup_Zerg_Gas_Sac_Type_1); - BWAPI_DECL(Powerup_Zerg_Gas_Sac_Type_2); - BWAPI_DECL(Powerup_Terran_Gas_Tank_Type_1); - BWAPI_DECL(Powerup_Terran_Gas_Tank_Type_2); + extern const UnitType Special_Zerg_Beacon; + extern const UnitType Special_Terran_Beacon; + extern const UnitType Special_Protoss_Beacon; + extern const UnitType Special_Zerg_Flag_Beacon; + extern const UnitType Special_Terran_Flag_Beacon; + extern const UnitType Special_Protoss_Flag_Beacon; + extern const UnitType Special_Power_Generator; + extern const UnitType Special_Overmind_Cocoon; + extern const UnitType Spell_Dark_Swarm; + extern const UnitType Special_Floor_Missile_Trap; + extern const UnitType Special_Floor_Hatch; + extern const UnitType Special_Upper_Level_Door; + extern const UnitType Special_Right_Upper_Level_Door; + extern const UnitType Special_Pit_Door; + extern const UnitType Special_Right_Pit_Door; + extern const UnitType Special_Floor_Gun_Trap; + extern const UnitType Special_Wall_Missile_Trap; + extern const UnitType Special_Wall_Flame_Trap; + extern const UnitType Special_Right_Wall_Missile_Trap; + extern const UnitType Special_Right_Wall_Flame_Trap; + extern const UnitType Special_Start_Location; + extern const UnitType Powerup_Flag; + extern const UnitType Powerup_Young_Chrysalis; + extern const UnitType Powerup_Psi_Emitter; + extern const UnitType Powerup_Data_Disk; + extern const UnitType Powerup_Khaydarin_Crystal; + extern const UnitType Powerup_Mineral_Cluster_Type_1; + extern const UnitType Powerup_Mineral_Cluster_Type_2; + extern const UnitType Powerup_Protoss_Gas_Orb_Type_1; + extern const UnitType Powerup_Protoss_Gas_Orb_Type_2; + extern const UnitType Powerup_Zerg_Gas_Sac_Type_1; + extern const UnitType Powerup_Zerg_Gas_Sac_Type_2; + extern const UnitType Powerup_Terran_Gas_Tank_Type_1; + extern const UnitType Powerup_Terran_Gas_Tank_Type_2; - BWAPI_DECL(None); - BWAPI_DECL(AllUnits); - BWAPI_DECL(Men); - BWAPI_DECL(Buildings); - BWAPI_DECL(Factories); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + extern const UnitType None; + extern const UnitType AllUnits; + extern const UnitType Men; + extern const UnitType Buildings; + extern const UnitType Factories; + extern const UnitType Unknown; } + + static_assert(sizeof(UnitType) == sizeof(int), "Expected type to resolve to primitive size."); } diff --git a/bwapi4-includes/BWAPI/Unitset.h b/bwapi4-includes/BWAPI/Unitset.h index 6ea7888..ec49422 100644 --- a/bwapi4-includes/BWAPI/Unitset.h +++ b/bwapi4-includes/BWAPI/Unitset.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "SetContainer.h" #include #include #include @@ -19,28 +19,13 @@ namespace BWAPI /// containers. /// /// @see Unit, UnitType, UnitSizeType - class Unitset : public Vectorset + class Unitset : public SetContainer> { public: /// A blank Unitset containing no elements. This is typically used as a return value for BWAPI /// interface functions that have encountered an error. static const Unitset none; - /// The Unitset constructor. - /// - /// @param initialSize The initial maximum size of the Unitset before expanding it is - /// necessary. - Unitset(size_t initialSize = 16); - - /// The copy constructor. - /// - /// @param other The Unitset to construct this one from. - Unitset(const Unitset &other); - - /// The move constructor. - /// - /// @param other The Unitset to move its contents from. - Unitset(Unitset &&other); /// Calculates the average of all valid Unit positions in this set. /// @@ -73,8 +58,12 @@ namespace BWAPI /// Sets the client info for every unit in this set. /// - /// @param clientInfo A pointer to client information, managed by the AI module, or nullptr if - /// client information is to be cleared. + /// @param clientInfo [optional] + /// A pointer to client information, managed by the AI module, or nullptr if client + /// information is to be cleared. + /// @param index [optional] + /// An key value for the client info mapping so that more than one piece of data can be + /// mapped to the same unit. /// /// @see UnitInterface::setClientInfo void setClientInfo(void *clientInfo = nullptr, int index = 0) const; diff --git a/bwapi4-includes/BWAPI/UpgradeType.h b/bwapi4-includes/BWAPI/UpgradeType.h index 3d1c395..2913392 100644 --- a/bwapi4-includes/BWAPI/UpgradeType.h +++ b/bwapi4-includes/BWAPI/UpgradeType.h @@ -114,70 +114,68 @@ namespace BWAPI UnitType whatsRequired(int level = 1) const; /** Returns the set of units that are affected by this upgrade. */ - const UnitType::const_set& whatUses() const; + const UnitType::set& whatUses() const; }; /// Namespace of upgrade types namespace UpgradeTypes { /** Returns the set of all the UpgradeTypes. */ - const UpgradeType::const_set& allUpgradeTypes(); + const UpgradeType::set& allUpgradeTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const UpgradeType x - BWAPI_DECL(Terran_Infantry_Armor); - BWAPI_DECL(Terran_Vehicle_Plating); - BWAPI_DECL(Terran_Ship_Plating); - BWAPI_DECL(Zerg_Carapace); - BWAPI_DECL(Zerg_Flyer_Carapace); - BWAPI_DECL(Protoss_Ground_Armor); - BWAPI_DECL(Protoss_Air_Armor); - BWAPI_DECL(Terran_Infantry_Weapons); - BWAPI_DECL(Terran_Vehicle_Weapons); - BWAPI_DECL(Terran_Ship_Weapons); - BWAPI_DECL(Zerg_Melee_Attacks); - BWAPI_DECL(Zerg_Missile_Attacks); - BWAPI_DECL(Zerg_Flyer_Attacks); - BWAPI_DECL(Protoss_Ground_Weapons); - BWAPI_DECL(Protoss_Air_Weapons); - BWAPI_DECL(Protoss_Plasma_Shields); - BWAPI_DECL(U_238_Shells); - BWAPI_DECL(Ion_Thrusters); - BWAPI_DECL(Titan_Reactor); - BWAPI_DECL(Ocular_Implants); - BWAPI_DECL(Moebius_Reactor); - BWAPI_DECL(Apollo_Reactor); - BWAPI_DECL(Colossus_Reactor); - BWAPI_DECL(Ventral_Sacs); - BWAPI_DECL(Antennae); - BWAPI_DECL(Pneumatized_Carapace); - BWAPI_DECL(Metabolic_Boost); - BWAPI_DECL(Adrenal_Glands); - BWAPI_DECL(Muscular_Augments); - BWAPI_DECL(Grooved_Spines); - BWAPI_DECL(Gamete_Meiosis); - BWAPI_DECL(Metasynaptic_Node); - BWAPI_DECL(Singularity_Charge); - BWAPI_DECL(Leg_Enhancements); - BWAPI_DECL(Scarab_Damage); - BWAPI_DECL(Reaver_Capacity); - BWAPI_DECL(Gravitic_Drive); - BWAPI_DECL(Sensor_Array); - BWAPI_DECL(Gravitic_Boosters); - BWAPI_DECL(Khaydarin_Amulet); - BWAPI_DECL(Apial_Sensors); - BWAPI_DECL(Gravitic_Thrusters); - BWAPI_DECL(Carrier_Capacity); - BWAPI_DECL(Khaydarin_Core); - BWAPI_DECL(Argus_Jewel); - BWAPI_DECL(Argus_Talisman); - BWAPI_DECL(Caduceus_Reactor); - BWAPI_DECL(Chitinous_Plating); - BWAPI_DECL(Anabolic_Synthesis); - BWAPI_DECL(Charon_Boosters); - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + extern const UpgradeType Terran_Infantry_Armor; + extern const UpgradeType Terran_Vehicle_Plating; + extern const UpgradeType Terran_Ship_Plating; + extern const UpgradeType Zerg_Carapace; + extern const UpgradeType Zerg_Flyer_Carapace; + extern const UpgradeType Protoss_Ground_Armor; + extern const UpgradeType Protoss_Air_Armor; + extern const UpgradeType Terran_Infantry_Weapons; + extern const UpgradeType Terran_Vehicle_Weapons; + extern const UpgradeType Terran_Ship_Weapons; + extern const UpgradeType Zerg_Melee_Attacks; + extern const UpgradeType Zerg_Missile_Attacks; + extern const UpgradeType Zerg_Flyer_Attacks; + extern const UpgradeType Protoss_Ground_Weapons; + extern const UpgradeType Protoss_Air_Weapons; + extern const UpgradeType Protoss_Plasma_Shields; + extern const UpgradeType U_238_Shells; + extern const UpgradeType Ion_Thrusters; + extern const UpgradeType Titan_Reactor; + extern const UpgradeType Ocular_Implants; + extern const UpgradeType Moebius_Reactor; + extern const UpgradeType Apollo_Reactor; + extern const UpgradeType Colossus_Reactor; + extern const UpgradeType Ventral_Sacs; + extern const UpgradeType Antennae; + extern const UpgradeType Pneumatized_Carapace; + extern const UpgradeType Metabolic_Boost; + extern const UpgradeType Adrenal_Glands; + extern const UpgradeType Muscular_Augments; + extern const UpgradeType Grooved_Spines; + extern const UpgradeType Gamete_Meiosis; + extern const UpgradeType Metasynaptic_Node; + extern const UpgradeType Singularity_Charge; + extern const UpgradeType Leg_Enhancements; + extern const UpgradeType Scarab_Damage; + extern const UpgradeType Reaver_Capacity; + extern const UpgradeType Gravitic_Drive; + extern const UpgradeType Sensor_Array; + extern const UpgradeType Gravitic_Boosters; + extern const UpgradeType Khaydarin_Amulet; + extern const UpgradeType Apial_Sensors; + extern const UpgradeType Gravitic_Thrusters; + extern const UpgradeType Carrier_Capacity; + extern const UpgradeType Khaydarin_Core; + extern const UpgradeType Argus_Jewel; + extern const UpgradeType Argus_Talisman; + extern const UpgradeType Caduceus_Reactor; + extern const UpgradeType Chitinous_Plating; + extern const UpgradeType Anabolic_Synthesis; + extern const UpgradeType Charon_Boosters; + extern const UpgradeType Upgrade_60; + extern const UpgradeType None; + extern const UpgradeType Unknown; } + + static_assert(sizeof(UpgradeType) == sizeof(int), "Expected type to resolve to primitive size."); } diff --git a/bwapi4-includes/BWAPI/WeaponType.h b/bwapi4-includes/BWAPI/WeaponType.h index 10429ae..f8b0d6b 100644 --- a/bwapi4-includes/BWAPI/WeaponType.h +++ b/bwapi4-includes/BWAPI/WeaponType.h @@ -212,122 +212,119 @@ namespace BWAPI /// not used for abilities. /// /// @returns constant set consisting of all normal weapon types. - const WeaponType::const_set& normalWeaponTypes(); + const WeaponType::set& normalWeaponTypes(); /// Retrieves the set of all special weapon types. This set contains all weapons that are /// used exclusively for special unit abilities. /// /// @returns constant set consisting of all special weapon types. - const WeaponType::const_set& specialWeaponTypes(); + const WeaponType::set& specialWeaponTypes(); -#ifdef BWAPI_DECL -#undef BWAPI_DECL -#endif -#define BWAPI_DECL(x) /** x */ extern const WeaponType x - BWAPI_DECL(Gauss_Rifle); - BWAPI_DECL(Gauss_Rifle_Jim_Raynor); - BWAPI_DECL(C_10_Canister_Rifle); - BWAPI_DECL(C_10_Canister_Rifle_Sarah_Kerrigan); - BWAPI_DECL(C_10_Canister_Rifle_Samir_Duran); - BWAPI_DECL(C_10_Canister_Rifle_Infested_Duran); - BWAPI_DECL(C_10_Canister_Rifle_Alexei_Stukov); - BWAPI_DECL(Fragmentation_Grenade); - BWAPI_DECL(Fragmentation_Grenade_Jim_Raynor); - BWAPI_DECL(Spider_Mines); - BWAPI_DECL(Twin_Autocannons); - BWAPI_DECL(Twin_Autocannons_Alan_Schezar); - BWAPI_DECL(Hellfire_Missile_Pack); - BWAPI_DECL(Hellfire_Missile_Pack_Alan_Schezar); - BWAPI_DECL(Arclite_Cannon); - BWAPI_DECL(Arclite_Cannon_Edmund_Duke); - BWAPI_DECL(Fusion_Cutter); - BWAPI_DECL(Gemini_Missiles); - BWAPI_DECL(Gemini_Missiles_Tom_Kazansky); - BWAPI_DECL(Burst_Lasers); - BWAPI_DECL(Burst_Lasers_Tom_Kazansky); - BWAPI_DECL(ATS_Laser_Battery); - BWAPI_DECL(ATS_Laser_Battery_Hero); - BWAPI_DECL(ATS_Laser_Battery_Hyperion); - BWAPI_DECL(ATA_Laser_Battery); - BWAPI_DECL(ATA_Laser_Battery_Hero); - BWAPI_DECL(ATA_Laser_Battery_Hyperion); - BWAPI_DECL(Flame_Thrower); - BWAPI_DECL(Flame_Thrower_Gui_Montag); - BWAPI_DECL(Arclite_Shock_Cannon); - BWAPI_DECL(Arclite_Shock_Cannon_Edmund_Duke); - BWAPI_DECL(Longbolt_Missile); - BWAPI_DECL(Claws); - BWAPI_DECL(Claws_Devouring_One); - BWAPI_DECL(Claws_Infested_Kerrigan); - BWAPI_DECL(Needle_Spines); - BWAPI_DECL(Needle_Spines_Hunter_Killer); - BWAPI_DECL(Kaiser_Blades); - BWAPI_DECL(Kaiser_Blades_Torrasque); - BWAPI_DECL(Toxic_Spores); - BWAPI_DECL(Spines); - BWAPI_DECL(Acid_Spore); - BWAPI_DECL(Acid_Spore_Kukulza); - BWAPI_DECL(Glave_Wurm); - BWAPI_DECL(Glave_Wurm_Kukulza); - BWAPI_DECL(Seeker_Spores); - BWAPI_DECL(Subterranean_Tentacle); - BWAPI_DECL(Suicide_Infested_Terran); - BWAPI_DECL(Suicide_Scourge); - BWAPI_DECL(Particle_Beam); - BWAPI_DECL(Psi_Blades); - BWAPI_DECL(Psi_Blades_Fenix); - BWAPI_DECL(Phase_Disruptor); - BWAPI_DECL(Phase_Disruptor_Fenix); - BWAPI_DECL(Psi_Assault); - BWAPI_DECL(Psionic_Shockwave); - BWAPI_DECL(Psionic_Shockwave_TZ_Archon); - BWAPI_DECL(Dual_Photon_Blasters); - BWAPI_DECL(Dual_Photon_Blasters_Mojo); - BWAPI_DECL(Dual_Photon_Blasters_Artanis); - BWAPI_DECL(Anti_Matter_Missiles); - BWAPI_DECL(Anti_Matter_Missiles_Mojo); - BWAPI_DECL(Anti_Matter_Missiles_Artanis); - BWAPI_DECL(Phase_Disruptor_Cannon); - BWAPI_DECL(Phase_Disruptor_Cannon_Danimoth); - BWAPI_DECL(Pulse_Cannon); - BWAPI_DECL(STS_Photon_Cannon); - BWAPI_DECL(STA_Photon_Cannon); - BWAPI_DECL(Scarab); - BWAPI_DECL(Neutron_Flare); - BWAPI_DECL(Halo_Rockets); - BWAPI_DECL(Corrosive_Acid); - BWAPI_DECL(Subterranean_Spines); - BWAPI_DECL(Warp_Blades); - BWAPI_DECL(Warp_Blades_Hero); - BWAPI_DECL(Warp_Blades_Zeratul); - BWAPI_DECL(Independant_Laser_Battery); - BWAPI_DECL(Twin_Autocannons_Floor_Trap); - BWAPI_DECL(Hellfire_Missile_Pack_Wall_Trap); - BWAPI_DECL(Flame_Thrower_Wall_Trap); - BWAPI_DECL(Hellfire_Missile_Pack_Floor_Trap); + extern const WeaponType Gauss_Rifle; + extern const WeaponType Gauss_Rifle_Jim_Raynor; + extern const WeaponType C_10_Canister_Rifle; + extern const WeaponType C_10_Canister_Rifle_Sarah_Kerrigan; + extern const WeaponType C_10_Canister_Rifle_Samir_Duran; + extern const WeaponType C_10_Canister_Rifle_Infested_Duran; + extern const WeaponType C_10_Canister_Rifle_Alexei_Stukov; + extern const WeaponType Fragmentation_Grenade; + extern const WeaponType Fragmentation_Grenade_Jim_Raynor; + extern const WeaponType Spider_Mines; + extern const WeaponType Twin_Autocannons; + extern const WeaponType Twin_Autocannons_Alan_Schezar; + extern const WeaponType Hellfire_Missile_Pack; + extern const WeaponType Hellfire_Missile_Pack_Alan_Schezar; + extern const WeaponType Arclite_Cannon; + extern const WeaponType Arclite_Cannon_Edmund_Duke; + extern const WeaponType Fusion_Cutter; + extern const WeaponType Gemini_Missiles; + extern const WeaponType Gemini_Missiles_Tom_Kazansky; + extern const WeaponType Burst_Lasers; + extern const WeaponType Burst_Lasers_Tom_Kazansky; + extern const WeaponType ATS_Laser_Battery; + extern const WeaponType ATS_Laser_Battery_Hero; + extern const WeaponType ATS_Laser_Battery_Hyperion; + extern const WeaponType ATA_Laser_Battery; + extern const WeaponType ATA_Laser_Battery_Hero; + extern const WeaponType ATA_Laser_Battery_Hyperion; + extern const WeaponType Flame_Thrower; + extern const WeaponType Flame_Thrower_Gui_Montag; + extern const WeaponType Arclite_Shock_Cannon; + extern const WeaponType Arclite_Shock_Cannon_Edmund_Duke; + extern const WeaponType Longbolt_Missile; + extern const WeaponType Claws; + extern const WeaponType Claws_Devouring_One; + extern const WeaponType Claws_Infested_Kerrigan; + extern const WeaponType Needle_Spines; + extern const WeaponType Needle_Spines_Hunter_Killer; + extern const WeaponType Kaiser_Blades; + extern const WeaponType Kaiser_Blades_Torrasque; + extern const WeaponType Toxic_Spores; + extern const WeaponType Spines; + extern const WeaponType Acid_Spore; + extern const WeaponType Acid_Spore_Kukulza; + extern const WeaponType Glave_Wurm; + extern const WeaponType Glave_Wurm_Kukulza; + extern const WeaponType Seeker_Spores; + extern const WeaponType Subterranean_Tentacle; + extern const WeaponType Suicide_Infested_Terran; + extern const WeaponType Suicide_Scourge; + extern const WeaponType Particle_Beam; + extern const WeaponType Psi_Blades; + extern const WeaponType Psi_Blades_Fenix; + extern const WeaponType Phase_Disruptor; + extern const WeaponType Phase_Disruptor_Fenix; + extern const WeaponType Psi_Assault; + extern const WeaponType Psionic_Shockwave; + extern const WeaponType Psionic_Shockwave_TZ_Archon; + extern const WeaponType Dual_Photon_Blasters; + extern const WeaponType Dual_Photon_Blasters_Mojo; + extern const WeaponType Dual_Photon_Blasters_Artanis; + extern const WeaponType Anti_Matter_Missiles; + extern const WeaponType Anti_Matter_Missiles_Mojo; + extern const WeaponType Anti_Matter_Missiles_Artanis; + extern const WeaponType Phase_Disruptor_Cannon; + extern const WeaponType Phase_Disruptor_Cannon_Danimoth; + extern const WeaponType Pulse_Cannon; + extern const WeaponType STS_Photon_Cannon; + extern const WeaponType STA_Photon_Cannon; + extern const WeaponType Scarab; + extern const WeaponType Neutron_Flare; + extern const WeaponType Halo_Rockets; + extern const WeaponType Corrosive_Acid; + extern const WeaponType Subterranean_Spines; + extern const WeaponType Warp_Blades; + extern const WeaponType Warp_Blades_Hero; + extern const WeaponType Warp_Blades_Zeratul; + extern const WeaponType Independant_Laser_Battery; + extern const WeaponType Twin_Autocannons_Floor_Trap; + extern const WeaponType Hellfire_Missile_Pack_Wall_Trap; + extern const WeaponType Flame_Thrower_Wall_Trap; + extern const WeaponType Hellfire_Missile_Pack_Floor_Trap; - BWAPI_DECL(Yamato_Gun); - BWAPI_DECL(Nuclear_Strike); - BWAPI_DECL(Lockdown); - BWAPI_DECL(EMP_Shockwave); - BWAPI_DECL(Irradiate); - BWAPI_DECL(Parasite); - BWAPI_DECL(Spawn_Broodlings); - BWAPI_DECL(Ensnare); - BWAPI_DECL(Dark_Swarm); - BWAPI_DECL(Plague); - BWAPI_DECL(Consume); - BWAPI_DECL(Stasis_Field); - BWAPI_DECL(Psionic_Storm); - BWAPI_DECL(Disruption_Web); - BWAPI_DECL(Restoration); - BWAPI_DECL(Mind_Control); - BWAPI_DECL(Feedback); - BWAPI_DECL(Optical_Flare); - BWAPI_DECL(Maelstrom); + extern const WeaponType Yamato_Gun; + extern const WeaponType Nuclear_Strike; + extern const WeaponType Lockdown; + extern const WeaponType EMP_Shockwave; + extern const WeaponType Irradiate; + extern const WeaponType Parasite; + extern const WeaponType Spawn_Broodlings; + extern const WeaponType Ensnare; + extern const WeaponType Dark_Swarm; + extern const WeaponType Plague; + extern const WeaponType Consume; + extern const WeaponType Stasis_Field; + extern const WeaponType Psionic_Storm; + extern const WeaponType Disruption_Web; + extern const WeaponType Restoration; + extern const WeaponType Mind_Control; + extern const WeaponType Feedback; + extern const WeaponType Optical_Flare; + extern const WeaponType Maelstrom; - BWAPI_DECL(None); - BWAPI_DECL(Unknown); -#undef BWAPI_DECL + extern const WeaponType None; + extern const WeaponType Unknown; } + + static_assert(sizeof(WeaponType) == sizeof(int), "Expected type to resolve to primitive size."); } diff --git a/bwapi4-includes/BWAPI/WindowsTypes.h b/bwapi4-includes/BWAPI/WindowsTypes.h new file mode 100644 index 0000000..e1af178 --- /dev/null +++ b/bwapi4-includes/BWAPI/WindowsTypes.h @@ -0,0 +1,28 @@ +#pragma once + +typedef int BOOL; +typedef void* HANDLE; +typedef unsigned long DWORD; +typedef void* LPVOID; + +#ifndef WINAPI +#define WINAPI __stdcall +#endif + +#ifndef APIENTRY +#define APIENTRY WINAPI +#endif + +#ifndef DLL_PROCESS_ATTACH +#define DLL_PROCESS_ATTACH 1 +#define DLL_THREAD_ATTACH 2 +#define DLL_THREAD_DETACH 3 +#define DLL_PROCESS_DETACH 0 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif diff --git a/bwapi4/AIModule.java b/bwapi4/AIModule.java index 4b2bab5..62d67d3 100644 --- a/bwapi4/AIModule.java +++ b/bwapi4/AIModule.java @@ -85,6 +85,9 @@ public class AIModule { } private static AIModule get(long pointer) { + if (pointer == 0 ) { + return null; + } AIModule instance = instances.get(pointer); if (instance == null ) { instance = new AIModule(pointer); diff --git a/bwapi4/AbstractPoint.java b/bwapi4/AbstractPoint.java new file mode 100644 index 0000000..29af5b8 --- /dev/null +++ b/bwapi4/AbstractPoint.java @@ -0,0 +1,30 @@ +package bwapi4; + +/** + * Common ancestor for location based objects to simplify distance computation. + * This will be refactored into interface with default methods when java 8 becomes widely used. + * + * Idea by Rafał Poniatowski + */ +public abstract class AbstractPoint { + + public abstract T getPoint(); + + public int getX(){ + return getPoint().getX(); + } + + public int getY(){ + return getPoint().getY(); + } + + public double distanceTo(AbstractPoint otherPosition) { + return distanceTo(otherPosition.getX(), otherPosition.getY()); + } + + public double distanceTo(int x, int y) { + double dx = x - getX(); + double dy = y - getY(); + return Math.sqrt(dx * dx + dy * dy); + } +} \ No newline at end of file diff --git a/bwapi4/BestFilter.java b/bwapi4/BestFilter.java index 1e71c88..76c858f 100644 --- a/bwapi4/BestFilter.java +++ b/bwapi4/BestFilter.java @@ -17,6 +17,9 @@ public class BestFilter { } private static BestFilter get(long pointer) { + if (pointer == 0 ) { + return null; + } BestFilter instance = instances.get(pointer); if (instance == null ) { instance = new BestFilter(pointer); diff --git a/bwapi4/Bullet.java b/bwapi4/Bullet.java index 80462b2..36f2d48 100644 --- a/bwapi4/Bullet.java +++ b/bwapi4/Bullet.java @@ -73,6 +73,9 @@ public class Bullet { } private static Bullet get(long pointer) { + if (pointer == 0 ) { + return null; + } Bullet instance = instances.get(pointer); if (instance == null ) { instance = new Bullet(pointer); diff --git a/bwapi4/BulletType.java b/bwapi4/BulletType.java index 8c24be4..ce5d01c 100644 --- a/bwapi4/BulletType.java +++ b/bwapi4/BulletType.java @@ -9,6 +9,80 @@ import java.util.List; public class BulletType { + public static BulletType Melee; + + public static BulletType Fusion_Cutter_Hit; + + public static BulletType Gauss_Rifle_Hit; + + public static BulletType C_10_Canister_Rifle_Hit; + + public static BulletType Gemini_Missiles; + + public static BulletType Fragmentation_Grenade; + + public static BulletType Longbolt_Missile; + + public static BulletType ATS_ATA_Laser_Battery; + + public static BulletType Burst_Lasers; + + public static BulletType Arclite_Shock_Cannon_Hit; + + public static BulletType EMP_Missile; + + public static BulletType Dual_Photon_Blasters_Hit; + + public static BulletType Particle_Beam_Hit; + + public static BulletType Anti_Matter_Missile; + + public static BulletType Pulse_Cannon; + + public static BulletType Psionic_Shockwave_Hit; + + public static BulletType Psionic_Storm; + + public static BulletType Yamato_Gun; + + public static BulletType Phase_Disruptor; + + public static BulletType STA_STS_Cannon_Overlay; + + public static BulletType Sunken_Colony_Tentacle; + + public static BulletType Acid_Spore; + + public static BulletType Glave_Wurm; + + public static BulletType Seeker_Spores; + + public static BulletType Queen_Spell_Carrier; + + public static BulletType Plague_Cloud; + + public static BulletType Consume; + + public static BulletType Ensnare; + + public static BulletType Needle_Spine_Hit; + + public static BulletType Invisible; + + public static BulletType Optical_Flare_Grenade; + + public static BulletType Halo_Rockets; + + public static BulletType Subterranean_Spines; + + public static BulletType Corrosive_Acid_Shot; + + public static BulletType Neutron_Flare; + + public static BulletType None; + + public static BulletType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +91,9 @@ public class BulletType { } private static BulletType get(long pointer) { + if (pointer == 0 ) { + return null; + } BulletType instance = instances.get(pointer); if (instance == null ) { instance = new BulletType(pointer); diff --git a/bwapi4/Bulletset.java b/bwapi4/Bulletset.java index 5a165fb..7921ecd 100644 --- a/bwapi4/Bulletset.java +++ b/bwapi4/Bulletset.java @@ -17,6 +17,9 @@ public class Bulletset { } private static Bulletset get(long pointer) { + if (pointer == 0 ) { + return null; + } Bulletset instance = instances.get(pointer); if (instance == null ) { instance = new Bulletset(pointer); diff --git a/bwapi4/CenteredObject.java b/bwapi4/CenteredObject.java new file mode 100644 index 0000000..2a200ac --- /dev/null +++ b/bwapi4/CenteredObject.java @@ -0,0 +1,15 @@ +package bwapi4; + +import bwapi4.Position; + +/** + * Interrmediate class used to translate getPoint() calls to getCenter() calls. + */ +public abstract class CenteredObject extends AbstractPoint { + + public Position getPoint(){ + return getCenter(); + } + + public abstract Position getCenter(); +} \ No newline at end of file diff --git a/bwapi4/Client.java b/bwapi4/Client.java index e455269..6ea52ec 100644 --- a/bwapi4/Client.java +++ b/bwapi4/Client.java @@ -33,6 +33,9 @@ public class Client { } private static Client get(long pointer) { + if (pointer == 0 ) { + return null; + } Client instance = instances.get(pointer); if (instance == null ) { instance = new Client(pointer); diff --git a/bwapi4/Color.java b/bwapi4/Color.java index e05ddc7..b8b4d52 100644 --- a/bwapi4/Color.java +++ b/bwapi4/Color.java @@ -53,6 +53,9 @@ public class Color { } private static Color get(long pointer) { + if (pointer == 0 ) { + return null; + } Color instance = instances.get(pointer); if (instance == null ) { instance = new Color(pointer); diff --git a/bwapi4/CompareFilter.java b/bwapi4/CompareFilter.java index 66c36f3..c4fa5a6 100644 --- a/bwapi4/CompareFilter.java +++ b/bwapi4/CompareFilter.java @@ -17,6 +17,9 @@ public class CompareFilter { } private static CompareFilter get(long pointer) { + if (pointer == 0 ) { + return null; + } CompareFilter instance = instances.get(pointer); if (instance == null ) { instance = new CompareFilter(pointer); diff --git a/bwapi4/DamageType.java b/bwapi4/DamageType.java index 1c6080e..58498c7 100644 --- a/bwapi4/DamageType.java +++ b/bwapi4/DamageType.java @@ -9,6 +9,20 @@ import java.util.List; public class DamageType { + public static DamageType Independent; + + public static DamageType Explosive; + + public static DamageType Concussive; + + public static DamageType Normal; + + public static DamageType Ignore_Armor; + + public static DamageType None; + + public static DamageType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +31,9 @@ public class DamageType { } private static DamageType get(long pointer) { + if (pointer == 0 ) { + return null; + } DamageType instance = instances.get(pointer); if (instance == null ) { instance = new DamageType(pointer); diff --git a/bwapi4/Error.java b/bwapi4/Error.java index b0f9f7f..de2a934 100644 --- a/bwapi4/Error.java +++ b/bwapi4/Error.java @@ -9,6 +9,62 @@ import java.util.List; public class Error { + public static Error Unit_Does_Not_Exist; + + public static Error Unit_Not_Visible; + + public static Error Unit_Not_Owned; + + public static Error Unit_Busy; + + public static Error Incompatible_UnitType; + + public static Error Incompatible_TechType; + + public static Error Incompatible_State; + + public static Error Already_Researched; + + public static Error Fully_Upgraded; + + public static Error Currently_Researching; + + public static Error Currently_Upgrading; + + public static Error Insufficient_Minerals; + + public static Error Insufficient_Gas; + + public static Error Insufficient_Supply; + + public static Error Insufficient_Energy; + + public static Error Insufficient_Tech; + + public static Error Insufficient_Ammo; + + public static Error Insufficient_Space; + + public static Error Invalid_Tile_Position; + + public static Error Unbuildable_Location; + + public static Error Unreachable_Location; + + public static Error Out_Of_Range; + + public static Error Unable_To_Hit; + + public static Error Access_Denied; + + public static Error File_Not_Found; + + public static Error Invalid_Parameter; + + public static Error None; + + public static Error Unknown; + private static Map instances = new HashMap(); @@ -17,6 +73,9 @@ public class Error { } private static Error get(long pointer) { + if (pointer == 0 ) { + return null; + } Error instance = instances.get(pointer); if (instance == null ) { instance = new Error(pointer); diff --git a/bwapi4/Event.java b/bwapi4/Event.java index 6c7ff65..362ca82 100644 --- a/bwapi4/Event.java +++ b/bwapi4/Event.java @@ -37,6 +37,9 @@ public class Event { } private static Event get(long pointer) { + if (pointer == 0 ) { + return null; + } Event instance = instances.get(pointer); if (instance == null ) { instance = new Event(pointer); diff --git a/bwapi4/ExplosionType.java b/bwapi4/ExplosionType.java index 9bc2329..b7afe26 100644 --- a/bwapi4/ExplosionType.java +++ b/bwapi4/ExplosionType.java @@ -9,6 +9,56 @@ import java.util.List; public class ExplosionType { + public static ExplosionType None; + + public static ExplosionType Normal; + + public static ExplosionType Radial_Splash; + + public static ExplosionType Enemy_Splash; + + public static ExplosionType Lockdown; + + public static ExplosionType Nuclear_Missile; + + public static ExplosionType Parasite; + + public static ExplosionType Broodlings; + + public static ExplosionType EMP_Shockwave; + + public static ExplosionType Irradiate; + + public static ExplosionType Ensnare; + + public static ExplosionType Plague; + + public static ExplosionType Stasis_Field; + + public static ExplosionType Dark_Swarm; + + public static ExplosionType Consume; + + public static ExplosionType Yamato_Gun; + + public static ExplosionType Restoration; + + public static ExplosionType Disruption_Web; + + public static ExplosionType Corrosive_Acid; + + public static ExplosionType Mind_Control; + + public static ExplosionType Feedback; + + public static ExplosionType Optical_Flare; + + public static ExplosionType Maelstrom; + + public static ExplosionType Air_Splash; + + public static ExplosionType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +67,9 @@ public class ExplosionType { } private static ExplosionType get(long pointer) { + if (pointer == 0 ) { + return null; + } ExplosionType instance = instances.get(pointer); if (instance == null ) { instance = new ExplosionType(pointer); diff --git a/bwapi4/Force.java b/bwapi4/Force.java index 654e94b..0a46073 100644 --- a/bwapi4/Force.java +++ b/bwapi4/Force.java @@ -17,7 +17,7 @@ public class Force { return getName_native(pointer); } - public Playerset getPlayers() { + public List getPlayers() { return getPlayers_native(pointer); } @@ -29,6 +29,9 @@ public class Force { } private static Force get(long pointer) { + if (pointer == 0 ) { + return null; + } Force instance = instances.get(pointer); if (instance == null ) { instance = new Force(pointer); @@ -43,7 +46,7 @@ public class Force { private native String getName_native(long pointer); - private native Playerset getPlayers_native(long pointer); + private native List getPlayers_native(long pointer); } diff --git a/bwapi4/Forceset.java b/bwapi4/Forceset.java index f0b45ab..cb4b362 100644 --- a/bwapi4/Forceset.java +++ b/bwapi4/Forceset.java @@ -9,7 +9,7 @@ import java.util.List; public class Forceset { - public Playerset getPlayers() { + public List getPlayers() { return getPlayers_native(pointer); } @@ -21,6 +21,9 @@ public class Forceset { } private static Forceset get(long pointer) { + if (pointer == 0 ) { + return null; + } Forceset instance = instances.get(pointer); if (instance == null ) { instance = new Forceset(pointer); @@ -31,7 +34,7 @@ public class Forceset { private long pointer; - private native Playerset getPlayers_native(long pointer); + private native List getPlayers_native(long pointer); } diff --git a/bwapi4/Game.java b/bwapi4/Game.java index 23451b8..dd609e0 100644 --- a/bwapi4/Game.java +++ b/bwapi4/Game.java @@ -9,43 +9,43 @@ import java.util.List; public class Game { - public Forceset getForces() { + public List getForces() { return getForces_native(pointer); } - public Playerset getPlayers() { + public List getPlayers() { return getPlayers_native(pointer); } - public Unitset getAllUnits() { + public List getAllUnits() { return getAllUnits_native(pointer); } - public Unitset getMinerals() { + public List getMinerals() { return getMinerals_native(pointer); } - public Unitset getGeysers() { + public List getGeysers() { return getGeysers_native(pointer); } - public Unitset getNeutralUnits() { + public List getNeutralUnits() { return getNeutralUnits_native(pointer); } - public Unitset getStaticMinerals() { + public List getStaticMinerals() { return getStaticMinerals_native(pointer); } - public Unitset getStaticGeysers() { + public List getStaticGeysers() { return getStaticGeysers_native(pointer); } - public Unitset getStaticNeutralUnits() { + public List getStaticNeutralUnits() { return getStaticNeutralUnits_native(pointer); } - public Bulletset getBullets() { + public List getBullets() { return getBullets_native(pointer); } @@ -133,27 +133,27 @@ public class Game { enableFlag_native(pointer, flag); } - public Unitset getUnitsOnTile(int tileX, int tileY, UnitFilter pred) { + public List getUnitsOnTile(int tileX, int tileY, UnitFilter pred) { return getUnitsOnTile_native(pointer, tileX, tileY, pred); } - public Unitset getUnitsOnTile(TilePosition tile, UnitFilter pred) { + public List getUnitsOnTile(TilePosition tile, UnitFilter pred) { return getUnitsOnTile_native(pointer, tile, pred); } - public Unitset getUnitsInRectangle(int left, int top, int right, int bottom, UnitFilter pred) { + public List getUnitsInRectangle(int left, int top, int right, int bottom, UnitFilter pred) { return getUnitsInRectangle_native(pointer, left, top, right, bottom, pred); } - public Unitset getUnitsInRectangle(Position topLeft, Position bottomRight, UnitFilter pred) { + public List getUnitsInRectangle(Position topLeft, Position bottomRight, UnitFilter pred) { return getUnitsInRectangle_native(pointer, topLeft, bottomRight, pred); } - public Unitset getUnitsInRadius(int x, int y, int radius, UnitFilter pred) { + public List getUnitsInRadius(int x, int y, int radius, UnitFilter pred) { return getUnitsInRadius_native(pointer, x, y, radius, pred); } - public Unitset getUnitsInRadius(Position center, int radius, UnitFilter pred) { + public List getUnitsInRadius(Position center, int radius, UnitFilter pred) { return getUnitsInRadius_native(pointer, center, radius, pred); } @@ -373,14 +373,26 @@ public class Game { return canUpgrade_native(pointer, type, unit, checkCanIssueCommandType); } + public void printf(String cstr_format) { + printf_native(pointer, cstr_format); + } + public void vPrintf(String cstr_format, Object ... args) { vPrintf_native(pointer, cstr_format, args); } + public void sendText(String cstr_format) { + sendText_native(pointer, cstr_format); + } + public void vSendText(String cstr_format, Object ... args) { vSendText_native(pointer, cstr_format, args); } + public void sendTextEx(boolean toAllies, String cstr_format) { + sendTextEx_native(pointer, toAllies, cstr_format); + } + public void vSendTextEx(boolean toAllies, String cstr_format, Object ... args) { vSendTextEx_native(pointer, toAllies, cstr_format, args); } @@ -425,11 +437,11 @@ public class Game { setLocalSpeed_native(pointer, speed); } - public boolean issueCommand(Unitset units, UnitCommand command) { + public boolean issueCommand(List units, UnitCommand command) { return issueCommand_native(pointer, units, command); } - public Unitset getSelectedUnits() { + public List getSelectedUnits() { return getSelectedUnits_native(pointer); } @@ -445,15 +457,15 @@ public class Game { return neutral_native(pointer); } - public Playerset allies() { + public List allies() { return allies_native(pointer); } - public Playerset enemies() { + public List enemies() { return enemies_native(pointer); } - public Playerset observers() { + public List observers() { return observers_native(pointer); } @@ -469,6 +481,34 @@ public class Game { vDrawText_native(pointer, ctype, x, y, cstr_format, arg); } + public void drawText(bwapi4.CoordinateType.Enum ctype, int x, int y, String cstr_format) { + drawText_native(pointer, ctype, x, y, cstr_format); + } + + public void drawTextMap(int x, int y, String cstr_format) { + drawTextMap_native(pointer, x, y, cstr_format); + } + + public void drawTextMap(Position p, String cstr_format) { + drawTextMap_native(pointer, p, cstr_format); + } + + public void drawTextMouse(int x, int y, String cstr_format) { + drawTextMouse_native(pointer, x, y, cstr_format); + } + + public void drawTextMouse(Position p, String cstr_format) { + drawTextMouse_native(pointer, p, cstr_format); + } + + public void drawTextScreen(int x, int y, String cstr_format) { + drawTextScreen_native(pointer, x, y, cstr_format); + } + + public void drawTextScreen(Position p, String cstr_format) { + drawTextScreen_native(pointer, p, cstr_format); + } + public void drawBox(bwapi4.CoordinateType.Enum ctype, int left, int top, int right, int bottom, Color color) { drawBox_native(pointer, ctype, left, top, right, bottom, color); } @@ -905,6 +945,9 @@ public class Game { } private static Game get(long pointer) { + if (pointer == 0 ) { + return null; + } Game instance = instances.get(pointer); if (instance == null ) { instance = new Game(pointer); @@ -915,25 +958,25 @@ public class Game { private long pointer; - private native Forceset getForces_native(long pointer); + private native List getForces_native(long pointer); - private native Playerset getPlayers_native(long pointer); + private native List getPlayers_native(long pointer); - private native Unitset getAllUnits_native(long pointer); + private native List getAllUnits_native(long pointer); - private native Unitset getMinerals_native(long pointer); + private native List getMinerals_native(long pointer); - private native Unitset getGeysers_native(long pointer); + private native List getGeysers_native(long pointer); - private native Unitset getNeutralUnits_native(long pointer); + private native List getNeutralUnits_native(long pointer); - private native Unitset getStaticMinerals_native(long pointer); + private native List getStaticMinerals_native(long pointer); - private native Unitset getStaticGeysers_native(long pointer); + private native List getStaticGeysers_native(long pointer); - private native Unitset getStaticNeutralUnits_native(long pointer); + private native List getStaticNeutralUnits_native(long pointer); - private native Bulletset getBullets_native(long pointer); + private native List getBullets_native(long pointer); private native Force getForce_native(long pointer, int forceID); @@ -977,17 +1020,17 @@ public class Game { private native void enableFlag_native(long pointer, int flag); - private native Unitset getUnitsOnTile_native(long pointer, int tileX, int tileY, UnitFilter pred); + private native List getUnitsOnTile_native(long pointer, int tileX, int tileY, UnitFilter pred); - private native Unitset getUnitsOnTile_native(long pointer, TilePosition tile, UnitFilter pred); + private native List getUnitsOnTile_native(long pointer, TilePosition tile, UnitFilter pred); - private native Unitset getUnitsInRectangle_native(long pointer, int left, int top, int right, int bottom, UnitFilter pred); + private native List getUnitsInRectangle_native(long pointer, int left, int top, int right, int bottom, UnitFilter pred); - private native Unitset getUnitsInRectangle_native(long pointer, Position topLeft, Position bottomRight, UnitFilter pred); + private native List getUnitsInRectangle_native(long pointer, Position topLeft, Position bottomRight, UnitFilter pred); - private native Unitset getUnitsInRadius_native(long pointer, int x, int y, int radius, UnitFilter pred); + private native List getUnitsInRadius_native(long pointer, int x, int y, int radius, UnitFilter pred); - private native Unitset getUnitsInRadius_native(long pointer, Position center, int radius, UnitFilter pred); + private native List getUnitsInRadius_native(long pointer, Position center, int radius, UnitFilter pred); private native Unit getClosestUnit_native(long pointer, Position center, UnitFilter pred); @@ -1097,10 +1140,16 @@ public class Game { private native boolean canUpgrade_native(long pointer, UpgradeType type, Unit unit, boolean checkCanIssueCommandType); + private native void printf_native(long pointer, String cstr_format); + private native void vPrintf_native(long pointer, String cstr_format, Object ... args); + private native void sendText_native(long pointer, String cstr_format); + private native void vSendText_native(long pointer, String cstr_format, Object ... args); + private native void sendTextEx_native(long pointer, boolean toAllies, String cstr_format); + private native void vSendTextEx_native(long pointer, boolean toAllies, String cstr_format, Object ... args); private native boolean isInGame_native(long pointer); @@ -1123,9 +1172,9 @@ public class Game { private native void setLocalSpeed_native(long pointer, int speed); - private native boolean issueCommand_native(long pointer, Unitset units, UnitCommand command); + private native boolean issueCommand_native(long pointer, List units, UnitCommand command); - private native Unitset getSelectedUnits_native(long pointer); + private native List getSelectedUnits_native(long pointer); private native Player self_native(long pointer); @@ -1133,11 +1182,11 @@ public class Game { private native Player neutral_native(long pointer); - private native Playerset allies_native(long pointer); + private native List allies_native(long pointer); - private native Playerset enemies_native(long pointer); + private native List enemies_native(long pointer); - private native Playerset observers_native(long pointer); + private native List observers_native(long pointer); private native void setTextSize_native(long pointer); @@ -1145,6 +1194,20 @@ public class Game { private native void vDrawText_native(long pointer, bwapi4.CoordinateType.Enum ctype, int x, int y, String cstr_format, Object ... arg); + private native void drawText_native(long pointer, bwapi4.CoordinateType.Enum ctype, int x, int y, String cstr_format); + + private native void drawTextMap_native(long pointer, int x, int y, String cstr_format); + + private native void drawTextMap_native(long pointer, Position p, String cstr_format); + + private native void drawTextMouse_native(long pointer, int x, int y, String cstr_format); + + private native void drawTextMouse_native(long pointer, Position p, String cstr_format); + + private native void drawTextScreen_native(long pointer, int x, int y, String cstr_format); + + private native void drawTextScreen_native(long pointer, Position p, String cstr_format); + private native void drawBox_native(long pointer, bwapi4.CoordinateType.Enum ctype, int left, int top, int right, int bottom, Color color); private native void drawBox_native(long pointer, bwapi4.CoordinateType.Enum ctype, int left, int top, int right, int bottom, Color color, boolean isSolid); diff --git a/bwapi4/GameType.java b/bwapi4/GameType.java index 257a416..76e3eb9 100644 --- a/bwapi4/GameType.java +++ b/bwapi4/GameType.java @@ -9,6 +9,36 @@ import java.util.List; public class GameType { + public static GameType Melee; + + public static GameType Free_For_All; + + public static GameType One_on_One; + + public static GameType Capture_The_Flag; + + public static GameType Greed; + + public static GameType Slaughter; + + public static GameType Sudden_Death; + + public static GameType Ladder; + + public static GameType Use_Map_Settings; + + public static GameType Team_Melee; + + public static GameType Team_Free_For_All; + + public static GameType Team_Capture_The_Flag; + + public static GameType Top_vs_Bottom; + + public static GameType None; + + public static GameType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +47,9 @@ public class GameType { } private static GameType get(long pointer) { + if (pointer == 0 ) { + return null; + } GameType instance = instances.get(pointer); if (instance == null ) { instance = new GameType(pointer); diff --git a/bwapi4/GameWrapper.java b/bwapi4/GameWrapper.java index 4e35178..7efa2e4 100644 --- a/bwapi4/GameWrapper.java +++ b/bwapi4/GameWrapper.java @@ -21,6 +21,9 @@ public class GameWrapper { } private static GameWrapper get(long pointer) { + if (pointer == 0 ) { + return null; + } GameWrapper instance = instances.get(pointer); if (instance == null ) { instance = new GameWrapper(pointer); diff --git a/bwapi4/Order.java b/bwapi4/Order.java index 9c3c3e3..7986a9c 100644 --- a/bwapi4/Order.java +++ b/bwapi4/Order.java @@ -9,6 +9,318 @@ import java.util.List; public class Order { + public static Order Die; + + public static Order Stop; + + public static Order Guard; + + public static Order PlayerGuard; + + public static Order TurretGuard; + + public static Order BunkerGuard; + + public static Order Move; + + public static Order AttackUnit; + + public static Order AttackTile; + + public static Order Hover; + + public static Order AttackMove; + + public static Order InfestedCommandCenter; + + public static Order UnusedNothing; + + public static Order UnusedPowerup; + + public static Order TowerGuard; + + public static Order VultureMine; + + public static Order Nothing; + + public static Order CastInfestation; + + public static Order InfestingCommandCenter; + + public static Order PlaceBuilding; + + public static Order CreateProtossBuilding; + + public static Order ConstructingBuilding; + + public static Order Repair; + + public static Order PlaceAddon; + + public static Order BuildAddon; + + public static Order Train; + + public static Order RallyPointUnit; + + public static Order RallyPointTile; + + public static Order ZergBirth; + + public static Order ZergUnitMorph; + + public static Order ZergBuildingMorph; + + public static Order IncompleteBuilding; + + public static Order BuildNydusExit; + + public static Order EnterNydusCanal; + + public static Order Follow; + + public static Order Carrier; + + public static Order ReaverCarrierMove; + + public static Order CarrierIgnore2; + + public static Order Reaver; + + public static Order TrainFighter; + + public static Order InterceptorAttack; + + public static Order ScarabAttack; + + public static Order RechargeShieldsUnit; + + public static Order RechargeShieldsBattery; + + public static Order ShieldBattery; + + public static Order InterceptorReturn; + + public static Order BuildingLand; + + public static Order BuildingLiftOff; + + public static Order DroneLiftOff; + + public static Order LiftingOff; + + public static Order ResearchTech; + + public static Order Upgrade; + + public static Order Larva; + + public static Order SpawningLarva; + + public static Order Harvest1; + + public static Order Harvest2; + + public static Order MoveToGas; + + public static Order WaitForGas; + + public static Order HarvestGas; + + public static Order ReturnGas; + + public static Order MoveToMinerals; + + public static Order WaitForMinerals; + + public static Order MiningMinerals; + + public static Order Harvest3; + + public static Order Harvest4; + + public static Order ReturnMinerals; + + public static Order Interrupted; + + public static Order EnterTransport; + + public static Order PickupIdle; + + public static Order PickupTransport; + + public static Order PickupBunker; + + public static Order Pickup4; + + public static Order PowerupIdle; + + public static Order Sieging; + + public static Order Unsieging; + + public static Order InitCreepGrowth; + + public static Order SpreadCreep; + + public static Order StoppingCreepGrowth; + + public static Order GuardianAspect; + + public static Order ArchonWarp; + + public static Order CompletingArchonSummon; + + public static Order HoldPosition; + + public static Order Cloak; + + public static Order Decloak; + + public static Order Unload; + + public static Order MoveUnload; + + public static Order FireYamatoGun; + + public static Order CastLockdown; + + public static Order Burrowing; + + public static Order Burrowed; + + public static Order Unburrowing; + + public static Order CastDarkSwarm; + + public static Order CastParasite; + + public static Order CastSpawnBroodlings; + + public static Order CastEMPShockwave; + + public static Order NukeWait; + + public static Order NukeTrain; + + public static Order NukeLaunch; + + public static Order NukePaint; + + public static Order NukeUnit; + + public static Order CastNuclearStrike; + + public static Order NukeTrack; + + public static Order CloakNearbyUnits; + + public static Order PlaceMine; + + public static Order RightClickAction; + + public static Order CastRecall; + + public static Order Teleport; + + public static Order CastScannerSweep; + + public static Order Scanner; + + public static Order CastDefensiveMatrix; + + public static Order CastPsionicStorm; + + public static Order CastIrradiate; + + public static Order CastPlague; + + public static Order CastConsume; + + public static Order CastEnsnare; + + public static Order CastStasisField; + + public static Order CastHallucination; + + public static Order Hallucination2; + + public static Order ResetCollision; + + public static Order Patrol; + + public static Order CTFCOPInit; + + public static Order CTFCOPStarted; + + public static Order CTFCOP2; + + public static Order ComputerAI; + + public static Order AtkMoveEP; + + public static Order HarassMove; + + public static Order AIPatrol; + + public static Order GuardPost; + + public static Order RescuePassive; + + public static Order Neutral; + + public static Order ComputerReturn; + + public static Order SelfDestructing; + + public static Order Critter; + + public static Order HiddenGun; + + public static Order OpenDoor; + + public static Order CloseDoor; + + public static Order HideTrap; + + public static Order RevealTrap; + + public static Order EnableDoodad; + + public static Order DisableDoodad; + + public static Order WarpIn; + + public static Order Medic; + + public static Order MedicHeal; + + public static Order HealMove; + + public static Order MedicHealToIdle; + + public static Order CastRestoration; + + public static Order CastDisruptionWeb; + + public static Order CastMindControl; + + public static Order DarkArchonMeld; + + public static Order CastFeedback; + + public static Order CastOpticalFlare; + + public static Order CastMaelstrom; + + public static Order JunkYardDog; + + public static Order Fatal; + + public static Order None; + + public static Order Unknown; + private static Map instances = new HashMap(); @@ -17,6 +329,9 @@ public class Order { } private static Order get(long pointer) { + if (pointer == 0 ) { + return null; + } Order instance = instances.get(pointer); if (instance == null ) { instance = new Order(pointer); diff --git a/bwapi4/Player.java b/bwapi4/Player.java index 24c0ca3..f72e97d 100644 --- a/bwapi4/Player.java +++ b/bwapi4/Player.java @@ -257,6 +257,9 @@ public class Player { } private static Player get(long pointer) { + if (pointer == 0 ) { + return null; + } Player instance = instances.get(pointer); if (instance == null ) { instance = new Player(pointer); diff --git a/bwapi4/PlayerType.java b/bwapi4/PlayerType.java index 6f041e2..285c771 100644 --- a/bwapi4/PlayerType.java +++ b/bwapi4/PlayerType.java @@ -9,6 +9,28 @@ import java.util.List; public class PlayerType { + public static PlayerType None; + + public static PlayerType Computer; + + public static PlayerType Player; + + public static PlayerType RescuePassive; + + public static PlayerType EitherPreferComputer; + + public static PlayerType EitherPreferHuman; + + public static PlayerType Neutral; + + public static PlayerType Closed; + + public static PlayerType PlayerLeft; + + public static PlayerType ComputerLeft; + + public static PlayerType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +39,9 @@ public class PlayerType { } private static PlayerType get(long pointer) { + if (pointer == 0 ) { + return null; + } PlayerType instance = instances.get(pointer); if (instance == null ) { instance = new PlayerType(pointer); diff --git a/bwapi4/Playerset.java b/bwapi4/Playerset.java index 2d76c92..3c3d885 100644 --- a/bwapi4/Playerset.java +++ b/bwapi4/Playerset.java @@ -9,7 +9,7 @@ import java.util.List; public class Playerset { - public Unitset getUnits() { + public List getUnits() { return getUnits_native(pointer); } @@ -33,6 +33,9 @@ public class Playerset { } private static Playerset get(long pointer) { + if (pointer == 0 ) { + return null; + } Playerset instance = instances.get(pointer); if (instance == null ) { instance = new Playerset(pointer); @@ -43,7 +46,7 @@ public class Playerset { private long pointer; - private native Unitset getUnits_native(long pointer); + private native List getUnits_native(long pointer); private native void setAlliance_native(long pointer, boolean allies); diff --git a/bwapi4/Point.java b/bwapi4/Point.java index ff09813..ba76210 100644 --- a/bwapi4/Point.java +++ b/bwapi4/Point.java @@ -25,6 +25,9 @@ public class Point { } private static Point get(long pointer) { + if (pointer == 0 ) { + return null; + } Point instance = instances.get(pointer); if (instance == null ) { instance = new Point(pointer); diff --git a/bwapi4/Position.java b/bwapi4/Position.java index 3cef294..296e717 100644 --- a/bwapi4/Position.java +++ b/bwapi4/Position.java @@ -7,7 +7,7 @@ import java.util.Map; /** * Positions are measured in pixels and are the highest resolution. */ -public class Position { +public class Position extends AbstractPoint{ private int x, y; @@ -83,4 +83,8 @@ public class Position { } private long pointer; + + public Position getPoint(){ + return this; + } } \ No newline at end of file diff --git a/bwapi4/PositionOrUnit.java b/bwapi4/PositionOrUnit.java index d818c04..06301cc 100644 --- a/bwapi4/PositionOrUnit.java +++ b/bwapi4/PositionOrUnit.java @@ -33,6 +33,9 @@ public class PositionOrUnit { } private static PositionOrUnit get(long pointer) { + if (pointer == 0 ) { + return null; + } PositionOrUnit instance = instances.get(pointer); if (instance == null ) { instance = new PositionOrUnit(pointer); diff --git a/bwapi4/PositionedObject.java b/bwapi4/PositionedObject.java new file mode 100644 index 0000000..d739a6a --- /dev/null +++ b/bwapi4/PositionedObject.java @@ -0,0 +1,15 @@ +package bwapi4; + +import bwapi4.Position; + +/** + * Interrmediate class used to translate getPoint() calls to getPosition() calls. + */ +public abstract class PositionedObject extends AbstractPoint { + + public Position getPoint(){ + return getPosition(); + } + + public abstract Position getPosition(); +} \ No newline at end of file diff --git a/bwapi4/Race.java b/bwapi4/Race.java index 89be1d2..759e5d4 100644 --- a/bwapi4/Race.java +++ b/bwapi4/Race.java @@ -9,6 +9,18 @@ import java.util.List; public class Race { + public static Race Zerg; + + public static Race Terran; + + public static Race Protoss; + + public static Race Random; + + public static Race None; + + public static Race Unknown; + private static Map instances = new HashMap(); @@ -17,6 +29,9 @@ public class Race { } private static Race get(long pointer) { + if (pointer == 0 ) { + return null; + } Race instance = instances.get(pointer); if (instance == null ) { instance = new Race(pointer); diff --git a/bwapi4/Region.java b/bwapi4/Region.java index 12aa77c..e914e82 100644 --- a/bwapi4/Region.java +++ b/bwapi4/Region.java @@ -6,8 +6,10 @@ import java.util.Map; import java.util.HashMap; import java.util.Collection; import java.util.List; +import bwapi4.CenteredObject; -public class Region { +public class Region extends CenteredObject +{ public int getID() { return getID_native(pointer); @@ -61,7 +63,7 @@ public class Region { return getDistance_native(pointer, other); } - public Unitset getUnits(UnitFilter pred) { + public List getUnits(UnitFilter pred) { return getUnits_native(pointer, pred); } @@ -73,6 +75,9 @@ public class Region { } private static Region get(long pointer) { + if (pointer == 0 ) { + return null; + } Region instance = instances.get(pointer); if (instance == null ) { instance = new Region(pointer); @@ -109,7 +114,7 @@ public class Region { private native int getDistance_native(long pointer, Region other); - private native Unitset getUnits_native(long pointer, UnitFilter pred); + private native List getUnits_native(long pointer, UnitFilter pred); } diff --git a/bwapi4/Regionset.java b/bwapi4/Regionset.java index 9c2ae6f..416ac15 100644 --- a/bwapi4/Regionset.java +++ b/bwapi4/Regionset.java @@ -13,7 +13,7 @@ public class Regionset { return getCenter_native(pointer); } - public Unitset getUnits(UnitFilter pred) { + public List getUnits(UnitFilter pred) { return getUnits_native(pointer, pred); } @@ -25,6 +25,9 @@ public class Regionset { } private static Regionset get(long pointer) { + if (pointer == 0 ) { + return null; + } Regionset instance = instances.get(pointer); if (instance == null ) { instance = new Regionset(pointer); @@ -37,7 +40,7 @@ public class Regionset { private native Position getCenter_native(long pointer); - private native Unitset getUnits_native(long pointer, UnitFilter pred); + private native List getUnits_native(long pointer, UnitFilter pred); } diff --git a/bwapi4/TechType.java b/bwapi4/TechType.java index 0b04391..7272b99 100644 --- a/bwapi4/TechType.java +++ b/bwapi4/TechType.java @@ -9,6 +9,78 @@ import java.util.List; public class TechType { + public static TechType Stim_Packs; + + public static TechType Lockdown; + + public static TechType EMP_Shockwave; + + public static TechType Spider_Mines; + + public static TechType Scanner_Sweep; + + public static TechType Tank_Siege_Mode; + + public static TechType Defensive_Matrix; + + public static TechType Irradiate; + + public static TechType Yamato_Gun; + + public static TechType Cloaking_Field; + + public static TechType Personnel_Cloaking; + + public static TechType Burrowing; + + public static TechType Infestation; + + public static TechType Spawn_Broodlings; + + public static TechType Dark_Swarm; + + public static TechType Plague; + + public static TechType Consume; + + public static TechType Ensnare; + + public static TechType Parasite; + + public static TechType Psionic_Storm; + + public static TechType Hallucination; + + public static TechType Recall; + + public static TechType Stasis_Field; + + public static TechType Archon_Warp; + + public static TechType Restoration; + + public static TechType Disruption_Web; + + public static TechType Mind_Control; + + public static TechType Dark_Archon_Meld; + + public static TechType Feedback; + + public static TechType Optical_Flare; + + public static TechType Maelstrom; + + public static TechType Lurker_Aspect; + + public static TechType Healing; + + public static TechType None; + + public static TechType Nuclear_Strike; + + public static TechType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +89,9 @@ public class TechType { } private static TechType get(long pointer) { + if (pointer == 0 ) { + return null; + } TechType instance = instances.get(pointer); if (instance == null ) { instance = new TechType(pointer); diff --git a/bwapi4/UnaryFilter.java b/bwapi4/UnaryFilter.java index d241515..d3848f6 100644 --- a/bwapi4/UnaryFilter.java +++ b/bwapi4/UnaryFilter.java @@ -17,6 +17,9 @@ public class UnaryFilter { } private static UnaryFilter get(long pointer) { + if (pointer == 0 ) { + return null; + } UnaryFilter instance = instances.get(pointer); if (instance == null ) { instance = new UnaryFilter(pointer); diff --git a/bwapi4/Unit.java b/bwapi4/Unit.java index 15d557a..98c565d 100644 --- a/bwapi4/Unit.java +++ b/bwapi4/Unit.java @@ -6,8 +6,10 @@ import java.util.Map; import java.util.HashMap; import java.util.Collection; import java.util.List; +import bwapi4.PositionedObject; -public class Unit { +public class Unit extends PositionedObject +{ public int getID() { return getID_native(pointer); @@ -281,7 +283,7 @@ public class Unit { return getTransport_native(pointer); } - public Unitset getLoadedUnits() { + public List getLoadedUnits() { return getLoadedUnits_native(pointer); } @@ -293,7 +295,7 @@ public class Unit { return getCarrier_native(pointer); } - public Unitset getInterceptors() { + public List getInterceptors() { return getInterceptors_native(pointer); } @@ -301,15 +303,15 @@ public class Unit { return getHatchery_native(pointer); } - public Unitset getLarva() { + public List getLarva() { return getLarva_native(pointer); } - public Unitset getUnitsInRadius(int radius, UnitFilter pred) { + public List getUnitsInRadius(int radius, UnitFilter pred) { return getUnitsInRadius_native(pointer, radius, pred); } - public Unitset getUnitsInWeaponRange(WeaponType weapon, UnitFilter pred) { + public List getUnitsInWeaponRange(WeaponType weapon, UnitFilter pred) { return getUnitsInWeaponRange_native(pointer, weapon, pred); } @@ -1845,6 +1847,9 @@ public class Unit { } private static Unit get(long pointer) { + if (pointer == 0 ) { + return null; + } Unit instance = instances.get(pointer); if (instance == null ) { instance = new Unit(pointer); @@ -1991,21 +1996,21 @@ public class Unit { private native Unit getTransport_native(long pointer); - private native Unitset getLoadedUnits_native(long pointer); + private native List getLoadedUnits_native(long pointer); private native int getSpaceRemaining_native(long pointer); private native Unit getCarrier_native(long pointer); - private native Unitset getInterceptors_native(long pointer); + private native List getInterceptors_native(long pointer); private native Unit getHatchery_native(long pointer); - private native Unitset getLarva_native(long pointer); + private native List getLarva_native(long pointer); - private native Unitset getUnitsInRadius_native(long pointer, int radius, UnitFilter pred); + private native List getUnitsInRadius_native(long pointer, int radius, UnitFilter pred); - private native Unitset getUnitsInWeaponRange_native(long pointer, WeaponType weapon, UnitFilter pred); + private native List getUnitsInWeaponRange_native(long pointer, WeaponType weapon, UnitFilter pred); private native Unit getClosestUnit_native(long pointer, UnitFilter pred); diff --git a/bwapi4/UnitCommand.java b/bwapi4/UnitCommand.java index 0beb337..d1692a4 100644 --- a/bwapi4/UnitCommand.java +++ b/bwapi4/UnitCommand.java @@ -21,6 +21,9 @@ public class UnitCommand { } private static UnitCommand get(long pointer) { + if (pointer == 0 ) { + return null; + } UnitCommand instance = instances.get(pointer); if (instance == null ) { instance = new UnitCommand(pointer); diff --git a/bwapi4/UnitCommandType.java b/bwapi4/UnitCommandType.java index 9fc3262..0ccb3fb 100644 --- a/bwapi4/UnitCommandType.java +++ b/bwapi4/UnitCommandType.java @@ -9,6 +9,98 @@ import java.util.List; public class UnitCommandType { + public static UnitCommandType Attack_Move; + + public static UnitCommandType Attack_Unit; + + public static UnitCommandType Build; + + public static UnitCommandType Build_Addon; + + public static UnitCommandType Train; + + public static UnitCommandType Morph; + + public static UnitCommandType Research; + + public static UnitCommandType Upgrade; + + public static UnitCommandType Set_Rally_Position; + + public static UnitCommandType Set_Rally_Unit; + + public static UnitCommandType Move; + + public static UnitCommandType Patrol; + + public static UnitCommandType Hold_Position; + + public static UnitCommandType Stop; + + public static UnitCommandType Follow; + + public static UnitCommandType Gather; + + public static UnitCommandType Return_Cargo; + + public static UnitCommandType Repair; + + public static UnitCommandType Burrow; + + public static UnitCommandType Unburrow; + + public static UnitCommandType Cloak; + + public static UnitCommandType Decloak; + + public static UnitCommandType Siege; + + public static UnitCommandType Unsiege; + + public static UnitCommandType Lift; + + public static UnitCommandType Land; + + public static UnitCommandType Load; + + public static UnitCommandType Unload; + + public static UnitCommandType Unload_All; + + public static UnitCommandType Unload_All_Position; + + public static UnitCommandType Right_Click_Position; + + public static UnitCommandType Right_Click_Unit; + + public static UnitCommandType Halt_Construction; + + public static UnitCommandType Cancel_Construction; + + public static UnitCommandType Cancel_Addon; + + public static UnitCommandType Cancel_Train; + + public static UnitCommandType Cancel_Train_Slot; + + public static UnitCommandType Cancel_Morph; + + public static UnitCommandType Cancel_Research; + + public static UnitCommandType Cancel_Upgrade; + + public static UnitCommandType Use_Tech; + + public static UnitCommandType Use_Tech_Position; + + public static UnitCommandType Use_Tech_Unit; + + public static UnitCommandType Place_COP; + + public static UnitCommandType None; + + public static UnitCommandType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +109,9 @@ public class UnitCommandType { } private static UnitCommandType get(long pointer) { + if (pointer == 0 ) { + return null; + } UnitCommandType instance = instances.get(pointer); if (instance == null ) { instance = new UnitCommandType(pointer); diff --git a/bwapi4/UnitSizeType.java b/bwapi4/UnitSizeType.java index 50543c1..740aee7 100644 --- a/bwapi4/UnitSizeType.java +++ b/bwapi4/UnitSizeType.java @@ -9,6 +9,18 @@ import java.util.List; public class UnitSizeType { + public static UnitSizeType Independent; + + public static UnitSizeType Small; + + public static UnitSizeType Medium; + + public static UnitSizeType Large; + + public static UnitSizeType None; + + public static UnitSizeType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +29,9 @@ public class UnitSizeType { } private static UnitSizeType get(long pointer) { + if (pointer == 0 ) { + return null; + } UnitSizeType instance = instances.get(pointer); if (instance == null ) { instance = new UnitSizeType(pointer); diff --git a/bwapi4/UnitType.java b/bwapi4/UnitType.java index 82f356b..6e8cfc6 100644 --- a/bwapi4/UnitType.java +++ b/bwapi4/UnitType.java @@ -9,6 +9,428 @@ import java.util.List; public class UnitType { + public static UnitType Terran_Marine; + + public static UnitType Terran_Ghost; + + public static UnitType Terran_Vulture; + + public static UnitType Terran_Goliath; + + public static UnitType Terran_Siege_Tank_Tank_Mode; + + public static UnitType Terran_SCV; + + public static UnitType Terran_Wraith; + + public static UnitType Terran_Science_Vessel; + + public static UnitType Hero_Gui_Montag; + + public static UnitType Terran_Dropship; + + public static UnitType Terran_Battlecruiser; + + public static UnitType Terran_Vulture_Spider_Mine; + + public static UnitType Terran_Nuclear_Missile; + + public static UnitType Terran_Civilian; + + public static UnitType Hero_Sarah_Kerrigan; + + public static UnitType Hero_Alan_Schezar; + + public static UnitType Hero_Jim_Raynor_Vulture; + + public static UnitType Hero_Jim_Raynor_Marine; + + public static UnitType Hero_Tom_Kazansky; + + public static UnitType Hero_Magellan; + + public static UnitType Hero_Edmund_Duke_Tank_Mode; + + public static UnitType Hero_Edmund_Duke_Siege_Mode; + + public static UnitType Hero_Arcturus_Mengsk; + + public static UnitType Hero_Hyperion; + + public static UnitType Hero_Norad_II; + + public static UnitType Terran_Siege_Tank_Siege_Mode; + + public static UnitType Terran_Firebat; + + public static UnitType Spell_Scanner_Sweep; + + public static UnitType Terran_Medic; + + public static UnitType Zerg_Larva; + + public static UnitType Zerg_Egg; + + public static UnitType Zerg_Zergling; + + public static UnitType Zerg_Hydralisk; + + public static UnitType Zerg_Ultralisk; + + public static UnitType Zerg_Broodling; + + public static UnitType Zerg_Drone; + + public static UnitType Zerg_Overlord; + + public static UnitType Zerg_Mutalisk; + + public static UnitType Zerg_Guardian; + + public static UnitType Zerg_Queen; + + public static UnitType Zerg_Defiler; + + public static UnitType Zerg_Scourge; + + public static UnitType Hero_Torrasque; + + public static UnitType Hero_Matriarch; + + public static UnitType Zerg_Infested_Terran; + + public static UnitType Hero_Infested_Kerrigan; + + public static UnitType Hero_Unclean_One; + + public static UnitType Hero_Hunter_Killer; + + public static UnitType Hero_Devouring_One; + + public static UnitType Hero_Kukulza_Mutalisk; + + public static UnitType Hero_Kukulza_Guardian; + + public static UnitType Hero_Yggdrasill; + + public static UnitType Terran_Valkyrie; + + public static UnitType Zerg_Cocoon; + + public static UnitType Protoss_Corsair; + + public static UnitType Protoss_Dark_Templar; + + public static UnitType Zerg_Devourer; + + public static UnitType Protoss_Dark_Archon; + + public static UnitType Protoss_Probe; + + public static UnitType Protoss_Zealot; + + public static UnitType Protoss_Dragoon; + + public static UnitType Protoss_High_Templar; + + public static UnitType Protoss_Archon; + + public static UnitType Protoss_Shuttle; + + public static UnitType Protoss_Scout; + + public static UnitType Protoss_Arbiter; + + public static UnitType Protoss_Carrier; + + public static UnitType Protoss_Interceptor; + + public static UnitType Hero_Dark_Templar; + + public static UnitType Hero_Zeratul; + + public static UnitType Hero_Tassadar_Zeratul_Archon; + + public static UnitType Hero_Fenix_Zealot; + + public static UnitType Hero_Fenix_Dragoon; + + public static UnitType Hero_Tassadar; + + public static UnitType Hero_Mojo; + + public static UnitType Hero_Warbringer; + + public static UnitType Hero_Gantrithor; + + public static UnitType Protoss_Reaver; + + public static UnitType Protoss_Observer; + + public static UnitType Protoss_Scarab; + + public static UnitType Hero_Danimoth; + + public static UnitType Hero_Aldaris; + + public static UnitType Hero_Artanis; + + public static UnitType Critter_Rhynadon; + + public static UnitType Critter_Bengalaas; + + public static UnitType Special_Cargo_Ship; + + public static UnitType Special_Mercenary_Gunship; + + public static UnitType Critter_Scantid; + + public static UnitType Critter_Kakaru; + + public static UnitType Critter_Ragnasaur; + + public static UnitType Critter_Ursadon; + + public static UnitType Zerg_Lurker_Egg; + + public static UnitType Hero_Raszagal; + + public static UnitType Hero_Samir_Duran; + + public static UnitType Hero_Alexei_Stukov; + + public static UnitType Special_Map_Revealer; + + public static UnitType Hero_Gerard_DuGalle; + + public static UnitType Zerg_Lurker; + + public static UnitType Hero_Infested_Duran; + + public static UnitType Spell_Disruption_Web; + + public static UnitType Terran_Command_Center; + + public static UnitType Terran_Comsat_Station; + + public static UnitType Terran_Nuclear_Silo; + + public static UnitType Terran_Supply_Depot; + + public static UnitType Terran_Refinery; + + public static UnitType Terran_Barracks; + + public static UnitType Terran_Academy; + + public static UnitType Terran_Factory; + + public static UnitType Terran_Starport; + + public static UnitType Terran_Control_Tower; + + public static UnitType Terran_Science_Facility; + + public static UnitType Terran_Covert_Ops; + + public static UnitType Terran_Physics_Lab; + + public static UnitType Terran_Machine_Shop; + + public static UnitType Terran_Engineering_Bay; + + public static UnitType Terran_Armory; + + public static UnitType Terran_Missile_Turret; + + public static UnitType Terran_Bunker; + + public static UnitType Special_Crashed_Norad_II; + + public static UnitType Special_Ion_Cannon; + + public static UnitType Powerup_Uraj_Crystal; + + public static UnitType Powerup_Khalis_Crystal; + + public static UnitType Zerg_Infested_Command_Center; + + public static UnitType Zerg_Hatchery; + + public static UnitType Zerg_Lair; + + public static UnitType Zerg_Hive; + + public static UnitType Zerg_Nydus_Canal; + + public static UnitType Zerg_Hydralisk_Den; + + public static UnitType Zerg_Defiler_Mound; + + public static UnitType Zerg_Greater_Spire; + + public static UnitType Zerg_Queens_Nest; + + public static UnitType Zerg_Evolution_Chamber; + + public static UnitType Zerg_Ultralisk_Cavern; + + public static UnitType Zerg_Spire; + + public static UnitType Zerg_Spawning_Pool; + + public static UnitType Zerg_Creep_Colony; + + public static UnitType Zerg_Spore_Colony; + + public static UnitType Zerg_Sunken_Colony; + + public static UnitType Special_Overmind_With_Shell; + + public static UnitType Special_Overmind; + + public static UnitType Zerg_Extractor; + + public static UnitType Special_Mature_Chrysalis; + + public static UnitType Special_Cerebrate; + + public static UnitType Special_Cerebrate_Daggoth; + + public static UnitType Protoss_Nexus; + + public static UnitType Protoss_Robotics_Facility; + + public static UnitType Protoss_Pylon; + + public static UnitType Protoss_Assimilator; + + public static UnitType Protoss_Observatory; + + public static UnitType Protoss_Gateway; + + public static UnitType Protoss_Photon_Cannon; + + public static UnitType Protoss_Citadel_of_Adun; + + public static UnitType Protoss_Cybernetics_Core; + + public static UnitType Protoss_Templar_Archives; + + public static UnitType Protoss_Forge; + + public static UnitType Protoss_Stargate; + + public static UnitType Special_Stasis_Cell_Prison; + + public static UnitType Protoss_Fleet_Beacon; + + public static UnitType Protoss_Arbiter_Tribunal; + + public static UnitType Protoss_Robotics_Support_Bay; + + public static UnitType Protoss_Shield_Battery; + + public static UnitType Special_Khaydarin_Crystal_Form; + + public static UnitType Special_Protoss_Temple; + + public static UnitType Special_XelNaga_Temple; + + public static UnitType Resource_Mineral_Field; + + public static UnitType Resource_Mineral_Field_Type_2; + + public static UnitType Resource_Mineral_Field_Type_3; + + public static UnitType Special_Independant_Starport; + + public static UnitType Resource_Vespene_Geyser; + + public static UnitType Special_Warp_Gate; + + public static UnitType Special_Psi_Disrupter; + + public static UnitType Special_Zerg_Beacon; + + public static UnitType Special_Terran_Beacon; + + public static UnitType Special_Protoss_Beacon; + + public static UnitType Special_Zerg_Flag_Beacon; + + public static UnitType Special_Terran_Flag_Beacon; + + public static UnitType Special_Protoss_Flag_Beacon; + + public static UnitType Special_Power_Generator; + + public static UnitType Special_Overmind_Cocoon; + + public static UnitType Spell_Dark_Swarm; + + public static UnitType Special_Floor_Missile_Trap; + + public static UnitType Special_Floor_Hatch; + + public static UnitType Special_Upper_Level_Door; + + public static UnitType Special_Right_Upper_Level_Door; + + public static UnitType Special_Pit_Door; + + public static UnitType Special_Right_Pit_Door; + + public static UnitType Special_Floor_Gun_Trap; + + public static UnitType Special_Wall_Missile_Trap; + + public static UnitType Special_Wall_Flame_Trap; + + public static UnitType Special_Right_Wall_Missile_Trap; + + public static UnitType Special_Right_Wall_Flame_Trap; + + public static UnitType Special_Start_Location; + + public static UnitType Powerup_Flag; + + public static UnitType Powerup_Young_Chrysalis; + + public static UnitType Powerup_Psi_Emitter; + + public static UnitType Powerup_Data_Disk; + + public static UnitType Powerup_Khaydarin_Crystal; + + public static UnitType Powerup_Mineral_Cluster_Type_1; + + public static UnitType Powerup_Mineral_Cluster_Type_2; + + public static UnitType Powerup_Protoss_Gas_Orb_Type_1; + + public static UnitType Powerup_Protoss_Gas_Orb_Type_2; + + public static UnitType Powerup_Zerg_Gas_Sac_Type_1; + + public static UnitType Powerup_Zerg_Gas_Sac_Type_2; + + public static UnitType Powerup_Terran_Gas_Tank_Type_1; + + public static UnitType Powerup_Terran_Gas_Tank_Type_2; + + public static UnitType None; + + public static UnitType AllUnits; + + public static UnitType Men; + + public static UnitType Buildings; + + public static UnitType Factories; + + public static UnitType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +439,9 @@ public class UnitType { } private static UnitType get(long pointer) { + if (pointer == 0 ) { + return null; + } UnitType instance = instances.get(pointer); if (instance == null ) { instance = new UnitType(pointer); diff --git a/bwapi4/Unitset.java b/bwapi4/Unitset.java index d312f45..122a85f 100644 --- a/bwapi4/Unitset.java +++ b/bwapi4/Unitset.java @@ -13,15 +13,15 @@ public class Unitset { return getPosition_native(pointer); } - public Unitset getLoadedUnits() { + public List getLoadedUnits() { return getLoadedUnits_native(pointer); } - public Unitset getInterceptors() { + public List getInterceptors() { return getInterceptors_native(pointer); } - public Unitset getLarva() { + public List getLarva() { return getLarva_native(pointer); } @@ -37,7 +37,7 @@ public class Unitset { setClientInfo_native(pointer, clientInfo, index); } - public Unitset getUnitsInRadius(int radius, UnitFilter pred) { + public List getUnitsInRadius(int radius, UnitFilter pred) { return getUnitsInRadius_native(pointer, radius, pred); } @@ -257,6 +257,9 @@ public class Unitset { } private static Unitset get(long pointer) { + if (pointer == 0 ) { + return null; + } Unitset instance = instances.get(pointer); if (instance == null ) { instance = new Unitset(pointer); @@ -269,11 +272,11 @@ public class Unitset { private native Position getPosition_native(long pointer); - private native Unitset getLoadedUnits_native(long pointer); + private native List getLoadedUnits_native(long pointer); - private native Unitset getInterceptors_native(long pointer); + private native List getInterceptors_native(long pointer); - private native Unitset getLarva_native(long pointer); + private native List getLarva_native(long pointer); private native void setClientInfo_native(long pointer, int clientInfo); @@ -281,7 +284,7 @@ public class Unitset { private native void setClientInfo_native(long pointer, int clientInfo, int index); - private native Unitset getUnitsInRadius_native(long pointer, int radius, UnitFilter pred); + private native List getUnitsInRadius_native(long pointer, int radius, UnitFilter pred); private native Unit getClosestUnit_native(long pointer, UnitFilter pred); diff --git a/bwapi4/UpgradeType.java b/bwapi4/UpgradeType.java index 6dd2a7f..02b0eff 100644 --- a/bwapi4/UpgradeType.java +++ b/bwapi4/UpgradeType.java @@ -9,6 +9,112 @@ import java.util.List; public class UpgradeType { + public static UpgradeType Terran_Infantry_Armor; + + public static UpgradeType Terran_Vehicle_Plating; + + public static UpgradeType Terran_Ship_Plating; + + public static UpgradeType Zerg_Carapace; + + public static UpgradeType Zerg_Flyer_Carapace; + + public static UpgradeType Protoss_Ground_Armor; + + public static UpgradeType Protoss_Air_Armor; + + public static UpgradeType Terran_Infantry_Weapons; + + public static UpgradeType Terran_Vehicle_Weapons; + + public static UpgradeType Terran_Ship_Weapons; + + public static UpgradeType Zerg_Melee_Attacks; + + public static UpgradeType Zerg_Missile_Attacks; + + public static UpgradeType Zerg_Flyer_Attacks; + + public static UpgradeType Protoss_Ground_Weapons; + + public static UpgradeType Protoss_Air_Weapons; + + public static UpgradeType Protoss_Plasma_Shields; + + public static UpgradeType U_238_Shells; + + public static UpgradeType Ion_Thrusters; + + public static UpgradeType Titan_Reactor; + + public static UpgradeType Ocular_Implants; + + public static UpgradeType Moebius_Reactor; + + public static UpgradeType Apollo_Reactor; + + public static UpgradeType Colossus_Reactor; + + public static UpgradeType Ventral_Sacs; + + public static UpgradeType Antennae; + + public static UpgradeType Pneumatized_Carapace; + + public static UpgradeType Metabolic_Boost; + + public static UpgradeType Adrenal_Glands; + + public static UpgradeType Muscular_Augments; + + public static UpgradeType Grooved_Spines; + + public static UpgradeType Gamete_Meiosis; + + public static UpgradeType Metasynaptic_Node; + + public static UpgradeType Singularity_Charge; + + public static UpgradeType Leg_Enhancements; + + public static UpgradeType Scarab_Damage; + + public static UpgradeType Reaver_Capacity; + + public static UpgradeType Gravitic_Drive; + + public static UpgradeType Sensor_Array; + + public static UpgradeType Gravitic_Boosters; + + public static UpgradeType Khaydarin_Amulet; + + public static UpgradeType Apial_Sensors; + + public static UpgradeType Gravitic_Thrusters; + + public static UpgradeType Carrier_Capacity; + + public static UpgradeType Khaydarin_Core; + + public static UpgradeType Argus_Jewel; + + public static UpgradeType Argus_Talisman; + + public static UpgradeType Caduceus_Reactor; + + public static UpgradeType Chitinous_Plating; + + public static UpgradeType Anabolic_Synthesis; + + public static UpgradeType Charon_Boosters; + + public static UpgradeType Upgrade_60; + + public static UpgradeType None; + + public static UpgradeType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +123,9 @@ public class UpgradeType { } private static UpgradeType get(long pointer) { + if (pointer == 0 ) { + return null; + } UpgradeType instance = instances.get(pointer); if (instance == null ) { instance = new UpgradeType(pointer); diff --git a/bwapi4/WeaponType.java b/bwapi4/WeaponType.java index fa8354b..51348ae 100644 --- a/bwapi4/WeaponType.java +++ b/bwapi4/WeaponType.java @@ -9,6 +9,210 @@ import java.util.List; public class WeaponType { + public static WeaponType Gauss_Rifle; + + public static WeaponType Gauss_Rifle_Jim_Raynor; + + public static WeaponType C_10_Canister_Rifle; + + public static WeaponType C_10_Canister_Rifle_Sarah_Kerrigan; + + public static WeaponType C_10_Canister_Rifle_Samir_Duran; + + public static WeaponType C_10_Canister_Rifle_Infested_Duran; + + public static WeaponType C_10_Canister_Rifle_Alexei_Stukov; + + public static WeaponType Fragmentation_Grenade; + + public static WeaponType Fragmentation_Grenade_Jim_Raynor; + + public static WeaponType Spider_Mines; + + public static WeaponType Twin_Autocannons; + + public static WeaponType Twin_Autocannons_Alan_Schezar; + + public static WeaponType Hellfire_Missile_Pack; + + public static WeaponType Hellfire_Missile_Pack_Alan_Schezar; + + public static WeaponType Arclite_Cannon; + + public static WeaponType Arclite_Cannon_Edmund_Duke; + + public static WeaponType Fusion_Cutter; + + public static WeaponType Gemini_Missiles; + + public static WeaponType Gemini_Missiles_Tom_Kazansky; + + public static WeaponType Burst_Lasers; + + public static WeaponType Burst_Lasers_Tom_Kazansky; + + public static WeaponType ATS_Laser_Battery; + + public static WeaponType ATS_Laser_Battery_Hero; + + public static WeaponType ATS_Laser_Battery_Hyperion; + + public static WeaponType ATA_Laser_Battery; + + public static WeaponType ATA_Laser_Battery_Hero; + + public static WeaponType ATA_Laser_Battery_Hyperion; + + public static WeaponType Flame_Thrower; + + public static WeaponType Flame_Thrower_Gui_Montag; + + public static WeaponType Arclite_Shock_Cannon; + + public static WeaponType Arclite_Shock_Cannon_Edmund_Duke; + + public static WeaponType Longbolt_Missile; + + public static WeaponType Claws; + + public static WeaponType Claws_Devouring_One; + + public static WeaponType Claws_Infested_Kerrigan; + + public static WeaponType Needle_Spines; + + public static WeaponType Needle_Spines_Hunter_Killer; + + public static WeaponType Kaiser_Blades; + + public static WeaponType Kaiser_Blades_Torrasque; + + public static WeaponType Toxic_Spores; + + public static WeaponType Spines; + + public static WeaponType Acid_Spore; + + public static WeaponType Acid_Spore_Kukulza; + + public static WeaponType Glave_Wurm; + + public static WeaponType Glave_Wurm_Kukulza; + + public static WeaponType Seeker_Spores; + + public static WeaponType Subterranean_Tentacle; + + public static WeaponType Suicide_Infested_Terran; + + public static WeaponType Suicide_Scourge; + + public static WeaponType Particle_Beam; + + public static WeaponType Psi_Blades; + + public static WeaponType Psi_Blades_Fenix; + + public static WeaponType Phase_Disruptor; + + public static WeaponType Phase_Disruptor_Fenix; + + public static WeaponType Psi_Assault; + + public static WeaponType Psionic_Shockwave; + + public static WeaponType Psionic_Shockwave_TZ_Archon; + + public static WeaponType Dual_Photon_Blasters; + + public static WeaponType Dual_Photon_Blasters_Mojo; + + public static WeaponType Dual_Photon_Blasters_Artanis; + + public static WeaponType Anti_Matter_Missiles; + + public static WeaponType Anti_Matter_Missiles_Mojo; + + public static WeaponType Anti_Matter_Missiles_Artanis; + + public static WeaponType Phase_Disruptor_Cannon; + + public static WeaponType Phase_Disruptor_Cannon_Danimoth; + + public static WeaponType Pulse_Cannon; + + public static WeaponType STS_Photon_Cannon; + + public static WeaponType STA_Photon_Cannon; + + public static WeaponType Scarab; + + public static WeaponType Neutron_Flare; + + public static WeaponType Halo_Rockets; + + public static WeaponType Corrosive_Acid; + + public static WeaponType Subterranean_Spines; + + public static WeaponType Warp_Blades; + + public static WeaponType Warp_Blades_Hero; + + public static WeaponType Warp_Blades_Zeratul; + + public static WeaponType Independant_Laser_Battery; + + public static WeaponType Twin_Autocannons_Floor_Trap; + + public static WeaponType Hellfire_Missile_Pack_Wall_Trap; + + public static WeaponType Flame_Thrower_Wall_Trap; + + public static WeaponType Hellfire_Missile_Pack_Floor_Trap; + + public static WeaponType Yamato_Gun; + + public static WeaponType Nuclear_Strike; + + public static WeaponType Lockdown; + + public static WeaponType EMP_Shockwave; + + public static WeaponType Irradiate; + + public static WeaponType Parasite; + + public static WeaponType Spawn_Broodlings; + + public static WeaponType Ensnare; + + public static WeaponType Dark_Swarm; + + public static WeaponType Plague; + + public static WeaponType Consume; + + public static WeaponType Stasis_Field; + + public static WeaponType Psionic_Storm; + + public static WeaponType Disruption_Web; + + public static WeaponType Restoration; + + public static WeaponType Mind_Control; + + public static WeaponType Feedback; + + public static WeaponType Optical_Flare; + + public static WeaponType Maelstrom; + + public static WeaponType None; + + public static WeaponType Unknown; + private static Map instances = new HashMap(); @@ -17,6 +221,9 @@ public class WeaponType { } private static WeaponType get(long pointer) { + if (pointer == 0 ) { + return null; + } WeaponType instance = instances.get(pointer); if (instance == null ) { instance = new WeaponType(pointer); diff --git a/bwapi_bridge.dll b/bwapi_bridge.dll index e827f93..602615a 100644 Binary files a/bwapi_bridge.dll and b/bwapi_bridge.dll differ diff --git a/bwapi_bridge.exp b/bwapi_bridge.exp index ba6435b..a76e22e 100644 Binary files a/bwapi_bridge.exp and b/bwapi_bridge.exp differ diff --git a/bwapi_bridge.lib b/bwapi_bridge.lib index 5e42c8a..36dcb77 100644 Binary files a/bwapi_bridge.lib and b/bwapi_bridge.lib differ diff --git a/bwapi_bridge1_2.exp b/bwapi_bridge1_2.exp index fc02d74..e705a14 100644 Binary files a/bwapi_bridge1_2.exp and b/bwapi_bridge1_2.exp differ diff --git a/bwmirror_v1_2.jar b/bwmirror_v1_2.jar index 6fae5b7..3175b7e 100644 Binary files a/bwmirror_v1_2.jar and b/bwmirror_v1_2.jar differ diff --git a/c/impl.cpp b/c/impl.cpp index 401b855..bbcc406 100644 --- a/c/impl.cpp +++ b/c/impl.cpp @@ -4,6 +4,7 @@ #include #include #include +#include "../BWTA_Result.h" using namespace BWAPI; @@ -5295,6 +5296,14 @@ println("Connecting to Broodwar..."); { switch (it->getType()) { case EventType::MatchStart: + + BWTA::BWTA_Result::regions.clear(); + BWTA::BWTA_Result::baselocations.clear(); + BWTA::BWTA_Result::startlocations.clear(); + BWTA::BWTA_Result::chokepoints.clear(); + BWTA::BWTA_Result::unwalkablePolygons.clear(); + + env->CallVoidMethod(moduleObj, matchStartCallback); break; case EventType::MatchEnd: diff --git a/c4/impl.cpp b/c4/impl.cpp index d45a830..d78ed45 100644 --- a/c4/impl.cpp +++ b/c4/impl.cpp @@ -1,13 +1,26 @@ #include "../concat_header.h" #include #include -#include #include #include - +#include "../BWTA_Result.h" using namespace BWAPI; -std::map tableColor; +std::map tableBulletType; +std::map tableColor; +std::map tableDamageType; +std::map tableError; +std::map tableExplosionType; +std::map tableGameType; +std::map tableOrder; +std::map tablePlayerType; +std::map tableRace; +std::map tableTechType; +std::map tableUnitCommandType; +std::map tableUnitSizeType; +std::map tableUnitType; +std::map tableUpgradeType; +std::map tableWeaponType; using namespace std; @@ -68,12 +81,12 @@ x_aIModule->onSendText(std::string(env->GetStringUTFChars(text, NULL))); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onReceiveText_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_player, jstring text){ AIModule* x_aIModule = (AIModule*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); x_aIModule->onReceiveText(player, std::string(env->GetStringUTFChars(text, NULL))); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onPlayerLeft_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ AIModule* x_aIModule = (AIModule*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); x_aIModule->onPlayerLeft(player); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onNukeDetect_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ @@ -83,42 +96,42 @@ x_aIModule->onNukeDetect(target); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onUnitDiscover_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ AIModule* x_aIModule = (AIModule*)pointer; -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); x_aIModule->onUnitDiscover(unit); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onUnitEvade_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ AIModule* x_aIModule = (AIModule*)pointer; -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); x_aIModule->onUnitEvade(unit); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onUnitShow_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ AIModule* x_aIModule = (AIModule*)pointer; -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); x_aIModule->onUnitShow(unit); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onUnitHide_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ AIModule* x_aIModule = (AIModule*)pointer; -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); x_aIModule->onUnitHide(unit); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onUnitCreate_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ AIModule* x_aIModule = (AIModule*)pointer; -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); x_aIModule->onUnitCreate(unit); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onUnitDestroy_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ AIModule* x_aIModule = (AIModule*)pointer; -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); x_aIModule->onUnitDestroy(unit); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onUnitMorph_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ AIModule* x_aIModule = (AIModule*)pointer; -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); x_aIModule->onUnitMorph(unit); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onUnitRenegade_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ AIModule* x_aIModule = (AIModule*)pointer; -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); x_aIModule->onUnitRenegade(unit); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onSaveGame_1native(JNIEnv * env, jobject obj, jlong pointer, jstring gameName){ @@ -127,84 +140,84 @@ x_aIModule->onSaveGame(std::string(env->GetStringUTFChars(gameName, NULL))); } JNIEXPORT void JNICALL Java_bwapi4_AIModule_onUnitComplete_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ AIModule* x_aIModule = (AIModule*)pointer; -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); x_aIModule->onUnitComplete(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Bullet_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; return x_bullet->getID(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Bullet_exists_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; return x_bullet->exists(); } JNIEXPORT jobject JNICALL Java_bwapi4_Bullet_getPlayer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; jlong resptr = (jlong)x_bullet->getPlayer(); jclass retcls = FindCachedClass(env, "bwapi4/Player"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Player;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Bullet_getType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; jlong resptr = (jlong)x_bullet->getType(); jclass retcls = FindCachedClass(env, "bwapi4/BulletType"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/BulletType;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Bullet_getSource_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; jlong resptr = (jlong)x_bullet->getSource(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Bullet_getPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; Position cresult = x_bullet->getPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jdouble JNICALL Java_bwapi4_Bullet_getAngle_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; return x_bullet->getAngle(); } JNIEXPORT jdouble JNICALL Java_bwapi4_Bullet_getVelocityX_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; return x_bullet->getVelocityX(); } JNIEXPORT jdouble JNICALL Java_bwapi4_Bullet_getVelocityY_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; return x_bullet->getVelocityY(); } JNIEXPORT jobject JNICALL Java_bwapi4_Bullet_getTarget_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; jlong resptr = (jlong)x_bullet->getTarget(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Bullet_getTargetPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; Position cresult = x_bullet->getTargetPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jint JNICALL Java_bwapi4_Bullet_getRemoveTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; return x_bullet->getRemoveTimer(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Bullet_isVisible_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Bullet* x_bullet = (Bullet*)pointer; +Bullet x_bullet = (Bullet)pointer; return x_bullet->isVisible(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Bullet_isVisible_1native__JLbwapi4_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Bullet* x_bullet = (Bullet*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Bullet x_bullet = (Bullet)pointer; +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); return x_bullet->isVisible(player); } JNIEXPORT jboolean JNICALL Java_bwapi4_Client_isConnected_1native(JNIEnv * env, jobject obj, jlong pointer){ @@ -240,7 +253,7 @@ Event* x_evt = (Event*)pointer; Position cresult = x_evt->getPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jstring JNICALL Java_bwapi4_Event_getText_1native(JNIEnv * env, jobject obj, jlong pointer){ @@ -266,96 +279,192 @@ Event* x_evt = (Event*)pointer; return x_evt->isWinner(); } JNIEXPORT jint JNICALL Java_bwapi4_Force_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Force* x_force = (Force*)pointer; +Force x_force = (Force)pointer; return x_force->getID(); } JNIEXPORT jstring JNICALL Java_bwapi4_Force_getName_1native(JNIEnv * env, jobject obj, jlong pointer){ -Force* x_force = (Force*)pointer; +Force x_force = (Force)pointer; return env->NewStringUTF(x_force->getName().c_str()); } JNIEXPORT jobject JNICALL Java_bwapi4_Force_getPlayers_1native(JNIEnv * env, jobject obj, jlong pointer){ -Force* x_force = (Force*)pointer; -jlong resptr = (jlong)x_force->getPlayers(); -jclass retcls = FindCachedClass(env, "bwapi4/Playerset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Playerset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Force x_force = (Force)pointer; +Playerset cresult = x_force->getPlayers(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Player"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Player;"); +for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Player elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Forceset_getPlayers_1native(JNIEnv * env, jobject obj, jlong pointer){ Forceset* x_forceset = (Forceset*)pointer; -jlong resptr = (jlong)x_forceset->getPlayers(); -jclass retcls = FindCachedClass(env, "bwapi4/Playerset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Playerset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Playerset cresult = x_forceset->getPlayers(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Player"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Player;"); +for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Player elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getForces_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getForces(); -jclass retcls = FindCachedClass(env, "bwapi4/Forceset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Forceset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Forceset cresult = x_game->getForces(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Force"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Force;"); +for(Forceset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Force elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getPlayers_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getPlayers(); -jclass retcls = FindCachedClass(env, "bwapi4/Playerset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Playerset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Playerset cresult = x_game->getPlayers(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Player"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Player;"); +for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Player elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getAllUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getAllUnits(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_game->getAllUnits(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getMinerals(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_game->getMinerals(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getGeysers_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getGeysers(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_game->getGeysers(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getNeutralUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getNeutralUnits(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_game->getNeutralUnits(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getStaticMinerals(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_game->getStaticMinerals(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticGeysers_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getStaticGeysers(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_game->getStaticGeysers(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticNeutralUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getStaticNeutralUnits(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_game->getStaticNeutralUnits(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getBullets_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getBullets(); -jclass retcls = FindCachedClass(env, "bwapi4/Bulletset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Bulletset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Bulletset cresult = x_game->getBullets(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Bullet"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Bullet;"); +for(Bulletset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Bullet elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getForce_1native(JNIEnv * env, jobject obj, jlong pointer, jint forceID){ Game* x_game = (Game*)pointer; @@ -424,7 +533,7 @@ Game* x_game = (Game*)pointer; Position cresult = x_game->getMousePosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_getMouseState_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_button){ @@ -442,7 +551,7 @@ Game* x_game = (Game*)pointer; Position cresult = x_game->getScreenPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT void JNICALL Java_bwapi4_Game_setScreenPosition_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y){ @@ -473,60 +582,108 @@ x_game->enableFlag(flag); } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JIILbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY, jobject p_pred){ Game* x_game = (Game*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_game->getUnitsOnTile(tileX, tileY, pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_game->getUnitsOnTile(tileX, tileY, pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JLbwapi4_TilePosition_2Lbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tile, jobject p_pred){ Game* x_game = (Game*)pointer; TilePosition tile((int)env->GetIntField(p_tile, FindCachedField(env, env->GetObjectClass(p_tile), "x", "I")), (int)env->GetIntField(p_tile, FindCachedField(env, env->GetObjectClass(p_tile), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_game->getUnitsOnTile(tile, pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_game->getUnitsOnTile(tile, pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JIIIILbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jint left, jint top, jint right, jint bottom, jobject p_pred){ Game* x_game = (Game*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_game->getUnitsInRectangle(left, top, right, bottom, pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_game->getUnitsInRectangle(left, top, right, bottom, pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JLbwapi4_Position_2Lbwapi4_Position_2Lbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_topLeft, jobject p_bottomRight, jobject p_pred){ Game* x_game = (Game*)pointer; Position topLeft((int)env->GetIntField(p_topLeft, FindCachedField(env, env->GetObjectClass(p_topLeft), "x", "I")), (int)env->GetIntField(p_topLeft, FindCachedField(env, env->GetObjectClass(p_topLeft), "y", "I"))); Position bottomRight((int)env->GetIntField(p_bottomRight, FindCachedField(env, env->GetObjectClass(p_bottomRight), "x", "I")), (int)env->GetIntField(p_bottomRight, FindCachedField(env, env->GetObjectClass(p_bottomRight), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_game->getUnitsInRectangle(topLeft, bottomRight, pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_game->getUnitsInRectangle(topLeft, bottomRight, pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRadius_1native__JIIILbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jint radius, jobject p_pred){ Game* x_game = (Game*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_game->getUnitsInRadius(x, y, radius, pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_game->getUnitsInRadius(x, y, radius, pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRadius_1native__JLbwapi4_Position_2ILbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_center, jint radius, jobject p_pred){ Game* x_game = (Game*)pointer; Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_game->getUnitsInRadius(center, radius, pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_game->getUnitsInRadius(center, radius, pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getClosestUnit_1native__JLbwapi4_Position_2Lbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_center, jobject p_pred){ Game* x_game = (Game*)pointer; Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_game->getClosestUnit(center, pred); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -535,7 +692,7 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); JNIEXPORT jobject JNICALL Java_bwapi4_Game_getClosestUnit_1native__JLbwapi4_Position_2Lbwapi4_UnitFilter_2I(JNIEnv * env, jobject obj, jlong pointer, jobject p_center, jobject p_pred, jint radius){ Game* x_game = (Game*)pointer; Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_game->getClosestUnit(center, pred, radius); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -544,7 +701,7 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); JNIEXPORT jobject JNICALL Java_bwapi4_Game_getClosestUnitInRectangle_1native__JLbwapi4_Position_2Lbwapi4_UnitFilter_2III(JNIEnv * env, jobject obj, jlong pointer, jobject p_center, jobject p_pred, jint left, jint top, jint right){ Game* x_game = (Game*)pointer; Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_game->getClosestUnitInRectangle(center, pred, left, top, right); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -553,7 +710,7 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); JNIEXPORT jobject JNICALL Java_bwapi4_Game_getClosestUnitInRectangle_1native__JLbwapi4_Position_2Lbwapi4_UnitFilter_2II(JNIEnv * env, jobject obj, jlong pointer, jobject p_center, jobject p_pred, jint left, jint top){ Game* x_game = (Game*)pointer; Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_game->getClosestUnitInRectangle(center, pred, left, top); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -562,7 +719,7 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); JNIEXPORT jobject JNICALL Java_bwapi4_Game_getClosestUnitInRectangle_1native__JLbwapi4_Position_2Lbwapi4_UnitFilter_2I(JNIEnv * env, jobject obj, jlong pointer, jobject p_center, jobject p_pred, jint left){ Game* x_game = (Game*)pointer; Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_game->getClosestUnitInRectangle(center, pred, left); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -571,7 +728,7 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); JNIEXPORT jobject JNICALL Java_bwapi4_Game_getClosestUnitInRectangle_1native__JLbwapi4_Position_2Lbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_center, jobject p_pred){ Game* x_game = (Game*)pointer; Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_game->getClosestUnitInRectangle(center, pred); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -580,7 +737,7 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); JNIEXPORT jobject JNICALL Java_bwapi4_Game_getClosestUnitInRectangle_1native__JLbwapi4_Position_2Lbwapi4_UnitFilter_2IIII(JNIEnv * env, jobject obj, jlong pointer, jobject p_center, jobject p_pred, jint left, jint top, jint right, jint bottom){ Game* x_game = (Game*)pointer; Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_game->getClosestUnitInRectangle(center, pred, left, top, right, bottom); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -588,8 +745,8 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getBestUnit_1native__JLbwapi4_BestUnitFilter_2Lbwapi4_UnitFilter_2Lbwapi4_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_best, jobject p_pred, jobject p_center){ Game* x_game = (Game*)pointer; -BestUnitFilter* best = (BestUnitFilter*)env->GetLongField(p_best, FindCachedField(env, env->GetObjectClass(p_best), "pointer", "J")); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +BestUnitFilter best = (BestUnitFilter)env->GetLongField(p_best, FindCachedField(env, env->GetObjectClass(p_best), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); jlong resptr = (jlong)x_game->getBestUnit(best, pred, center); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); @@ -598,8 +755,8 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getBestUnit_1native__JLbwapi4_BestUnitFilter_2Lbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_best, jobject p_pred){ Game* x_game = (Game*)pointer; -BestUnitFilter* best = (BestUnitFilter*)env->GetLongField(p_best, FindCachedField(env, env->GetObjectClass(p_best), "pointer", "J")); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +BestUnitFilter best = (BestUnitFilter)env->GetLongField(p_best, FindCachedField(env, env->GetObjectClass(p_best), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_game->getBestUnit(best, pred); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -607,8 +764,8 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getBestUnit_1native__JLbwapi4_BestUnitFilter_2Lbwapi4_UnitFilter_2Lbwapi4_Position_2I(JNIEnv * env, jobject obj, jlong pointer, jobject p_best, jobject p_pred, jobject p_center, jint radius){ Game* x_game = (Game*)pointer; -BestUnitFilter* best = (BestUnitFilter*)env->GetLongField(p_best, FindCachedField(env, env->GetObjectClass(p_best), "pointer", "J")); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +BestUnitFilter best = (BestUnitFilter)env->GetLongField(p_best, FindCachedField(env, env->GetObjectClass(p_best), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); Position center((int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "x", "I")), (int)env->GetIntField(p_center, FindCachedField(env, env->GetObjectClass(p_center), "y", "I"))); jlong resptr = (jlong)x_game->getBestUnit(best, pred, center, radius); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); @@ -628,8 +785,8 @@ return x_game->setLastError(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_setLastError_1native__JLbwapi4_Error_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_e){ Game* x_game = (Game*)pointer; -Error* e = (Error*)env->GetLongField(p_e, FindCachedField(env, env->GetObjectClass(p_e), "pointer", "J")); -return x_game->setLastError(*e); +Error e = (Error)env->GetLongField(p_e, FindCachedField(env, env->GetObjectClass(p_e), "pointer", "J")); +return x_game->setLastError(e); } JNIEXPORT jint JNICALL Java_bwapi4_Game_mapWidth_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; @@ -661,7 +818,7 @@ return x_game->isWalkable(walkX, walkY); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_isWalkable_1native__JLbwapi4_WalkPosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ Game* x_game = (Game*)pointer; -WalkPosition* position = (WalkPosition*)env->GetLongField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "pointer", "J")); +WalkPosition position = (WalkPosition)env->GetLongField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "pointer", "J")); return x_game->isWalkable(position); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_isBuildable_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY){ @@ -715,8 +872,8 @@ return x_game->hasPowerPrecise(x, y); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPowerPrecise_1native__JIILbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jobject p_unitType){ Game* x_game = (Game*)pointer; -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPowerPrecise(x, y, *unitType); +UnitType unitType = (UnitType)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); +return x_game->hasPowerPrecise(x, y, unitType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPowerPrecise_1native__JLbwapi4_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ Game* x_game = (Game*)pointer; @@ -726,8 +883,8 @@ return x_game->hasPowerPrecise(position); JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPowerPrecise_1native__JLbwapi4_Position_2Lbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_unitType){ Game* x_game = (Game*)pointer; Position position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPowerPrecise(position, *unitType); +UnitType unitType = (UnitType)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); +return x_game->hasPowerPrecise(position, unitType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPower_1native__JII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY){ Game* x_game = (Game*)pointer; @@ -735,8 +892,8 @@ return x_game->hasPower(tileX, tileY); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPower_1native__JIILbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY, jobject p_unitType){ Game* x_game = (Game*)pointer; -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPower(tileX, tileY, *unitType); +UnitType unitType = (UnitType)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); +return x_game->hasPower(tileX, tileY, unitType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPower_1native__JLbwapi4_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position){ Game* x_game = (Game*)pointer; @@ -746,8 +903,8 @@ return x_game->hasPower(position); JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPower_1native__JLbwapi4_TilePosition_2Lbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_unitType){ Game* x_game = (Game*)pointer; TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPower(position, *unitType); +UnitType unitType = (UnitType)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); +return x_game->hasPower(position, unitType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPower_1native__JIIII(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY, jint tileWidth, jint tileHeight){ Game* x_game = (Game*)pointer; @@ -755,8 +912,8 @@ return x_game->hasPower(tileX, tileY, tileWidth, tileHeight); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPower_1native__JIIIILbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jint tileX, jint tileY, jint tileWidth, jint tileHeight, jobject p_unitType){ Game* x_game = (Game*)pointer; -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPower(tileX, tileY, tileWidth, tileHeight, *unitType); +UnitType unitType = (UnitType)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); +return x_game->hasPower(tileX, tileY, tileWidth, tileHeight, unitType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPower_1native__JLbwapi4_TilePosition_2II(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jint tileWidth, jint tileHeight){ Game* x_game = (Game*)pointer; @@ -766,87 +923,99 @@ return x_game->hasPower(position, tileWidth, tileHeight); JNIEXPORT jboolean JNICALL Java_bwapi4_Game_hasPower_1native__JLbwapi4_TilePosition_2IILbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jint tileWidth, jint tileHeight, jobject p_unitType){ Game* x_game = (Game*)pointer; TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* unitType = (UnitType*)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); -return x_game->hasPower(position, tileWidth, tileHeight, *unitType); +UnitType unitType = (UnitType)env->GetLongField(p_unitType, FindCachedField(env, env->GetObjectClass(p_unitType), "pointer", "J")); +return x_game->hasPower(position, tileWidth, tileHeight, unitType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canBuildHere_1native__JLbwapi4_TilePosition_2Lbwapi4_UnitType_2Lbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_type, jobject p_builder){ Game* x_game = (Game*)pointer; TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit* builder = (Unit*)env->GetLongField(p_builder, FindCachedField(env, env->GetObjectClass(p_builder), "pointer", "J")); -return x_game->canBuildHere(position, *type, builder); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +Unit builder = (Unit)env->GetLongField(p_builder, FindCachedField(env, env->GetObjectClass(p_builder), "pointer", "J")); +return x_game->canBuildHere(position, type, builder); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canBuildHere_1native__JLbwapi4_TilePosition_2Lbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_type){ Game* x_game = (Game*)pointer; TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_game->canBuildHere(position, *type); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_game->canBuildHere(position, type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canBuildHere_1native__JLbwapi4_TilePosition_2Lbwapi4_UnitType_2Lbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_position, jobject p_type, jobject p_builder, jboolean checkExplored){ Game* x_game = (Game*)pointer; TilePosition position((int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "x", "I")), (int)env->GetIntField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "y", "I"))); -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit* builder = (Unit*)env->GetLongField(p_builder, FindCachedField(env, env->GetObjectClass(p_builder), "pointer", "J")); -return x_game->canBuildHere(position, *type, builder, (bool)checkExplored); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +Unit builder = (Unit)env->GetLongField(p_builder, FindCachedField(env, env->GetObjectClass(p_builder), "pointer", "J")); +return x_game->canBuildHere(position, type, builder, (bool)checkExplored); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canMake_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_game->canMake(*type); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_game->canMake(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canMake_1native__JLbwapi4_UnitType_2Lbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_builder){ Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit* builder = (Unit*)env->GetLongField(p_builder, FindCachedField(env, env->GetObjectClass(p_builder), "pointer", "J")); -return x_game->canMake(*type, builder); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +Unit builder = (Unit)env->GetLongField(p_builder, FindCachedField(env, env->GetObjectClass(p_builder), "pointer", "J")); +return x_game->canMake(type, builder); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canResearch_1native__JLbwapi4_TechType_2Lbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_unit){ Game* x_game = (Game*)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_game->canResearch(*type, unit); +TechType type = (TechType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_game->canResearch(type, unit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canResearch_1native__JLbwapi4_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ Game* x_game = (Game*)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_game->canResearch(*type); +TechType type = (TechType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_game->canResearch(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canResearch_1native__JLbwapi4_TechType_2Lbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_unit, jboolean checkCanIssueCommandType){ Game* x_game = (Game*)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_game->canResearch(*type, unit, (bool)checkCanIssueCommandType); +TechType type = (TechType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_game->canResearch(type, unit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canUpgrade_1native__JLbwapi4_UpgradeType_2Lbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_unit){ Game* x_game = (Game*)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_game->canUpgrade(*type, unit); +UpgradeType type = (UpgradeType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_game->canUpgrade(type, unit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canUpgrade_1native__JLbwapi4_UpgradeType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ Game* x_game = (Game*)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_game->canUpgrade(*type); +UpgradeType type = (UpgradeType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_game->canUpgrade(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canUpgrade_1native__JLbwapi4_UpgradeType_2Lbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_unit, jboolean checkCanIssueCommandType){ Game* x_game = (Game*)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -Unit* unit = (Unit*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_game->canUpgrade(*type, unit, (bool)checkCanIssueCommandType); +UpgradeType type = (UpgradeType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +Unit unit = (Unit)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_game->canUpgrade(type, unit, (bool)checkCanIssueCommandType); +} +JNIEXPORT void JNICALL Java_bwapi4_Game_printf_1native(JNIEnv * env, jobject obj, jlong pointer, jstring cstr_format){ +Game* x_game = (Game*)pointer; +x_game->printf(std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); } JNIEXPORT void JNICALL Java_bwapi4_Game_vPrintf_1native(JNIEnv * env, jobject obj, jlong pointer, jstring cstr_format, jobject p_...){ Game* x_game = (Game*)pointer; -Object* ... = (Object*)env->GetLongField(p_..., FindCachedField(env, env->GetObjectClass(p_...), "pointer", "J")); +Object ... = (Object)env->GetLongField(p_..., FindCachedField(env, env->GetObjectClass(p_...), "pointer", "J")); x_game->vPrintf(std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str(), ...); } +JNIEXPORT void JNICALL Java_bwapi4_Game_sendText_1native(JNIEnv * env, jobject obj, jlong pointer, jstring cstr_format){ +Game* x_game = (Game*)pointer; +x_game->sendText(std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); +} JNIEXPORT void JNICALL Java_bwapi4_Game_vSendText_1native(JNIEnv * env, jobject obj, jlong pointer, jstring cstr_format, jobject p_...){ Game* x_game = (Game*)pointer; -Object* ... = (Object*)env->GetLongField(p_..., FindCachedField(env, env->GetObjectClass(p_...), "pointer", "J")); +Object ... = (Object)env->GetLongField(p_..., FindCachedField(env, env->GetObjectClass(p_...), "pointer", "J")); x_game->vSendText(std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str(), ...); } +JNIEXPORT void JNICALL Java_bwapi4_Game_sendTextEx_1native(JNIEnv * env, jobject obj, jlong pointer, jboolean toAllies, jstring cstr_format){ +Game* x_game = (Game*)pointer; +x_game->sendTextEx((bool)toAllies, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); +} JNIEXPORT void JNICALL Java_bwapi4_Game_vSendTextEx_1native(JNIEnv * env, jobject obj, jlong pointer, jboolean toAllies, jstring cstr_format, jobject p_...){ Game* x_game = (Game*)pointer; -Object* ... = (Object*)env->GetLongField(p_..., FindCachedField(env, env->GetObjectClass(p_...), "pointer", "J")); +Object ... = (Object)env->GetLongField(p_..., FindCachedField(env, env->GetObjectClass(p_...), "pointer", "J")); x_game->vSendTextEx((bool)toAllies, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str(), ...); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_isInGame_1native(JNIEnv * env, jobject obj, jlong pointer){ @@ -891,16 +1060,32 @@ x_game->setLocalSpeed(speed); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_issueCommand_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_units, jobject p_command){ Game* x_game = (Game*)pointer; -Unitset* units = (Unitset*)env->GetLongField(p_units, FindCachedField(env, env->GetObjectClass(p_units), "pointer", "J")); -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_game->issueCommand(units, *command); +std::set units; +jclass colClass = env->GetObjectClass(p_units); +jmethodID sizeMethodId = FindCachedMethod(env, colClass, "size", "()I"); +jmethodID getMethodId = FindCachedMethod(env, colClass, "get", "(I)Ljava/lang/Object;"); +int size = (int)env->CallIntMethod(p_units, sizeMethodId); +for( int i = 0; i < size; i++ ) { +jobject jobj = env->CallObjectMethod(p_units,getMethodId); +units.insert((Unit)env->GetLongField(jobj, FindCachedField(env, env->GetObjectClass(jobj), "pointer", "J"))); +} +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_game->issueCommand(units, command); } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getSelectedUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->getSelectedUnits(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_game->getSelectedUnits(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_self_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; @@ -925,24 +1110,48 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Game_allies_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->allies(); -jclass retcls = FindCachedClass(env, "bwapi4/Playerset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Playerset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Playerset cresult = x_game->allies(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Player"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Player;"); +for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Player elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_enemies_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->enemies(); -jclass retcls = FindCachedClass(env, "bwapi4/Playerset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Playerset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Playerset cresult = x_game->enemies(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Player"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Player;"); +for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Player elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_observers_1native(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; -jlong resptr = (jlong)x_game->observers(); -jclass retcls = FindCachedClass(env, "bwapi4/Playerset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Playerset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Playerset cresult = x_game->observers(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Player"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Player;"); +for(Playerset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Player elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT void JNICALL Java_bwapi4_Game_setTextSize_1native__J(JNIEnv * env, jobject obj, jlong pointer){ Game* x_game = (Game*)pointer; @@ -950,24 +1159,56 @@ x_game->setTextSize(); } JNIEXPORT void JNICALL Java_bwapi4_Game_setTextSize_1native__JLbwapi4_Text_Size_Enum_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_size){ Game* x_game = (Game*)pointer; -bwapi4.Text.Size.Enum* size = (bwapi4.Text.Size.Enum*)env->GetLongField(p_size, FindCachedField(env, env->GetObjectClass(p_size), "pointer", "J")); +bwapi4.Text.Size.Enum size = (bwapi4.Text.Size.Enum)env->GetLongField(p_size, FindCachedField(env, env->GetObjectClass(p_size), "pointer", "J")); x_game->setTextSize(size); } JNIEXPORT void JNICALL Java_bwapi4_Game_vDrawText_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jstring cstr_format, jobject p_...){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); -Object* ... = (Object*)env->GetLongField(p_..., FindCachedField(env, env->GetObjectClass(p_...), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +Object ... = (Object)env->GetLongField(p_..., FindCachedField(env, env->GetObjectClass(p_...), "pointer", "J")); x_game->vDrawText(ctype, x, y, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str(), ...); } +JNIEXPORT void JNICALL Java_bwapi4_Game_drawText_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jstring cstr_format){ +Game* x_game = (Game*)pointer; +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +x_game->drawText(ctype, x, y, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); +} +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMap_1native__JIILjava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jstring cstr_format){ +Game* x_game = (Game*)pointer; +x_game->drawTextMap(x, y, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); +} +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMap_1native__JLbwapi4_Position_2Ljava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jstring cstr_format){ +Game* x_game = (Game*)pointer; +Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); +x_game->drawTextMap(p, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); +} +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMouse_1native__JIILjava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jstring cstr_format){ +Game* x_game = (Game*)pointer; +x_game->drawTextMouse(x, y, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); +} +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMouse_1native__JLbwapi4_Position_2Ljava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jstring cstr_format){ +Game* x_game = (Game*)pointer; +Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); +x_game->drawTextMouse(p, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); +} +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextScreen_1native__JIILjava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jint x, jint y, jstring cstr_format){ +Game* x_game = (Game*)pointer; +x_game->drawTextScreen(x, y, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); +} +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextScreen_1native__JLbwapi4_Position_2Ljava_lang_String_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_p, jstring cstr_format){ +Game* x_game = (Game*)pointer; +Position p((int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "x", "I")), (int)env->GetIntField(p_p, FindCachedField(env, env->GetObjectClass(p_p), "y", "I"))); +x_game->drawTextScreen(p, std::string(env->GetStringUTFChars(cstr_format, NULL)).c_str()); +} JNIEXPORT void JNICALL Java_bwapi4_Game_drawBox_1native__JLbwapi4_CoordinateType_Enum_2IIIILbwapi4_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint left, jint top, jint right, jint bottom, jobject p_color){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawBox(ctype, left, top, right, bottom, color); } JNIEXPORT void JNICALL Java_bwapi4_Game_drawBox_1native__JLbwapi4_CoordinateType_Enum_2IIIILbwapi4_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint left, jint top, jint right, jint bottom, jobject p_color, jboolean isSolid){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawBox(ctype, left, top, right, bottom, color, (bool)isSolid); } @@ -1045,13 +1286,13 @@ x_game->drawBoxScreen(leftTop, rightBottom, color, (bool)isSolid); } JNIEXPORT void JNICALL Java_bwapi4_Game_drawTriangle_1native__JLbwapi4_CoordinateType_Enum_2IIIIIILbwapi4_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawTriangle(ctype, ax, ay, bx, by, cx, cy, color); } JNIEXPORT void JNICALL Java_bwapi4_Game_drawTriangle_1native__JLbwapi4_CoordinateType_Enum_2IIIIIILbwapi4_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint ax, jint ay, jint bx, jint by, jint cx, jint cy, jobject p_color, jboolean isSolid){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawTriangle(ctype, ax, ay, bx, by, cx, cy, color, (bool)isSolid); } @@ -1135,13 +1376,13 @@ x_game->drawTriangleScreen(a, b, c, color, (bool)isSolid); } JNIEXPORT void JNICALL Java_bwapi4_Game_drawCircle_1native__JLbwapi4_CoordinateType_Enum_2IIILbwapi4_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jint radius, jobject p_color){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawCircle(ctype, x, y, radius, color); } JNIEXPORT void JNICALL Java_bwapi4_Game_drawCircle_1native__JLbwapi4_CoordinateType_Enum_2IIILbwapi4_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jint radius, jobject p_color, jboolean isSolid){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawCircle(ctype, x, y, radius, color, (bool)isSolid); } @@ -1213,13 +1454,13 @@ x_game->drawCircleScreen(p, radius, color, (bool)isSolid); } JNIEXPORT void JNICALL Java_bwapi4_Game_drawEllipse_1native__JLbwapi4_CoordinateType_Enum_2IIIILbwapi4_Color_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jint xrad, jint yrad, jobject p_color){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawEllipse(ctype, x, y, xrad, yrad, color); } JNIEXPORT void JNICALL Java_bwapi4_Game_drawEllipse_1native__JLbwapi4_CoordinateType_Enum_2IIIILbwapi4_Color_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jint xrad, jint yrad, jobject p_color, jboolean isSolid){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawEllipse(ctype, x, y, xrad, yrad, color, (bool)isSolid); } @@ -1291,7 +1532,7 @@ x_game->drawEllipseScreen(p, xrad, yrad, color, (bool)isSolid); } JNIEXPORT void JNICALL Java_bwapi4_Game_drawDot_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x, jint y, jobject p_color){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawDot(ctype, x, y, color); } @@ -1330,7 +1571,7 @@ x_game->drawDotScreen(p, color); } JNIEXPORT void JNICALL Java_bwapi4_Game_drawLine_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_ctype, jint x1, jint y1, jint x2, jint y2, jobject p_color){ Game* x_game = (Game*)pointer; -bwapi4.CoordinateType.Enum* ctype = (bwapi4.CoordinateType.Enum*)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); +bwapi4.CoordinateType.Enum ctype = (bwapi4.CoordinateType.Enum)env->GetLongField(p_ctype, FindCachedField(env, env->GetObjectClass(p_ctype), "pointer", "J")); Color color((int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "r", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "g", "I")), (int)env->GetIntField(p_color, FindCachedField(env, env->GetObjectClass(p_color), "b", "I"))); x_game->drawLine(ctype, x1, y1, x2, y2, color); } @@ -1438,27 +1679,27 @@ return x_game->hasPath(source, destination); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_setAlliance_1native__JLbwapi4_Player_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_player, jboolean allied){ Game* x_game = (Game*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); return x_game->setAlliance(player, (bool)allied); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_setAlliance_1native__JLbwapi4_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ Game* x_game = (Game*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); return x_game->setAlliance(player); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_setAlliance_1native__JLbwapi4_Player_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_player, jboolean allied, jboolean alliedVictory){ Game* x_game = (Game*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); return x_game->setAlliance(player, (bool)allied, (bool)alliedVictory); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_setVision_1native__JLbwapi4_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ Game* x_game = (Game*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); return x_game->setVision(player); } JNIEXPORT jboolean JNICALL Java_bwapi4_Game_setVision_1native__JLbwapi4_Player_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_player, jboolean enabled){ Game* x_game = (Game*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); return x_game->setVision(player, (bool)enabled); } JNIEXPORT void JNICALL Java_bwapi4_Game_setCommandOptimizationLevel_1native(JNIEnv * env, jobject obj, jlong pointer, jint level){ @@ -1498,285 +1739,277 @@ return x_game->setRevealAll((bool)reveal); } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getBuildLocation_1native__JLbwapi4_UnitType_2Lbwapi4_TilePosition_2I(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_desiredPosition, jint maxRange){ Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); TilePosition desiredPosition((int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "x", "I")), (int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "y", "I"))); -TilePosition cresult = x_game->getBuildLocation(*type, desiredPosition, maxRange); +TilePosition cresult = x_game->getBuildLocation(type, desiredPosition, maxRange); jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getBuildLocation_1native__JLbwapi4_UnitType_2Lbwapi4_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_desiredPosition){ Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); TilePosition desiredPosition((int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "x", "I")), (int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "y", "I"))); -TilePosition cresult = x_game->getBuildLocation(*type, desiredPosition); +TilePosition cresult = x_game->getBuildLocation(type, desiredPosition); jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Game_getBuildLocation_1native__JLbwapi4_UnitType_2Lbwapi4_TilePosition_2IZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_desiredPosition, jint maxRange, jboolean creep){ Game* x_game = (Game*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); TilePosition desiredPosition((int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "x", "I")), (int)env->GetIntField(p_desiredPosition, FindCachedField(env, env->GetObjectClass(p_desiredPosition), "y", "I"))); -TilePosition cresult = x_game->getBuildLocation(*type, desiredPosition, maxRange, (bool)creep); +TilePosition cresult = x_game->getBuildLocation(type, desiredPosition, maxRange, (bool)creep); jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jint JNICALL Java_bwapi4_Game_getDamageFrom_1native__JLbwapi4_UnitType_2Lbwapi4_UnitType_2Lbwapi4_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_fromType, jobject p_toType, jobject p_fromPlayer){ Game* x_game = (Game*)pointer; -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -Player* fromPlayer = (Player*)env->GetLongField(p_fromPlayer, FindCachedField(env, env->GetObjectClass(p_fromPlayer), "pointer", "J")); -return x_game->getDamageFrom(*fromType, *toType, fromPlayer); +UnitType fromType = (UnitType)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); +UnitType toType = (UnitType)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); +Player fromPlayer = (Player)env->GetLongField(p_fromPlayer, FindCachedField(env, env->GetObjectClass(p_fromPlayer), "pointer", "J")); +return x_game->getDamageFrom(fromType, toType, fromPlayer); } JNIEXPORT jint JNICALL Java_bwapi4_Game_getDamageFrom_1native__JLbwapi4_UnitType_2Lbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_fromType, jobject p_toType){ Game* x_game = (Game*)pointer; -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -return x_game->getDamageFrom(*fromType, *toType); +UnitType fromType = (UnitType)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); +UnitType toType = (UnitType)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); +return x_game->getDamageFrom(fromType, toType); } JNIEXPORT jint JNICALL Java_bwapi4_Game_getDamageFrom_1native__JLbwapi4_UnitType_2Lbwapi4_UnitType_2Lbwapi4_Player_2Lbwapi4_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_fromType, jobject p_toType, jobject p_fromPlayer, jobject p_toPlayer){ Game* x_game = (Game*)pointer; -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -Player* fromPlayer = (Player*)env->GetLongField(p_fromPlayer, FindCachedField(env, env->GetObjectClass(p_fromPlayer), "pointer", "J")); -Player* toPlayer = (Player*)env->GetLongField(p_toPlayer, FindCachedField(env, env->GetObjectClass(p_toPlayer), "pointer", "J")); -return x_game->getDamageFrom(*fromType, *toType, fromPlayer, toPlayer); +UnitType fromType = (UnitType)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); +UnitType toType = (UnitType)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); +Player fromPlayer = (Player)env->GetLongField(p_fromPlayer, FindCachedField(env, env->GetObjectClass(p_fromPlayer), "pointer", "J")); +Player toPlayer = (Player)env->GetLongField(p_toPlayer, FindCachedField(env, env->GetObjectClass(p_toPlayer), "pointer", "J")); +return x_game->getDamageFrom(fromType, toType, fromPlayer, toPlayer); } JNIEXPORT jint JNICALL Java_bwapi4_Game_getDamageTo_1native__JLbwapi4_UnitType_2Lbwapi4_UnitType_2Lbwapi4_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_toType, jobject p_fromType, jobject p_toPlayer){ Game* x_game = (Game*)pointer; -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -Player* toPlayer = (Player*)env->GetLongField(p_toPlayer, FindCachedField(env, env->GetObjectClass(p_toPlayer), "pointer", "J")); -return x_game->getDamageTo(*toType, *fromType, toPlayer); +UnitType toType = (UnitType)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); +UnitType fromType = (UnitType)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); +Player toPlayer = (Player)env->GetLongField(p_toPlayer, FindCachedField(env, env->GetObjectClass(p_toPlayer), "pointer", "J")); +return x_game->getDamageTo(toType, fromType, toPlayer); } JNIEXPORT jint JNICALL Java_bwapi4_Game_getDamageTo_1native__JLbwapi4_UnitType_2Lbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_toType, jobject p_fromType){ Game* x_game = (Game*)pointer; -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -return x_game->getDamageTo(*toType, *fromType); +UnitType toType = (UnitType)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); +UnitType fromType = (UnitType)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); +return x_game->getDamageTo(toType, fromType); } JNIEXPORT jint JNICALL Java_bwapi4_Game_getDamageTo_1native__JLbwapi4_UnitType_2Lbwapi4_UnitType_2Lbwapi4_Player_2Lbwapi4_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_toType, jobject p_fromType, jobject p_toPlayer, jobject p_fromPlayer){ Game* x_game = (Game*)pointer; -UnitType* toType = (UnitType*)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); -UnitType* fromType = (UnitType*)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); -Player* toPlayer = (Player*)env->GetLongField(p_toPlayer, FindCachedField(env, env->GetObjectClass(p_toPlayer), "pointer", "J")); -Player* fromPlayer = (Player*)env->GetLongField(p_fromPlayer, FindCachedField(env, env->GetObjectClass(p_fromPlayer), "pointer", "J")); -return x_game->getDamageTo(*toType, *fromType, toPlayer, fromPlayer); +UnitType toType = (UnitType)env->GetLongField(p_toType, FindCachedField(env, env->GetObjectClass(p_toType), "pointer", "J")); +UnitType fromType = (UnitType)env->GetLongField(p_fromType, FindCachedField(env, env->GetObjectClass(p_fromType), "pointer", "J")); +Player toPlayer = (Player)env->GetLongField(p_toPlayer, FindCachedField(env, env->GetObjectClass(p_toPlayer), "pointer", "J")); +Player fromPlayer = (Player)env->GetLongField(p_fromPlayer, FindCachedField(env, env->GetObjectClass(p_fromPlayer), "pointer", "J")); +return x_game->getDamageTo(toType, fromType, toPlayer, fromPlayer); } JNIEXPORT void JNICALL Java_bwapi4_GameWrapper_flush_1native(JNIEnv * env, jobject obj, jlong pointer){ -GameWrapper* x_gameWrapper = (GameWrapper*)pointer; +GameWrapper x_gameWrapper = (GameWrapper)pointer; x_gameWrapper->flush(); } -JNIEXPORT jboolean JNICALL Java_bwapi4_InterfaceEvent_isFinished_1native(JNIEnv * env, jobject obj, jlong pointer){ -InterfaceEvent* x_interfaceEvent = (InterfaceEvent*)pointer; -return x_interfaceEvent->isFinished(); -} -JNIEXPORT void JNICALL Java_bwapi4_InterfaceEvent_removeEvent_1native(JNIEnv * env, jobject obj, jlong pointer){ -InterfaceEvent* x_interfaceEvent = (InterfaceEvent*)pointer; -x_interfaceEvent->removeEvent(); -} JNIEXPORT jint JNICALL Java_bwapi4_Player_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->getID(); } JNIEXPORT jstring JNICALL Java_bwapi4_Player_getName_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return env->NewStringUTF(x_player->getName().c_str()); } JNIEXPORT jobject JNICALL Java_bwapi4_Player_getRace_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; jlong resptr = (jlong)tableRace.find(x_player->getRace())->second; jclass retcls = FindCachedClass(env, "bwapi4/Race"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Race;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Player_getType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; jlong resptr = (jlong)x_player->getType(); jclass retcls = FindCachedClass(env, "bwapi4/PlayerType"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/PlayerType;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Player_getForce_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; jlong resptr = (jlong)x_player->getForce(); jclass retcls = FindCachedClass(env, "bwapi4/Force"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Force;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isAlly_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Player* x_player = (Player*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Player x_player = (Player)pointer; +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); return x_player->isAlly(player); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isEnemy_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Player* x_player = (Player*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Player x_player = (Player)pointer; +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); return x_player->isEnemy(player); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isNeutral_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->isNeutral(); } JNIEXPORT jobject JNICALL Java_bwapi4_Player_getStartLocation_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; TilePosition cresult = x_player->getStartLocation(); jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isVictorious_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->isVictorious(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isDefeated_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->isDefeated(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_leftGame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->leftGame(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_minerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->minerals(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_gas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->gas(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_gatheredMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->gatheredMinerals(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_gatheredGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->gatheredGas(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_repairedMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->repairedMinerals(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_repairedGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->repairedGas(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_refundedMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->refundedMinerals(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_refundedGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->refundedGas(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_spentMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->spentMinerals(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_spentGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->spentGas(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_supplyTotal_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->supplyTotal(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_supplyTotal_1native__JLbwapi4_Race_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_race){ -Player* x_player = (Player*)pointer; -Race* race = (Race*)env->GetLongField(p_race, FindCachedField(env, env->GetObjectClass(p_race), "pointer", "J")); -return x_player->supplyTotal(*race); +Player x_player = (Player)pointer; +Race race = (Race)env->GetLongField(p_race, FindCachedField(env, env->GetObjectClass(p_race), "pointer", "J")); +return x_player->supplyTotal(race); } JNIEXPORT jint JNICALL Java_bwapi4_Player_supplyUsed_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->supplyUsed(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_supplyUsed_1native__JLbwapi4_Race_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_race){ -Player* x_player = (Player*)pointer; -Race* race = (Race*)env->GetLongField(p_race, FindCachedField(env, env->GetObjectClass(p_race), "pointer", "J")); -return x_player->supplyUsed(*race); +Player x_player = (Player)pointer; +Race race = (Race)env->GetLongField(p_race, FindCachedField(env, env->GetObjectClass(p_race), "pointer", "J")); +return x_player->supplyUsed(race); } JNIEXPORT jint JNICALL Java_bwapi4_Player_allUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->allUnitCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_allUnitCount_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->allUnitCount(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->allUnitCount(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_visibleUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->visibleUnitCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_visibleUnitCount_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->visibleUnitCount(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->visibleUnitCount(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_completedUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->completedUnitCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_completedUnitCount_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->completedUnitCount(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->completedUnitCount(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_incompleteUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->incompleteUnitCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_incompleteUnitCount_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->incompleteUnitCount(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->incompleteUnitCount(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_deadUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->deadUnitCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_deadUnitCount_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->deadUnitCount(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->deadUnitCount(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_killedUnitCount_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->killedUnitCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_killedUnitCount_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->killedUnitCount(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->killedUnitCount(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_getUpgradeLevel_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_upgrade){ -Player* x_player = (Player*)pointer; -UpgradeType* upgrade = (UpgradeType*)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); -return x_player->getUpgradeLevel(*upgrade); +Player x_player = (Player)pointer; +UpgradeType upgrade = (UpgradeType)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); +return x_player->getUpgradeLevel(upgrade); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_hasResearched_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Player* x_player = (Player*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_player->hasResearched(*tech); +Player x_player = (Player)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_player->hasResearched(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isResearching_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Player* x_player = (Player*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_player->isResearching(*tech); +Player x_player = (Player)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_player->isResearching(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isUpgrading_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_upgrade){ -Player* x_player = (Player*)pointer; -UpgradeType* upgrade = (UpgradeType*)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); -return x_player->isUpgrading(*upgrade); +Player x_player = (Player)pointer; +UpgradeType upgrade = (UpgradeType)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); +return x_player->isUpgrading(upgrade); } JNIEXPORT jobject JNICALL Java_bwapi4_Player_getColor_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; Color cresult = x_player->getColor(); jclass retcls = FindCachedClass(env, "bwapi4/Color"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(III)V"); @@ -1784,89 +2017,97 @@ jobject result = env->NewObject(retcls, retConsID, cresult.red(), cresult.green( return result; } JNIEXPORT jchar JNICALL Java_bwapi4_Player_getTextColor_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->getTextColor(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_maxEnergy_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->maxEnergy(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->maxEnergy(unit); } JNIEXPORT jdouble JNICALL Java_bwapi4_Player_topSpeed_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->topSpeed(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->topSpeed(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_weaponMaxRange_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_weapon){ -Player* x_player = (Player*)pointer; -WeaponType* weapon = (WeaponType*)env->GetLongField(p_weapon, FindCachedField(env, env->GetObjectClass(p_weapon), "pointer", "J")); -return x_player->weaponMaxRange(*weapon); +Player x_player = (Player)pointer; +WeaponType weapon = (WeaponType)env->GetLongField(p_weapon, FindCachedField(env, env->GetObjectClass(p_weapon), "pointer", "J")); +return x_player->weaponMaxRange(weapon); } JNIEXPORT jint JNICALL Java_bwapi4_Player_sightRange_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->sightRange(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->sightRange(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_weaponDamageCooldown_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->weaponDamageCooldown(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->weaponDamageCooldown(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_armor_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->armor(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->armor(unit); } JNIEXPORT jint JNICALL Java_bwapi4_Player_damage_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_wpn){ -Player* x_player = (Player*)pointer; -WeaponType* wpn = (WeaponType*)env->GetLongField(p_wpn, FindCachedField(env, env->GetObjectClass(p_wpn), "pointer", "J")); -return x_player->damage(*wpn); +Player x_player = (Player)pointer; +WeaponType wpn = (WeaponType)env->GetLongField(p_wpn, FindCachedField(env, env->GetObjectClass(p_wpn), "pointer", "J")); +return x_player->damage(wpn); } JNIEXPORT jint JNICALL Java_bwapi4_Player_getUnitScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->getUnitScore(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_getKillScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->getKillScore(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_getBuildingScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->getBuildingScore(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_getRazingScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->getRazingScore(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_getCustomScore_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->getCustomScore(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isObserver_1native(JNIEnv * env, jobject obj, jlong pointer){ -Player* x_player = (Player*)pointer; +Player x_player = (Player)pointer; return x_player->isObserver(); } JNIEXPORT jint JNICALL Java_bwapi4_Player_getMaxUpgradeLevel_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_upgrade){ -Player* x_player = (Player*)pointer; -UpgradeType* upgrade = (UpgradeType*)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); -return x_player->getMaxUpgradeLevel(*upgrade); +Player x_player = (Player)pointer; +UpgradeType upgrade = (UpgradeType)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); +return x_player->getMaxUpgradeLevel(upgrade); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isResearchAvailable_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Player* x_player = (Player*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_player->isResearchAvailable(*tech); +Player x_player = (Player)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_player->isResearchAvailable(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Player_isUnitAvailable_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_unit){ -Player* x_player = (Player*)pointer; -UnitType* unit = (UnitType*)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); -return x_player->isUnitAvailable(*unit); +Player x_player = (Player)pointer; +UnitType unit = (UnitType)env->GetLongField(p_unit, FindCachedField(env, env->GetObjectClass(p_unit), "pointer", "J")); +return x_player->isUnitAvailable(unit); } JNIEXPORT jobject JNICALL Java_bwapi4_Playerset_getUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ Playerset* x_playerset = (Playerset*)pointer; -jlong resptr = (jlong)x_playerset->getUnits(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_playerset->getUnits(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT void JNICALL Java_bwapi4_Playerset_setAlliance_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean allies){ Playerset* x_playerset = (Playerset*)pointer; @@ -1881,11 +2122,11 @@ Playerset* x_playerset = (Playerset*)pointer; x_playerset->setAlliance((bool)allies, (bool)alliedVictory); } JNIEXPORT jboolean JNICALL Java_bwapi4_Point_isValid_1native(JNIEnv * env, jobject obj, jlong pointer){ -Point* x_point = (Point*)pointer; +Point x_point = (Point)pointer; return x_point->isValid(); } JNIEXPORT jdouble JNICALL Java_bwapi4_Point_getLength_1native(JNIEnv * env, jobject obj, jlong pointer){ -Point* x_point = (Point*)pointer; +Point x_point = (Point)pointer; return x_point->getLength(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Position_isValid(JNIEnv * env, jobject obj){ @@ -1897,7 +2138,7 @@ Position x_position((int)env->GetIntField(obj, FindCachedField(env, env->GetObje Position cresult = x_position.makeValid(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jdouble JNICALL Java_bwapi4_Position_getDistance(JNIEnv * env, jobject obj, jobject p_position){ @@ -1920,114 +2161,130 @@ Position position((int)env->GetIntField(p_position, FindCachedField(env, env->Ge return x_position.hasPath(position); } JNIEXPORT jboolean JNICALL Java_bwapi4_PositionOrUnit_isUnit_1native(JNIEnv * env, jobject obj, jlong pointer){ -PositionOrUnit* x_positionOrUnit = (PositionOrUnit*)pointer; +PositionOrUnit x_positionOrUnit = (PositionOrUnit)pointer; return x_positionOrUnit->isUnit(); } JNIEXPORT jobject JNICALL Java_bwapi4_PositionOrUnit_getUnit_1native(JNIEnv * env, jobject obj, jlong pointer){ -PositionOrUnit* x_positionOrUnit = (PositionOrUnit*)pointer; +PositionOrUnit x_positionOrUnit = (PositionOrUnit)pointer; jlong resptr = (jlong)x_positionOrUnit->getUnit(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jboolean JNICALL Java_bwapi4_PositionOrUnit_isPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -PositionOrUnit* x_positionOrUnit = (PositionOrUnit*)pointer; +PositionOrUnit x_positionOrUnit = (PositionOrUnit)pointer; return x_positionOrUnit->isPosition(); } JNIEXPORT jobject JNICALL Java_bwapi4_PositionOrUnit_getPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -PositionOrUnit* x_positionOrUnit = (PositionOrUnit*)pointer; +PositionOrUnit x_positionOrUnit = (PositionOrUnit)pointer; Position cresult = x_positionOrUnit->getPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jint JNICALL Java_bwapi4_Region_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; return x_region->getID(); } JNIEXPORT jint JNICALL Java_bwapi4_Region_getRegionGroupID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; return x_region->getRegionGroupID(); } JNIEXPORT jobject JNICALL Java_bwapi4_Region_getCenter_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; Position cresult = x_region->getCenter(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jboolean JNICALL Java_bwapi4_Region_isHigherGround_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; return x_region->isHigherGround(); } JNIEXPORT jint JNICALL Java_bwapi4_Region_getDefensePriority_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; return x_region->getDefensePriority(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Region_isAccessible_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; return x_region->isAccessible(); } JNIEXPORT jint JNICALL Java_bwapi4_Region_getBoundsLeft_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; return x_region->getBoundsLeft(); } JNIEXPORT jint JNICALL Java_bwapi4_Region_getBoundsTop_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; return x_region->getBoundsTop(); } JNIEXPORT jint JNICALL Java_bwapi4_Region_getBoundsRight_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; return x_region->getBoundsRight(); } JNIEXPORT jint JNICALL Java_bwapi4_Region_getBoundsBottom_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; return x_region->getBoundsBottom(); } JNIEXPORT jobject JNICALL Java_bwapi4_Region_getClosestAccessibleRegion_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; jlong resptr = (jlong)x_region->getClosestAccessibleRegion(); jclass retcls = FindCachedClass(env, "bwapi4/Region"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Region;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Region_getClosestInaccessibleRegion_1native(JNIEnv * env, jobject obj, jlong pointer){ -Region* x_region = (Region*)pointer; +Region x_region = (Region)pointer; jlong resptr = (jlong)x_region->getClosestInaccessibleRegion(); jclass retcls = FindCachedClass(env, "bwapi4/Region"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Region;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jint JNICALL Java_bwapi4_Region_getDistance_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_other){ -Region* x_region = (Region*)pointer; -Region* other = (Region*)env->GetLongField(p_other, FindCachedField(env, env->GetObjectClass(p_other), "pointer", "J")); +Region x_region = (Region)pointer; +Region other = (Region)env->GetLongField(p_other, FindCachedField(env, env->GetObjectClass(p_other), "pointer", "J")); return x_region->getDistance(other); } JNIEXPORT jobject JNICALL Java_bwapi4_Region_getUnits_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_pred){ -Region* x_region = (Region*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_region->getUnits(pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Region x_region = (Region)pointer; +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_region->getUnits(pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Regionset_getCenter_1native(JNIEnv * env, jobject obj, jlong pointer){ Regionset* x_regionset = (Regionset*)pointer; Position cresult = x_regionset->getCenter(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Regionset_getUnits_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_pred){ Regionset* x_regionset = (Regionset*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_regionset->getUnits(pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_regionset->getUnits(pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jboolean JNICALL Java_bwapi4_TilePosition_hasPath(JNIEnv * env, jobject obj, jobject p_position){ TilePosition x_tilePosition((int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "x", "I")), (int)env->GetIntField(obj, FindCachedField(env, env->GetObjectClass(obj), "y", "I"))); @@ -2043,7 +2300,7 @@ TilePosition x_tilePosition((int)env->GetIntField(obj, FindCachedField(env, env- TilePosition cresult = x_tilePosition.makeValid(); jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jdouble JNICALL Java_bwapi4_TilePosition_getDistance(JNIEnv * env, jobject obj, jobject p_position){ @@ -2056,2150 +2313,2190 @@ TilePosition x_tilePosition((int)env->GetIntField(obj, FindCachedField(env, env- return x_tilePosition.getLength(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getID(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_exists_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->exists(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getReplayID_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getReplayID(); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getPlayer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getPlayer(); jclass retcls = FindCachedClass(env, "bwapi4/Player"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Player;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)tableUnitType.find(x_unit->getType())->second; jclass retcls = FindCachedClass(env, "bwapi4/UnitType"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/UnitType;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position cresult = x_unit->getPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getTilePosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition cresult = x_unit->getTilePosition(); jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jdouble JNICALL Java_bwapi4_Unit_getAngle_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getAngle(); } JNIEXPORT jdouble JNICALL Java_bwapi4_Unit_getVelocityX_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getVelocityX(); } JNIEXPORT jdouble JNICALL Java_bwapi4_Unit_getVelocityY_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getVelocityY(); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getRegion_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getRegion(); jclass retcls = FindCachedClass(env, "bwapi4/Region"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Region;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getLeft_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getLeft(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getTop_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getTop(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getRight_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getRight(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getBottom_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getBottom(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getHitPoints_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getHitPoints(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getShields_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getShields(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getEnergy_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getEnergy(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getResources_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getResources(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getResourceGroup_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getResourceGroup(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getDistance_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->getDistance(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_hasPath_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->hasPath(target); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getLastCommandFrame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getLastCommandFrame(); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getLastAttackingPlayer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getLastAttackingPlayer(); jclass retcls = FindCachedClass(env, "bwapi4/Player"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Player;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getInitialType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)tableUnitType.find(x_unit->getInitialType())->second; jclass retcls = FindCachedClass(env, "bwapi4/UnitType"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/UnitType;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getInitialPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position cresult = x_unit->getInitialPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getInitialTilePosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition cresult = x_unit->getInitialTilePosition(); jclass retcls = FindCachedClass(env, "bwapi/TilePosition"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getInitialHitPoints_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getInitialHitPoints(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getInitialResources_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getInitialResources(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getKillCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getKillCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getAcidSporeCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getAcidSporeCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getInterceptorCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getInterceptorCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getScarabCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getScarabCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getSpiderMineCount_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getSpiderMineCount(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getGroundWeaponCooldown_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getGroundWeaponCooldown(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getAirWeaponCooldown_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getAirWeaponCooldown(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getSpellCooldown_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getSpellCooldown(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getDefenseMatrixPoints_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getDefenseMatrixPoints(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getDefenseMatrixTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getDefenseMatrixTimer(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getEnsnareTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getEnsnareTimer(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getIrradiateTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getIrradiateTimer(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getLockdownTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getLockdownTimer(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getMaelstromTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getMaelstromTimer(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getOrderTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getOrderTimer(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getPlagueTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getPlagueTimer(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getRemoveTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getRemoveTimer(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getStasisTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getStasisTimer(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getStimTimer_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getStimTimer(); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getBuildType_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)tableUnitType.find(x_unit->getBuildType())->second; jclass retcls = FindCachedClass(env, "bwapi4/UnitType"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/UnitType;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getTech_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)tableTechType.find(x_unit->getTech())->second; jclass retcls = FindCachedClass(env, "bwapi4/TechType"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/TechType;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getUpgrade_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)tableUpgradeType.find(x_unit->getUpgrade())->second; jclass retcls = FindCachedClass(env, "bwapi4/UpgradeType"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/UpgradeType;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getRemainingBuildTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getRemainingBuildTime(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getRemainingTrainTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getRemainingTrainTime(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getRemainingResearchTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getRemainingResearchTime(); } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getRemainingUpgradeTime_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getRemainingUpgradeTime(); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getBuildUnit_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getBuildUnit(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getTarget_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getTarget(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getTargetPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position cresult = x_unit->getTargetPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getOrder_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)tableOrder.find(x_unit->getOrder())->second; jclass retcls = FindCachedClass(env, "bwapi4/Order"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Order;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getSecondaryOrder_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)tableOrder.find(x_unit->getSecondaryOrder())->second; jclass retcls = FindCachedClass(env, "bwapi4/Order"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Order;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getOrderTarget_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getOrderTarget(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getOrderTargetPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position cresult = x_unit->getOrderTargetPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getRallyPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position cresult = x_unit->getRallyPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getRallyUnit_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getRallyUnit(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getAddon_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getAddon(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getNydusExit_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getNydusExit(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getPowerUp_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getPowerUp(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getTransport_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getTransport(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getLoadedUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; -jlong resptr = (jlong)x_unit->getLoadedUnits(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unit x_unit = (Unit)pointer; +Unitset cresult = x_unit->getLoadedUnits(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jint JNICALL Java_bwapi4_Unit_getSpaceRemaining_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->getSpaceRemaining(); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getCarrier_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getCarrier(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getInterceptors_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; -jlong resptr = (jlong)x_unit->getInterceptors(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unit x_unit = (Unit)pointer; +Unitset cresult = x_unit->getInterceptors(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getHatchery_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; jlong resptr = (jlong)x_unit->getHatchery(); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getLarva_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; -jlong resptr = (jlong)x_unit->getLarva(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unit x_unit = (Unit)pointer; +Unitset cresult = x_unit->getLarva(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getUnitsInRadius_1native(JNIEnv * env, jobject obj, jlong pointer, jint radius, jobject p_pred){ -Unit* x_unit = (Unit*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_unit->getUnitsInRadius(radius, pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unit x_unit = (Unit)pointer; +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_unit->getUnitsInRadius(radius, pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getUnitsInWeaponRange_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_weapon, jobject p_pred){ -Unit* x_unit = (Unit*)pointer; -WeaponType* weapon = (WeaponType*)env->GetLongField(p_weapon, FindCachedField(env, env->GetObjectClass(p_weapon), "pointer", "J")); -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_unit->getUnitsInWeaponRange(*weapon, pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unit x_unit = (Unit)pointer; +WeaponType weapon = (WeaponType)env->GetLongField(p_weapon, FindCachedField(env, env->GetObjectClass(p_weapon), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_unit->getUnitsInWeaponRange(weapon, pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getClosestUnit_1native__JLbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_pred){ -Unit* x_unit = (Unit*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_unit->getClosestUnit(pred); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getClosestUnit_1native__JLbwapi4_UnitFilter_2I(JNIEnv * env, jobject obj, jlong pointer, jobject p_pred, jint radius){ -Unit* x_unit = (Unit*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_unit->getClosestUnit(pred, radius); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_hasNuke_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->hasNuke(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isAccelerating_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isAccelerating(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isAttacking_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isAttacking(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isAttackFrame_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isAttackFrame(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isBeingConstructed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isBeingConstructed(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isBeingGathered_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isBeingGathered(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isBeingHealed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isBeingHealed(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isBlind_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isBlind(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isBraking_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isBraking(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isBurrowed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isBurrowed(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isCarryingGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isCarryingGas(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isCarryingMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isCarryingMinerals(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isCloaked_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isCloaked(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isCompleted_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isCompleted(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isConstructing_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isConstructing(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isDefenseMatrixed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isDefenseMatrixed(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isDetected_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isDetected(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isEnsnared_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isEnsnared(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isFlying_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isFlying(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isFollowing_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isFollowing(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isGatheringGas_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isGatheringGas(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isGatheringMinerals_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isGatheringMinerals(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isHallucination_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isHallucination(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isHoldingPosition_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isHoldingPosition(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isIdle_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isIdle(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isInterruptible_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isInterruptible(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isInvincible_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isInvincible(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isInWeaponRange_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->isInWeaponRange(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isIrradiated_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isIrradiated(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isLifted_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isLifted(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isLoaded_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isLoaded(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isLockedDown_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isLockedDown(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isMaelstrommed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isMaelstrommed(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isMorphing_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isMorphing(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isMoving_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isMoving(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isParasited_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isParasited(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isPatrolling_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isPatrolling(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isPlagued_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isPlagued(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isRepairing_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isRepairing(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isResearching_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isResearching(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isSelected_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isSelected(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isSieged_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isSieged(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isStartingAttack_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isStartingAttack(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isStasised_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isStasised(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isStimmed_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isStimmed(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isStuck_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isStuck(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isTraining_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isTraining(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isUnderAttack_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isUnderAttack(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isUnderDarkSwarm_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isUnderDarkSwarm(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isUnderDisruptionWeb_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isUnderDisruptionWeb(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isUnderStorm_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isUnderStorm(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isPowered_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isPowered(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isUpgrading_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isUpgrading(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isVisible_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isVisible(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isVisible_1native__JLbwapi4_Player_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_player){ -Unit* x_unit = (Unit*)pointer; -Player* player = (Player*)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Player player = (Player)env->GetLongField(p_player, FindCachedField(env, env->GetObjectClass(p_player), "pointer", "J")); return x_unit->isVisible(player); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_isTargetable_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->isTargetable(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_issueCommand_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_command){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->issueCommand(*command); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->issueCommand(command); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_attack_1native__JLbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->attack(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_attack_1native__JLbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->attack(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_build_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit* x_unit = (Unit*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->build(*type); +Unit x_unit = (Unit)pointer; +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unit->build(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_build_1native__JLbwapi4_UnitType_2Lbwapi4_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->build(*type, target); +return x_unit->build(type, target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_buildAddon_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit* x_unit = (Unit*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->buildAddon(*type); +Unit x_unit = (Unit)pointer; +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unit->buildAddon(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_train_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->train(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_train_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit* x_unit = (Unit*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->train(*type); +Unit x_unit = (Unit)pointer; +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unit->train(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_morph_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit* x_unit = (Unit*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->morph(*type); +Unit x_unit = (Unit)pointer; +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unit->morph(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_research_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->research(*tech); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->research(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_upgrade_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_upgrade){ -Unit* x_unit = (Unit*)pointer; -UpgradeType* upgrade = (UpgradeType*)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); -return x_unit->upgrade(*upgrade); +Unit x_unit = (Unit)pointer; +UpgradeType upgrade = (UpgradeType)env->GetLongField(p_upgrade, FindCachedField(env, env->GetObjectClass(p_upgrade), "pointer", "J")); +return x_unit->upgrade(upgrade); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_setRallyPoint_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->setRallyPoint(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_move_1native__JLbwapi4_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->move(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_move_1native__JLbwapi4_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->move(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_patrol_1native__JLbwapi4_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->patrol(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_patrol_1native__JLbwapi4_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->patrol(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_holdPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->holdPosition(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_holdPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->holdPosition((bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_stop_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->stop(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_stop_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->stop((bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_follow_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->follow(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_follow_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->follow(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_gather_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->gather(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_gather_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->gather(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_returnCargo_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->returnCargo(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_returnCargo_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->returnCargo((bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_repair_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->repair(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_repair_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->repair(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_burrow_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->burrow(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_unburrow_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->unburrow(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_cloak_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->cloak(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_decloak_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->decloak(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_siege_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->siege(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_unsiege_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->unsiege(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_lift_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->lift(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_land_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->land(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_load_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->load(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_load_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->load(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_unload_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->unload(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_unloadAll_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->unloadAll(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_unloadAll_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->unloadAll((bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_unloadAll_1native__JLbwapi4_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->unloadAll(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_unloadAll_1native__JLbwapi4_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->unloadAll(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_rightClick_1native__JLbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->rightClick(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_rightClick_1native__JLbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->rightClick(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_haltConstruction_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->haltConstruction(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_cancelConstruction_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->cancelConstruction(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_cancelAddon_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->cancelAddon(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_cancelTrain_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->cancelTrain(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_cancelTrain_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint slot){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->cancelTrain(slot); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_cancelMorph_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->cancelMorph(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_cancelResearch_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->cancelResearch(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_cancelUpgrade_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->cancelUpgrade(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_useTech_1native__JLbwapi4_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->useTech(*tech); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->useTech(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_useTech_1native__JLbwapi4_TechType_2Lbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->useTech(*tech, target); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +return x_unit->useTech(tech, target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_placeCOP_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->placeCOP(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommand_1native__JLbwapi4_UnitCommand_2ZZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanBuildUnitType, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommand(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommand_1native__JLbwapi4_UnitCommand_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanBuildUnitType, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommand(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType, (bool)checkCanTargetUnit); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommand_1native__JLbwapi4_UnitCommand_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanBuildUnitType){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommand(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommand_1native__JLbwapi4_UnitCommand_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommand(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommand_1native__JLbwapi4_UnitCommand_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommand(*command, (bool)checkCanUseTechPositionOnPositions); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommand_1native__JLbwapi4_UnitCommand_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_command){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommand(*command); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommand(command); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommand_1native__JLbwapi4_UnitCommand_2ZZZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanBuildUnitType, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommand(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommand(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanBuildUnitType, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandGrouped_1native__JLbwapi4_UnitCommand_2ZZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommandGrouped(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandGrouped_1native__JLbwapi4_UnitCommand_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommandGrouped(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandGrouped_1native__JLbwapi4_UnitCommand_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommandGrouped(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandGrouped_1native__JLbwapi4_UnitCommand_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommandGrouped(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandGrouped_1native__JLbwapi4_UnitCommand_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommandGrouped(*command, (bool)checkCanUseTechPositionOnPositions); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandGrouped_1native__JLbwapi4_UnitCommand_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_command){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommandGrouped(*command); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommandGrouped(command); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandGrouped_1native__JLbwapi4_UnitCommand_2ZZZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_command, jboolean checkCanUseTechPositionOnPositions, jboolean checkCanUseTechUnitOnUnits, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unit->canIssueCommandGrouped(*command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unit->canIssueCommandGrouped(command, (bool)checkCanUseTechPositionOnPositions, (bool)checkCanUseTechUnitOnUnits, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCommand_1native(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCommand(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCommandGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCommandGrouped(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCommandGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCommandGrouped((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandType_1native__JLbwapi4_UnitCommandType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct){ -Unit* x_unit = (Unit*)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitCommandType ct = (UnitCommandType)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); return x_unit->canIssueCommandType(ct); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandType_1native__JLbwapi4_UnitCommandType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitCommandType ct = (UnitCommandType)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); return x_unit->canIssueCommandType(ct, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandTypeGrouped_1native__JLbwapi4_UnitCommandType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitCommandType ct = (UnitCommandType)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); return x_unit->canIssueCommandTypeGrouped(ct, (bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandTypeGrouped_1native__JLbwapi4_UnitCommandType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct){ -Unit* x_unit = (Unit*)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitCommandType ct = (UnitCommandType)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); return x_unit->canIssueCommandTypeGrouped(ct); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canIssueCommandTypeGrouped_1native__JLbwapi4_UnitCommandType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_ct, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -UnitCommandType* ct = (UnitCommandType*)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitCommandType ct = (UnitCommandType)env->GetLongField(p_ct, FindCachedField(env, env->GetObjectClass(p_ct), "pointer", "J")); return x_unit->canIssueCommandTypeGrouped(ct, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canTargetUnit_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canTargetUnit(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canTargetUnit_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canTargetUnit(targetUnit, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttack_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttack(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttack_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttack((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttack_1native__JLbwapi4_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canAttack(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttack_1native__JLbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canAttack(target, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttack_1native__JLbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canAttack(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttack_1native__JLbwapi4_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canAttack(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackGrouped((bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackGrouped(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackGrouped_1native__JLbwapi4_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackGrouped_1native__JLbwapi4_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackGrouped_1native__JLbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackGrouped_1native__JLbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canAttackGrouped(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackGrouped_1native__JLbwapi4_PositionOrUnit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canAttackGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackMove_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackMove(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackMove_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackMove((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackMoveGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackMoveGrouped((bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackMoveGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackMoveGrouped(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackMoveGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackMoveGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnit_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackUnit(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnit_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackUnit((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnit_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canAttackUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnit_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canAttackUnit(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnit_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canAttackUnit(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnit_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canAttackUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnitGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackUnitGrouped((bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnitGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackUnitGrouped(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnitGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canAttackUnitGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnitGrouped_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canAttackUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnitGrouped_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canAttackUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnitGrouped_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canAttackUnitGrouped(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnitGrouped_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canAttackUnitGrouped(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canAttackUnitGrouped_1native__JLbwapi4_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canAttackUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuild_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canBuild(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuild_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canBuild((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuild_1native__JLbwapi4_UnitType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuild(*uType, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canBuild(uType, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuild_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuild(*uType); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canBuild(uType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuild_1native__JLbwapi4_UnitType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuild(*uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canBuild(uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuild_1native__JLbwapi4_UnitType_2Lbwapi4_TilePosition_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jobject p_tilePos, jboolean checkTargetUnitType, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); TilePosition tilePos((int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "x", "I")), (int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "y", "I"))); -return x_unit->canBuild(*uType, tilePos, (bool)checkTargetUnitType, (bool)checkCanIssueCommandType); +return x_unit->canBuild(uType, tilePos, (bool)checkTargetUnitType, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuild_1native__JLbwapi4_UnitType_2Lbwapi4_TilePosition_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jobject p_tilePos, jboolean checkTargetUnitType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); TilePosition tilePos((int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "x", "I")), (int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "y", "I"))); -return x_unit->canBuild(*uType, tilePos, (bool)checkTargetUnitType); +return x_unit->canBuild(uType, tilePos, (bool)checkTargetUnitType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuild_1native__JLbwapi4_UnitType_2Lbwapi4_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jobject p_tilePos){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); TilePosition tilePos((int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "x", "I")), (int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "y", "I"))); -return x_unit->canBuild(*uType, tilePos); +return x_unit->canBuild(uType, tilePos); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuild_1native__JLbwapi4_UnitType_2Lbwapi4_TilePosition_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jobject p_tilePos, jboolean checkTargetUnitType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); TilePosition tilePos((int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "x", "I")), (int)env->GetIntField(p_tilePos, FindCachedField(env, env->GetObjectClass(p_tilePos), "y", "I"))); -return x_unit->canBuild(*uType, tilePos, (bool)checkTargetUnitType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +return x_unit->canBuild(uType, tilePos, (bool)checkTargetUnitType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuildAddon_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canBuildAddon(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuildAddon_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canBuildAddon((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuildAddon_1native__JLbwapi4_UnitType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuildAddon(*uType, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canBuildAddon(uType, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuildAddon_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuildAddon(*uType); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canBuildAddon(uType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBuildAddon_1native__JLbwapi4_UnitType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canBuildAddon(*uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canBuildAddon(uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canTrain_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canTrain(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canTrain_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canTrain((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canTrain_1native__JLbwapi4_UnitType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canTrain(*uType, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canTrain(uType, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canTrain_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canTrain(*uType); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canTrain(uType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canTrain_1native__JLbwapi4_UnitType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canTrain(*uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canTrain(uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMorph_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canMorph(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMorph_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canMorph((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMorph_1native__JLbwapi4_UnitType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canMorph(*uType, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canMorph(uType, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMorph_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canMorph(*uType); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canMorph(uType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMorph_1native__JLbwapi4_UnitType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_uType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -UnitType* uType = (UnitType*)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); -return x_unit->canMorph(*uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +UnitType uType = (UnitType)env->GetLongField(p_uType, FindCachedField(env, env->GetObjectClass(p_uType), "pointer", "J")); +return x_unit->canMorph(uType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canResearch_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canResearch(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canResearch_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canResearch((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canResearch_1native__JLbwapi4_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit* x_unit = (Unit*)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->canResearch(*type); +Unit x_unit = (Unit)pointer; +TechType type = (TechType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unit->canResearch(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canResearch_1native__JLbwapi4_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -TechType* type = (TechType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->canResearch(*type, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +TechType type = (TechType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unit->canResearch(type, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUpgrade_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUpgrade(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUpgrade_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUpgrade((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUpgrade_1native__JLbwapi4_UpgradeType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ -Unit* x_unit = (Unit*)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->canUpgrade(*type); +Unit x_unit = (Unit)pointer; +UpgradeType type = (UpgradeType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unit->canUpgrade(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUpgrade_1native__JLbwapi4_UpgradeType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -UpgradeType* type = (UpgradeType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unit->canUpgrade(*type, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +UpgradeType type = (UpgradeType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unit->canUpgrade(type, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyPoint_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canSetRallyPoint(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyPoint_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canSetRallyPoint((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyPoint_1native__JLbwapi4_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyPoint_1native__JLbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyPoint_1native__JLbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canSetRallyPoint(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyPoint_1native__JLbwapi4_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canSetRallyPoint(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canSetRallyPosition(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canSetRallyPosition((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyUnit_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canSetRallyUnit(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyUnit_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canSetRallyUnit((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyUnit_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canSetRallyUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyUnit_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canSetRallyUnit(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyUnit_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canSetRallyUnit(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSetRallyUnit_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canSetRallyUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMove_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canMove(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMove_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canMove((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMoveGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canMoveGrouped((bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMoveGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canMoveGrouped(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canMoveGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canMoveGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPatrol_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canPatrol(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPatrol_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canPatrol((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPatrolGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canPatrolGrouped((bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPatrolGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canPatrolGrouped(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPatrolGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canPatrolGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canFollow_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canFollow(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canFollow_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canFollow((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canFollow_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canFollow(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canFollow_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canFollow(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canFollow_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canFollow(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canFollow_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canFollow(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canGather_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canGather(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canGather_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canGather((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canGather_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canGather(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canGather_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canGather(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canGather_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canGather(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canGather_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canGather(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canReturnCargo_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canReturnCargo(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canReturnCargo_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canReturnCargo((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canHoldPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canHoldPosition(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canHoldPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canHoldPosition((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canStop_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canStop(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canStop_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canStop((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRepair_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRepair(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRepair_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRepair((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRepair_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRepair(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRepair_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRepair(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRepair_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRepair(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRepair_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRepair(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBurrow_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canBurrow(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canBurrow_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canBurrow((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnburrow_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnburrow(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnburrow_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnburrow((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCloak_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCloak(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCloak_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCloak((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canDecloak_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canDecloak(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canDecloak_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canDecloak((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSiege_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canSiege(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canSiege_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canSiege((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnsiege_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnsiege(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnsiege_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnsiege((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLift_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canLift(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLift_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canLift((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLand_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canLand(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLand_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canLand((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLand_1native__JLbwapi4_TilePosition_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->canLand(target, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLand_1native__JLbwapi4_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->canLand(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLand_1native__JLbwapi4_TilePosition_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->canLand(target, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLoad_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canLoad(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLoad_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canLoad((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLoad_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canLoad(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLoad_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canLoad(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLoad_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canLoad(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canLoad_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canLoad(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadWithOrWithoutTarget_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnloadWithOrWithoutTarget(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadWithOrWithoutTarget_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnloadWithOrWithoutTarget((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAtPosition_1native__JLbwapi4_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); return x_unit->canUnloadAtPosition(targDropPos, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAtPosition_1native__JLbwapi4_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); return x_unit->canUnloadAtPosition(targDropPos); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAtPosition_1native__JLbwapi4_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); return x_unit->canUnloadAtPosition(targDropPos, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnload_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnload(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnload_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnload((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnload_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkPosition, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canUnload(targetUnit, (bool)checkCanTargetUnit, (bool)checkPosition, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnload_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkPosition){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canUnload(targetUnit, (bool)checkCanTargetUnit, (bool)checkPosition); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnload_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canUnload(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnload_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canUnload(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnload_1native__JLbwapi4_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkPosition, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canUnload(targetUnit, (bool)checkCanTargetUnit, (bool)checkPosition, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAll_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnloadAll(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAll_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnloadAll((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAllPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnloadAllPosition(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAllPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUnloadAllPosition((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAllPosition_1native__JLbwapi4_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); return x_unit->canUnloadAllPosition(targDropPos, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAllPosition_1native__JLbwapi4_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); return x_unit->canUnloadAllPosition(targDropPos); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUnloadAllPosition_1native__JLbwapi4_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targDropPos, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; Position targDropPos((int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "x", "I")), (int)env->GetIntField(p_targDropPos, FindCachedField(env, env->GetObjectClass(p_targDropPos), "y", "I"))); return x_unit->canUnloadAllPosition(targDropPos, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClick_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClick(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClick_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClick((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClick_1native__JLbwapi4_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canRightClick(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClick_1native__JLbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canRightClick(target, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClick_1native__JLbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canRightClick(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClick_1native__JLbwapi4_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canRightClick(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickGrouped((bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickGrouped(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickGrouped_1native__JLbwapi4_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickGrouped_1native__JLbwapi4_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickGrouped_1native__JLbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickGrouped_1native__JLbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canRightClickGrouped(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickGrouped_1native__JLbwapi4_PositionOrUnit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit x_unit = (Unit)pointer; +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unit->canRightClickGrouped(target, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickPosition_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickPosition(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickPosition_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickPosition((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickPositionGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickPositionGrouped((bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickPositionGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickPositionGrouped(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickPositionGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickPositionGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnit_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickUnit(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnit_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickUnit((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnit_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRightClickUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnit_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRightClickUnit(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnit_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRightClickUnit(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnit_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRightClickUnit(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnitGrouped_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickUnitGrouped((bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnitGrouped_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickUnitGrouped(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnitGrouped_1native__JZZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canRightClickUnitGrouped((bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnitGrouped_1native__JLbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRightClickUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnitGrouped_1native__JLbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRightClickUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnitGrouped_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRightClickUnitGrouped(targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnitGrouped_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRightClickUnitGrouped(targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canRightClickUnitGrouped_1native__JLbwapi4_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkCanIssueCommandType, jboolean checkCommandibilityGrouped, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +Unit x_unit = (Unit)pointer; +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); return x_unit->canRightClickUnitGrouped(targetUnit, (bool)checkCanTargetUnit, (bool)checkCanIssueCommandType, (bool)checkCommandibilityGrouped, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canHaltConstruction_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canHaltConstruction(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canHaltConstruction_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canHaltConstruction((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelConstruction_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelConstruction(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelConstruction_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelConstruction((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelAddon_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelAddon(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelAddon_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelAddon((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelTrain_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelTrain(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelTrain_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelTrain((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelTrainSlot_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelTrainSlot(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelTrainSlot_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelTrainSlot((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelTrainSlot_1native__JIZ(JNIEnv * env, jobject obj, jlong pointer, jint slot, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelTrainSlot(slot, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelTrainSlot_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint slot){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelTrainSlot(slot); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelTrainSlot_1native__JIZZ(JNIEnv * env, jobject obj, jlong pointer, jint slot, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelTrainSlot(slot, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelMorph_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelMorph(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelMorph_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelMorph((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelResearch_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelResearch(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelResearch_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelResearch((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelUpgrade_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelUpgrade(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canCancelUpgrade_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canCancelUpgrade((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechWithOrWithoutTarget_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUseTechWithOrWithoutTarget(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechWithOrWithoutTarget_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canUseTechWithOrWithoutTarget((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechWithOrWithoutTarget_1native__JLbwapi4_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithOrWithoutTarget(*tech, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechWithOrWithoutTarget(tech, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechWithOrWithoutTarget_1native__JLbwapi4_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithOrWithoutTarget(*tech); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechWithOrWithoutTarget(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechWithOrWithoutTarget_1native__JLbwapi4_TechType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithOrWithoutTarget(*tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechWithOrWithoutTarget(tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTech_1native__JLbwapi4_TechType_2Lbwapi4_PositionOrUnit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +return x_unit->canUseTech(tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTech_1native__JLbwapi4_TechType_2Lbwapi4_PositionOrUnit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +return x_unit->canUseTech(tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTech_1native__JLbwapi4_TechType_2Lbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +return x_unit->canUseTech(tech, target, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTech_1native__JLbwapi4_TechType_2Lbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +return x_unit->canUseTech(tech, target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTech_1native__JLbwapi4_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTech(*tech); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTech(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTech_1native__JLbwapi4_TechType_2Lbwapi4_PositionOrUnit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkCanTargetUnit, jboolean checkTargetsType, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unit->canUseTech(*tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +return x_unit->canUseTech(tech, target, (bool)checkCanTargetUnit, (bool)checkTargetsType, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechWithoutTarget_1native__JLbwapi4_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithoutTarget(*tech, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechWithoutTarget(tech, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechWithoutTarget_1native__JLbwapi4_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithoutTarget(*tech); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechWithoutTarget(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechWithoutTarget_1native__JLbwapi4_TechType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechWithoutTarget(*tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechWithoutTarget(tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechUnit_1native__JLbwapi4_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechUnit(tech, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechUnit_1native__JLbwapi4_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechUnit(*tech); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechUnit(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechUnit_1native__JLbwapi4_TechType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechUnit(tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechUnit_1native__JLbwapi4_TechType_2Lbwapi4_Unit_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkTargetsUnits, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit, (bool)checkCanTargetUnit, (bool)checkTargetsUnits, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +return x_unit->canUseTechUnit(tech, targetUnit, (bool)checkCanTargetUnit, (bool)checkTargetsUnits, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechUnit_1native__JLbwapi4_TechType_2Lbwapi4_Unit_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkTargetsUnits){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit, (bool)checkCanTargetUnit, (bool)checkTargetsUnits); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +return x_unit->canUseTechUnit(tech, targetUnit, (bool)checkCanTargetUnit, (bool)checkTargetsUnits); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechUnit_1native__JLbwapi4_TechType_2Lbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit, jboolean checkCanTargetUnit){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit, (bool)checkCanTargetUnit); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +return x_unit->canUseTechUnit(tech, targetUnit, (bool)checkCanTargetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechUnit_1native__JLbwapi4_TechType_2Lbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +return x_unit->canUseTechUnit(tech, targetUnit); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechUnit_1native__JLbwapi4_TechType_2Lbwapi4_Unit_2ZZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_targetUnit, jboolean checkCanTargetUnit, jboolean checkTargetsUnits, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -Unit* targetUnit = (Unit*)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); -return x_unit->canUseTechUnit(*tech, targetUnit, (bool)checkCanTargetUnit, (bool)checkTargetsUnits, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +Unit targetUnit = (Unit)env->GetLongField(p_targetUnit, FindCachedField(env, env->GetObjectClass(p_targetUnit), "pointer", "J")); +return x_unit->canUseTechUnit(tech, targetUnit, (bool)checkCanTargetUnit, (bool)checkTargetsUnits, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechPosition_1native__JLbwapi4_TechType_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechPosition(*tech, (bool)checkCanIssueCommandType); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechPosition(tech, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechPosition_1native__JLbwapi4_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechPosition(*tech); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechPosition(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechPosition_1native__JLbwapi4_TechType_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unit->canUseTechPosition(*tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unit->canUseTechPosition(tech, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechPosition_1native__JLbwapi4_TechType_2Lbwapi4_Position_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkTargetsPositions, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTechPosition(*tech, target, (bool)checkTargetsPositions, (bool)checkCanIssueCommandType); +return x_unit->canUseTechPosition(tech, target, (bool)checkTargetsPositions, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechPosition_1native__JLbwapi4_TechType_2Lbwapi4_Position_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkTargetsPositions){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTechPosition(*tech, target, (bool)checkTargetsPositions); +return x_unit->canUseTechPosition(tech, target, (bool)checkTargetsPositions); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechPosition_1native__JLbwapi4_TechType_2Lbwapi4_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTechPosition(*tech, target); +return x_unit->canUseTechPosition(tech, target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canUseTechPosition_1native__JLbwapi4_TechType_2Lbwapi4_Position_2ZZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target, jboolean checkTargetsPositions, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +Unit x_unit = (Unit)pointer; +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); Position target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unit->canUseTechPosition(*tech, target, (bool)checkTargetsPositions, (bool)checkCanIssueCommandType, (bool)checkCommandibility); +return x_unit->canUseTechPosition(tech, target, (bool)checkTargetsPositions, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPlaceCOP_1native__J(JNIEnv * env, jobject obj, jlong pointer){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canPlaceCOP(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPlaceCOP_1native__JZ(JNIEnv * env, jobject obj, jlong pointer, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; return x_unit->canPlaceCOP((bool)checkCommandibility); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPlaceCOP_1native__JLbwapi4_TilePosition_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanIssueCommandType){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->canPlaceCOP(target, (bool)checkCanIssueCommandType); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPlaceCOP_1native__JLbwapi4_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->canPlaceCOP(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unit_canPlaceCOP_1native__JLbwapi4_TilePosition_2ZZ(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean checkCanIssueCommandType, jboolean checkCommandibility){ -Unit* x_unit = (Unit*)pointer; +Unit x_unit = (Unit)pointer; TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); return x_unit->canPlaceCOP(target, (bool)checkCanIssueCommandType, (bool)checkCommandibility); } JNIEXPORT jobject JNICALL Java_bwapi4_UnitCommand_getType_1native(JNIEnv * env, jobject obj, jlong pointer){ -UnitCommand* x_unitCommand = (UnitCommand*)pointer; +UnitCommand x_unitCommand = (UnitCommand)pointer; jlong resptr = (jlong)x_unitCommand->getType(); jclass retcls = FindCachedClass(env, "bwapi4/UnitCommandType"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/UnitCommandType;"); @@ -4210,29 +4507,53 @@ Unitset* x_unitset = (Unitset*)pointer; Position cresult = x_unitset->getPosition(); jclass retcls = FindCachedClass(env, "bwapi/Position"); jmethodID retConsID = FindCachedMethod(env, retcls, "", "(II)V"); -jobject result = env->NewObject(retcls, retConsID, cresult.x(), cresult.y()); +jobject result = env->NewObject(retcls, retConsID, cresult.x, cresult.y); return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getLoadedUnits_1native(JNIEnv * env, jobject obj, jlong pointer){ Unitset* x_unitset = (Unitset*)pointer; -jlong resptr = (jlong)x_unitset->getLoadedUnits(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_unitset->getLoadedUnits(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getInterceptors_1native(JNIEnv * env, jobject obj, jlong pointer){ Unitset* x_unitset = (Unitset*)pointer; -jlong resptr = (jlong)x_unitset->getInterceptors(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_unitset->getInterceptors(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getLarva_1native(JNIEnv * env, jobject obj, jlong pointer){ Unitset* x_unitset = (Unitset*)pointer; -jlong resptr = (jlong)x_unitset->getLarva(); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +Unitset cresult = x_unitset->getLarva(); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT void JNICALL Java_bwapi4_Unitset_setClientInfo_1native__JI(JNIEnv * env, jobject obj, jlong pointer, jint clientInfo){ Unitset* x_unitset = (Unitset*)pointer; @@ -4248,15 +4569,23 @@ x_unitset->setClientInfo(clientInfo, index); } JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getUnitsInRadius_1native(JNIEnv * env, jobject obj, jlong pointer, jint radius, jobject p_pred){ Unitset* x_unitset = (Unitset*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); -jlong resptr = (jlong)x_unitset->getUnitsInRadius(radius, pred); -jclass retcls = FindCachedClass(env, "bwapi4/Unitset"); -jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unitset;"); -return env->CallStaticObjectMethod(retcls, mid, resptr); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +Unitset cresult = x_unitset->getUnitsInRadius(radius, pred); +jclass listCls = FindCachedClass(env, "java/util/ArrayList"); +jmethodID listConsID = FindCachedMethod(env, listCls, "", "()V"); +jobject result = env->NewObject(listCls, listConsID); +jmethodID addMethodID = FindCachedMethod(env, listCls, "add", "(Ljava/lang/Object;)Z"); +jclass elemClass = FindCachedClass(env, "bwapi4/Unit"); +jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, "get", "(J)Lbwapi4/Unit;"); +for(Unitset::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){const Unit elem_ptr = *it; +jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ; +env->CallVoidMethod(result, addMethodID, elem); +} +return result; } JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getClosestUnit_1native__JLbwapi4_UnitFilter_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_pred){ Unitset* x_unitset = (Unitset*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_unitset->getClosestUnit(pred); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -4264,7 +4593,7 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getClosestUnit_1native__JLbwapi4_UnitFilter_2I(JNIEnv * env, jobject obj, jlong pointer, jobject p_pred, jint radius){ Unitset* x_unitset = (Unitset*)pointer; -UnitFilter* pred = (UnitFilter*)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); +UnitFilter pred = (UnitFilter)env->GetLongField(p_pred, FindCachedField(env, env->GetObjectClass(p_pred), "pointer", "J")); jlong resptr = (jlong)x_unitset->getClosestUnit(pred, radius); jclass retcls = FindCachedClass(env, "bwapi4/Unit"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/Unit;"); @@ -4272,48 +4601,48 @@ return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_issueCommand_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_command){ Unitset* x_unitset = (Unitset*)pointer; -UnitCommand* command = (UnitCommand*)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); -return x_unitset->issueCommand(*command); +UnitCommand command = (UnitCommand)env->GetLongField(p_command, FindCachedField(env, env->GetObjectClass(p_command), "pointer", "J")); +return x_unitset->issueCommand(command); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_attack_1native__JLbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->attack(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_attack_1native__JLbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->attack(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_build_1native__JLbwapi4_UnitType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unitset->build(*type); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unitset->build(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_build_1native__JLbwapi4_UnitType_2Lbwapi4_TilePosition_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_type, jobject p_target){ Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); TilePosition target((int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "x", "I")), (int)env->GetIntField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "y", "I"))); -return x_unitset->build(*type, target); +return x_unitset->build(type, target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_buildAddon_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unitset->buildAddon(*type); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unitset->buildAddon(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_train_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unitset->train(*type); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unitset->train(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_morph_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_type){ Unitset* x_unitset = (Unitset*)pointer; -UnitType* type = (UnitType*)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); -return x_unitset->morph(*type); +UnitType type = (UnitType)env->GetLongField(p_type, FindCachedField(env, env->GetObjectClass(p_type), "pointer", "J")); +return x_unitset->morph(type); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_setRallyPoint_1native(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->setRallyPoint(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_move_1native__JLbwapi4_Position_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ @@ -4354,22 +4683,22 @@ return x_unitset->stop((bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_follow_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ Unitset* x_unitset = (Unitset*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->follow(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_follow_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ Unitset* x_unitset = (Unitset*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->follow(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_gather_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ Unitset* x_unitset = (Unitset*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->gather(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_gather_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ Unitset* x_unitset = (Unitset*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->gather(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_returnCargo_1native__J(JNIEnv * env, jobject obj, jlong pointer){ @@ -4382,12 +4711,12 @@ return x_unitset->returnCargo((bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_repair_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ Unitset* x_unitset = (Unitset*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->repair(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_repair_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ Unitset* x_unitset = (Unitset*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->repair(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_burrow_1native(JNIEnv * env, jobject obj, jlong pointer){ @@ -4420,12 +4749,12 @@ return x_unitset->lift(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_load_1native__JLbwapi4_Unit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ Unitset* x_unitset = (Unitset*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->load(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_load_1native__JLbwapi4_Unit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ Unitset* x_unitset = (Unitset*)pointer; -Unit* target = (Unit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +Unit target = (Unit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->load(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_unloadAll_1native__J(JNIEnv * env, jobject obj, jlong pointer){ @@ -4448,12 +4777,12 @@ return x_unitset->unloadAll(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_rightClick_1native__JLbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_target){ Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->rightClick(target); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_rightClick_1native__JLbwapi4_PositionOrUnit_2Z(JNIEnv * env, jobject obj, jlong pointer, jobject p_target, jboolean shiftQueueCommand){ Unitset* x_unitset = (Unitset*)pointer; -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); return x_unitset->rightClick(target, (bool)shiftQueueCommand); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_haltConstruction_1native(JNIEnv * env, jobject obj, jlong pointer){ @@ -4490,43 +4819,43 @@ return x_unitset->cancelUpgrade(); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_useTech_1native__JLbwapi4_TechType_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech){ Unitset* x_unitset = (Unitset*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -return x_unitset->useTech(*tech); +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +return x_unitset->useTech(tech); } JNIEXPORT jboolean JNICALL Java_bwapi4_Unitset_useTech_1native__JLbwapi4_TechType_2Lbwapi4_PositionOrUnit_2(JNIEnv * env, jobject obj, jlong pointer, jobject p_tech, jobject p_target){ Unitset* x_unitset = (Unitset*)pointer; -TechType* tech = (TechType*)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); -PositionOrUnit* target = (PositionOrUnit*)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); -return x_unitset->useTech(*tech, target); +TechType tech = (TechType)env->GetLongField(p_tech, FindCachedField(env, env->GetObjectClass(p_tech), "pointer", "J")); +PositionOrUnit target = (PositionOrUnit)env->GetLongField(p_target, FindCachedField(env, env->GetObjectClass(p_target), "pointer", "J")); +return x_unitset->useTech(tech, target); } JNIEXPORT jboolean JNICALL Java_bwapi4_WalkPosition_isValid(JNIEnv * env, jobject obj){ -WalkPosition* x_walkPosition = (WalkPosition*)pointer; +WalkPosition x_walkPosition = (WalkPosition)pointer; return x_walkPosition->isValid(); } JNIEXPORT jobject JNICALL Java_bwapi4_WalkPosition_makeValid(JNIEnv * env, jobject obj){ -WalkPosition* x_walkPosition = (WalkPosition*)pointer; +WalkPosition x_walkPosition = (WalkPosition)pointer; jlong resptr = (jlong)x_walkPosition->makeValid(); jclass retcls = FindCachedClass(env, "bwapi4/WalkPosition"); jmethodID mid = FindCachedMethodStatic(env, retcls, "get", "(J)Lbwapi4/WalkPosition;"); return env->CallStaticObjectMethod(retcls, mid, resptr); } JNIEXPORT jdouble JNICALL Java_bwapi4_WalkPosition_getDistance(JNIEnv * env, jobject obj, jobject p_position){ -WalkPosition* x_walkPosition = (WalkPosition*)pointer; -WalkPosition* position = (WalkPosition*)env->GetLongField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "pointer", "J")); +WalkPosition x_walkPosition = (WalkPosition)pointer; +WalkPosition position = (WalkPosition)env->GetLongField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "pointer", "J")); return x_walkPosition->getDistance(position); } JNIEXPORT jint JNICALL Java_bwapi4_WalkPosition_getApproxDistance(JNIEnv * env, jobject obj, jobject p_position){ -WalkPosition* x_walkPosition = (WalkPosition*)pointer; -WalkPosition* position = (WalkPosition*)env->GetLongField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "pointer", "J")); +WalkPosition x_walkPosition = (WalkPosition)pointer; +WalkPosition position = (WalkPosition)env->GetLongField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "pointer", "J")); return x_walkPosition->getApproxDistance(position); } JNIEXPORT jdouble JNICALL Java_bwapi4_WalkPosition_getLength(JNIEnv * env, jobject obj){ -WalkPosition* x_walkPosition = (WalkPosition*)pointer; +WalkPosition x_walkPosition = (WalkPosition)pointer; return x_walkPosition->getLength(); } JNIEXPORT jboolean JNICALL Java_bwapi4_WalkPosition_hasPath(JNIEnv * env, jobject obj, jobject p_position){ -WalkPosition* x_walkPosition = (WalkPosition*)pointer; -WalkPosition* position = (WalkPosition*)env->GetLongField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "pointer", "J")); +WalkPosition x_walkPosition = (WalkPosition)pointer; +WalkPosition position = (WalkPosition)env->GetLongField(p_position, FindCachedField(env, env->GetObjectClass(p_position), "pointer", "J")); return x_walkPosition->hasPath(position); } void reconnect() @@ -4554,6 +4883,82 @@ println("Attempting to init BWAPI..."); println("BWAPI ready."); jclass cls; jmethodID getId; +cls = env->FindClass("Lbwapi/BulletType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/BulletType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Melee", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Melee)); +tableBulletType.insert(std::pair(BulletTypes::Melee.getID(), &BulletTypes::Melee)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fusion_Cutter_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Fusion_Cutter_Hit)); +tableBulletType.insert(std::pair(BulletTypes::Fusion_Cutter_Hit.getID(), &BulletTypes::Fusion_Cutter_Hit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gauss_Rifle_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Gauss_Rifle_Hit)); +tableBulletType.insert(std::pair(BulletTypes::Gauss_Rifle_Hit.getID(), &BulletTypes::Gauss_Rifle_Hit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::C_10_Canister_Rifle_Hit)); +tableBulletType.insert(std::pair(BulletTypes::C_10_Canister_Rifle_Hit.getID(), &BulletTypes::C_10_Canister_Rifle_Hit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gemini_Missiles", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Gemini_Missiles)); +tableBulletType.insert(std::pair(BulletTypes::Gemini_Missiles.getID(), &BulletTypes::Gemini_Missiles)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fragmentation_Grenade", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Fragmentation_Grenade)); +tableBulletType.insert(std::pair(BulletTypes::Fragmentation_Grenade.getID(), &BulletTypes::Fragmentation_Grenade)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Longbolt_Missile", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Longbolt_Missile)); +tableBulletType.insert(std::pair(BulletTypes::Longbolt_Missile.getID(), &BulletTypes::Longbolt_Missile)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATS_ATA_Laser_Battery", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::ATS_ATA_Laser_Battery)); +tableBulletType.insert(std::pair(BulletTypes::ATS_ATA_Laser_Battery.getID(), &BulletTypes::ATS_ATA_Laser_Battery)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burst_Lasers", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Burst_Lasers)); +tableBulletType.insert(std::pair(BulletTypes::Burst_Lasers.getID(), &BulletTypes::Burst_Lasers)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Shock_Cannon_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Arclite_Shock_Cannon_Hit)); +tableBulletType.insert(std::pair(BulletTypes::Arclite_Shock_Cannon_Hit.getID(), &BulletTypes::Arclite_Shock_Cannon_Hit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EMP_Missile", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::EMP_Missile)); +tableBulletType.insert(std::pair(BulletTypes::EMP_Missile.getID(), &BulletTypes::EMP_Missile)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dual_Photon_Blasters_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Dual_Photon_Blasters_Hit)); +tableBulletType.insert(std::pair(BulletTypes::Dual_Photon_Blasters_Hit.getID(), &BulletTypes::Dual_Photon_Blasters_Hit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Particle_Beam_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Particle_Beam_Hit)); +tableBulletType.insert(std::pair(BulletTypes::Particle_Beam_Hit.getID(), &BulletTypes::Particle_Beam_Hit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anti_Matter_Missile", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Anti_Matter_Missile)); +tableBulletType.insert(std::pair(BulletTypes::Anti_Matter_Missile.getID(), &BulletTypes::Anti_Matter_Missile)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Pulse_Cannon", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Pulse_Cannon)); +tableBulletType.insert(std::pair(BulletTypes::Pulse_Cannon.getID(), &BulletTypes::Pulse_Cannon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Shockwave_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Psionic_Shockwave_Hit)); +tableBulletType.insert(std::pair(BulletTypes::Psionic_Shockwave_Hit.getID(), &BulletTypes::Psionic_Shockwave_Hit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Storm", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Psionic_Storm)); +tableBulletType.insert(std::pair(BulletTypes::Psionic_Storm.getID(), &BulletTypes::Psionic_Storm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Yamato_Gun", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Yamato_Gun)); +tableBulletType.insert(std::pair(BulletTypes::Yamato_Gun.getID(), &BulletTypes::Yamato_Gun)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Phase_Disruptor)); +tableBulletType.insert(std::pair(BulletTypes::Phase_Disruptor.getID(), &BulletTypes::Phase_Disruptor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "STA_STS_Cannon_Overlay", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::STA_STS_Cannon_Overlay)); +tableBulletType.insert(std::pair(BulletTypes::STA_STS_Cannon_Overlay.getID(), &BulletTypes::STA_STS_Cannon_Overlay)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Sunken_Colony_Tentacle", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Sunken_Colony_Tentacle)); +tableBulletType.insert(std::pair(BulletTypes::Sunken_Colony_Tentacle.getID(), &BulletTypes::Sunken_Colony_Tentacle)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Acid_Spore", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Acid_Spore)); +tableBulletType.insert(std::pair(BulletTypes::Acid_Spore.getID(), &BulletTypes::Acid_Spore)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Glave_Wurm", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Glave_Wurm)); +tableBulletType.insert(std::pair(BulletTypes::Glave_Wurm.getID(), &BulletTypes::Glave_Wurm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Seeker_Spores", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Seeker_Spores)); +tableBulletType.insert(std::pair(BulletTypes::Seeker_Spores.getID(), &BulletTypes::Seeker_Spores)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Queen_Spell_Carrier", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Queen_Spell_Carrier)); +tableBulletType.insert(std::pair(BulletTypes::Queen_Spell_Carrier.getID(), &BulletTypes::Queen_Spell_Carrier)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Plague_Cloud", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Plague_Cloud)); +tableBulletType.insert(std::pair(BulletTypes::Plague_Cloud.getID(), &BulletTypes::Plague_Cloud)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Consume", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Consume)); +tableBulletType.insert(std::pair(BulletTypes::Consume.getID(), &BulletTypes::Consume)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ensnare", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Ensnare)); +tableBulletType.insert(std::pair(BulletTypes::Ensnare.getID(), &BulletTypes::Ensnare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Needle_Spine_Hit", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Needle_Spine_Hit)); +tableBulletType.insert(std::pair(BulletTypes::Needle_Spine_Hit.getID(), &BulletTypes::Needle_Spine_Hit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Invisible", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Invisible)); +tableBulletType.insert(std::pair(BulletTypes::Invisible.getID(), &BulletTypes::Invisible)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Optical_Flare_Grenade", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Optical_Flare_Grenade)); +tableBulletType.insert(std::pair(BulletTypes::Optical_Flare_Grenade.getID(), &BulletTypes::Optical_Flare_Grenade)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Halo_Rockets", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Halo_Rockets)); +tableBulletType.insert(std::pair(BulletTypes::Halo_Rockets.getID(), &BulletTypes::Halo_Rockets)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Subterranean_Spines", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Subterranean_Spines)); +tableBulletType.insert(std::pair(BulletTypes::Subterranean_Spines.getID(), &BulletTypes::Subterranean_Spines)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Corrosive_Acid_Shot", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Corrosive_Acid_Shot)); +tableBulletType.insert(std::pair(BulletTypes::Corrosive_Acid_Shot.getID(), &BulletTypes::Corrosive_Acid_Shot)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Neutron_Flare", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Neutron_Flare)); +tableBulletType.insert(std::pair(BulletTypes::Neutron_Flare.getID(), &BulletTypes::Neutron_Flare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::None)); +tableBulletType.insert(std::pair(BulletTypes::None.getID(), &BulletTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/BulletType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&BulletTypes::Unknown)); +tableBulletType.insert(std::pair(BulletTypes::Unknown.getID(), &BulletTypes::Unknown)); cls = env->FindClass("Lbwapi/Color;"); getId = env->GetMethodID(cls,"", "(III)V"); env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Red", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Red.red(), Colors::Red.green(), Colors::Red.blue())); @@ -4568,6 +4973,1436 @@ env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Green", "Lbwapi/Color env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cyan", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Cyan.red(), Colors::Cyan.green(), Colors::Cyan.blue())); env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Black", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Black.red(), Colors::Black.green(), Colors::Black.blue())); env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Grey", "Lbwapi/Color;"), env->NewObject(cls, getId, Colors::Grey.red(), Colors::Grey.green(), Colors::Grey.blue())); +cls = env->FindClass("Lbwapi/DamageType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/DamageType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Independent", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Independent)); +tableDamageType.insert(std::pair(DamageTypes::Independent.getID(), &DamageTypes::Independent)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Explosive", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Explosive)); +tableDamageType.insert(std::pair(DamageTypes::Explosive.getID(), &DamageTypes::Explosive)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Concussive", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Concussive)); +tableDamageType.insert(std::pair(DamageTypes::Concussive.getID(), &DamageTypes::Concussive)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Normal", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Normal)); +tableDamageType.insert(std::pair(DamageTypes::Normal.getID(), &DamageTypes::Normal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ignore_Armor", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Ignore_Armor)); +tableDamageType.insert(std::pair(DamageTypes::Ignore_Armor.getID(), &DamageTypes::Ignore_Armor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::None)); +tableDamageType.insert(std::pair(DamageTypes::None.getID(), &DamageTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/DamageType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&DamageTypes::Unknown)); +tableDamageType.insert(std::pair(DamageTypes::Unknown.getID(), &DamageTypes::Unknown)); +cls = env->FindClass("Lbwapi/Error;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/Error;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unit_Does_Not_Exist", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unit_Does_Not_Exist)); +tableError.insert(std::pair(Errors::Unit_Does_Not_Exist.getID(), &Errors::Unit_Does_Not_Exist)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unit_Not_Visible", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unit_Not_Visible)); +tableError.insert(std::pair(Errors::Unit_Not_Visible.getID(), &Errors::Unit_Not_Visible)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unit_Not_Owned", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unit_Not_Owned)); +tableError.insert(std::pair(Errors::Unit_Not_Owned.getID(), &Errors::Unit_Not_Owned)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unit_Busy", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unit_Busy)); +tableError.insert(std::pair(Errors::Unit_Busy.getID(), &Errors::Unit_Busy)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Incompatible_UnitType", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Incompatible_UnitType)); +tableError.insert(std::pair(Errors::Incompatible_UnitType.getID(), &Errors::Incompatible_UnitType)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Incompatible_TechType", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Incompatible_TechType)); +tableError.insert(std::pair(Errors::Incompatible_TechType.getID(), &Errors::Incompatible_TechType)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Incompatible_State", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Incompatible_State)); +tableError.insert(std::pair(Errors::Incompatible_State.getID(), &Errors::Incompatible_State)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Already_Researched", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Already_Researched)); +tableError.insert(std::pair(Errors::Already_Researched.getID(), &Errors::Already_Researched)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fully_Upgraded", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Fully_Upgraded)); +tableError.insert(std::pair(Errors::Fully_Upgraded.getID(), &Errors::Fully_Upgraded)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Currently_Researching", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Currently_Researching)); +tableError.insert(std::pair(Errors::Currently_Researching.getID(), &Errors::Currently_Researching)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Currently_Upgrading", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Currently_Upgrading)); +tableError.insert(std::pair(Errors::Currently_Upgrading.getID(), &Errors::Currently_Upgrading)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Minerals", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Minerals)); +tableError.insert(std::pair(Errors::Insufficient_Minerals.getID(), &Errors::Insufficient_Minerals)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Gas", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Gas)); +tableError.insert(std::pair(Errors::Insufficient_Gas.getID(), &Errors::Insufficient_Gas)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Supply", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Supply)); +tableError.insert(std::pair(Errors::Insufficient_Supply.getID(), &Errors::Insufficient_Supply)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Energy", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Energy)); +tableError.insert(std::pair(Errors::Insufficient_Energy.getID(), &Errors::Insufficient_Energy)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Tech", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Tech)); +tableError.insert(std::pair(Errors::Insufficient_Tech.getID(), &Errors::Insufficient_Tech)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Ammo", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Ammo)); +tableError.insert(std::pair(Errors::Insufficient_Ammo.getID(), &Errors::Insufficient_Ammo)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Insufficient_Space", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Insufficient_Space)); +tableError.insert(std::pair(Errors::Insufficient_Space.getID(), &Errors::Insufficient_Space)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Invalid_Tile_Position", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Invalid_Tile_Position)); +tableError.insert(std::pair(Errors::Invalid_Tile_Position.getID(), &Errors::Invalid_Tile_Position)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unbuildable_Location", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unbuildable_Location)); +tableError.insert(std::pair(Errors::Unbuildable_Location.getID(), &Errors::Unbuildable_Location)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unreachable_Location", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unreachable_Location)); +tableError.insert(std::pair(Errors::Unreachable_Location.getID(), &Errors::Unreachable_Location)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Out_Of_Range", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Out_Of_Range)); +tableError.insert(std::pair(Errors::Out_Of_Range.getID(), &Errors::Out_Of_Range)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unable_To_Hit", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unable_To_Hit)); +tableError.insert(std::pair(Errors::Unable_To_Hit.getID(), &Errors::Unable_To_Hit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Access_Denied", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Access_Denied)); +tableError.insert(std::pair(Errors::Access_Denied.getID(), &Errors::Access_Denied)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "File_Not_Found", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::File_Not_Found)); +tableError.insert(std::pair(Errors::File_Not_Found.getID(), &Errors::File_Not_Found)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Invalid_Parameter", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Invalid_Parameter)); +tableError.insert(std::pair(Errors::Invalid_Parameter.getID(), &Errors::Invalid_Parameter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::None)); +tableError.insert(std::pair(Errors::None.getID(), &Errors::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/Error;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Errors::Unknown)); +tableError.insert(std::pair(Errors::Unknown.getID(), &Errors::Unknown)); +cls = env->FindClass("Lbwapi/ExplosionType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/ExplosionType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::None)); +tableExplosionType.insert(std::pair(ExplosionTypes::None.getID(), &ExplosionTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Normal", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Normal)); +tableExplosionType.insert(std::pair(ExplosionTypes::Normal.getID(), &ExplosionTypes::Normal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Radial_Splash", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Radial_Splash)); +tableExplosionType.insert(std::pair(ExplosionTypes::Radial_Splash.getID(), &ExplosionTypes::Radial_Splash)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Enemy_Splash", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Enemy_Splash)); +tableExplosionType.insert(std::pair(ExplosionTypes::Enemy_Splash.getID(), &ExplosionTypes::Enemy_Splash)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lockdown", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Lockdown)); +tableExplosionType.insert(std::pair(ExplosionTypes::Lockdown.getID(), &ExplosionTypes::Lockdown)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Nuclear_Missile", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Nuclear_Missile)); +tableExplosionType.insert(std::pair(ExplosionTypes::Nuclear_Missile.getID(), &ExplosionTypes::Nuclear_Missile)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Parasite", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Parasite)); +tableExplosionType.insert(std::pair(ExplosionTypes::Parasite.getID(), &ExplosionTypes::Parasite)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Broodlings", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Broodlings)); +tableExplosionType.insert(std::pair(ExplosionTypes::Broodlings.getID(), &ExplosionTypes::Broodlings)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EMP_Shockwave", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::EMP_Shockwave)); +tableExplosionType.insert(std::pair(ExplosionTypes::EMP_Shockwave.getID(), &ExplosionTypes::EMP_Shockwave)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Irradiate", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Irradiate)); +tableExplosionType.insert(std::pair(ExplosionTypes::Irradiate.getID(), &ExplosionTypes::Irradiate)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ensnare", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Ensnare)); +tableExplosionType.insert(std::pair(ExplosionTypes::Ensnare.getID(), &ExplosionTypes::Ensnare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Plague", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Plague)); +tableExplosionType.insert(std::pair(ExplosionTypes::Plague.getID(), &ExplosionTypes::Plague)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stasis_Field", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Stasis_Field)); +tableExplosionType.insert(std::pair(ExplosionTypes::Stasis_Field.getID(), &ExplosionTypes::Stasis_Field)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dark_Swarm", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Dark_Swarm)); +tableExplosionType.insert(std::pair(ExplosionTypes::Dark_Swarm.getID(), &ExplosionTypes::Dark_Swarm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Consume", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Consume)); +tableExplosionType.insert(std::pair(ExplosionTypes::Consume.getID(), &ExplosionTypes::Consume)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Yamato_Gun", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Yamato_Gun)); +tableExplosionType.insert(std::pair(ExplosionTypes::Yamato_Gun.getID(), &ExplosionTypes::Yamato_Gun)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Restoration", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Restoration)); +tableExplosionType.insert(std::pair(ExplosionTypes::Restoration.getID(), &ExplosionTypes::Restoration)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Disruption_Web", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Disruption_Web)); +tableExplosionType.insert(std::pair(ExplosionTypes::Disruption_Web.getID(), &ExplosionTypes::Disruption_Web)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Corrosive_Acid", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Corrosive_Acid)); +tableExplosionType.insert(std::pair(ExplosionTypes::Corrosive_Acid.getID(), &ExplosionTypes::Corrosive_Acid)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Mind_Control", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Mind_Control)); +tableExplosionType.insert(std::pair(ExplosionTypes::Mind_Control.getID(), &ExplosionTypes::Mind_Control)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Feedback", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Feedback)); +tableExplosionType.insert(std::pair(ExplosionTypes::Feedback.getID(), &ExplosionTypes::Feedback)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Optical_Flare", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Optical_Flare)); +tableExplosionType.insert(std::pair(ExplosionTypes::Optical_Flare.getID(), &ExplosionTypes::Optical_Flare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Maelstrom", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Maelstrom)); +tableExplosionType.insert(std::pair(ExplosionTypes::Maelstrom.getID(), &ExplosionTypes::Maelstrom)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Air_Splash", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Air_Splash)); +tableExplosionType.insert(std::pair(ExplosionTypes::Air_Splash.getID(), &ExplosionTypes::Air_Splash)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/ExplosionType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&ExplosionTypes::Unknown)); +tableExplosionType.insert(std::pair(ExplosionTypes::Unknown.getID(), &ExplosionTypes::Unknown)); +cls = env->FindClass("Lbwapi/GameType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/GameType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Melee", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Melee)); +tableGameType.insert(std::pair(GameTypes::Melee.getID(), &GameTypes::Melee)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Free_For_All", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Free_For_All)); +tableGameType.insert(std::pair(GameTypes::Free_For_All.getID(), &GameTypes::Free_For_All)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "One_on_One", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::One_on_One)); +tableGameType.insert(std::pair(GameTypes::One_on_One.getID(), &GameTypes::One_on_One)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Capture_The_Flag", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Capture_The_Flag)); +tableGameType.insert(std::pair(GameTypes::Capture_The_Flag.getID(), &GameTypes::Capture_The_Flag)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Greed", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Greed)); +tableGameType.insert(std::pair(GameTypes::Greed.getID(), &GameTypes::Greed)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Slaughter", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Slaughter)); +tableGameType.insert(std::pair(GameTypes::Slaughter.getID(), &GameTypes::Slaughter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Sudden_Death", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Sudden_Death)); +tableGameType.insert(std::pair(GameTypes::Sudden_Death.getID(), &GameTypes::Sudden_Death)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ladder", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Ladder)); +tableGameType.insert(std::pair(GameTypes::Ladder.getID(), &GameTypes::Ladder)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Use_Map_Settings", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Use_Map_Settings)); +tableGameType.insert(std::pair(GameTypes::Use_Map_Settings.getID(), &GameTypes::Use_Map_Settings)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Team_Melee", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Team_Melee)); +tableGameType.insert(std::pair(GameTypes::Team_Melee.getID(), &GameTypes::Team_Melee)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Team_Free_For_All", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Team_Free_For_All)); +tableGameType.insert(std::pair(GameTypes::Team_Free_For_All.getID(), &GameTypes::Team_Free_For_All)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Team_Capture_The_Flag", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Team_Capture_The_Flag)); +tableGameType.insert(std::pair(GameTypes::Team_Capture_The_Flag.getID(), &GameTypes::Team_Capture_The_Flag)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Top_vs_Bottom", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Top_vs_Bottom)); +tableGameType.insert(std::pair(GameTypes::Top_vs_Bottom.getID(), &GameTypes::Top_vs_Bottom)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::None)); +tableGameType.insert(std::pair(GameTypes::None.getID(), &GameTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/GameType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&GameTypes::Unknown)); +tableGameType.insert(std::pair(GameTypes::Unknown.getID(), &GameTypes::Unknown)); +cls = env->FindClass("Lbwapi/Order;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/Order;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Die", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Die)); +tableOrder.insert(std::pair(Orders::Die.getID(), &Orders::Die)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stop", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Stop)); +tableOrder.insert(std::pair(Orders::Stop.getID(), &Orders::Stop)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Guard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Guard)); +tableOrder.insert(std::pair(Orders::Guard.getID(), &Orders::Guard)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlayerGuard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PlayerGuard)); +tableOrder.insert(std::pair(Orders::PlayerGuard.getID(), &Orders::PlayerGuard)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "TurretGuard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::TurretGuard)); +tableOrder.insert(std::pair(Orders::TurretGuard.getID(), &Orders::TurretGuard)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BunkerGuard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BunkerGuard)); +tableOrder.insert(std::pair(Orders::BunkerGuard.getID(), &Orders::BunkerGuard)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Move", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Move)); +tableOrder.insert(std::pair(Orders::Move.getID(), &Orders::Move)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AttackUnit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AttackUnit)); +tableOrder.insert(std::pair(Orders::AttackUnit.getID(), &Orders::AttackUnit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AttackTile", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AttackTile)); +tableOrder.insert(std::pair(Orders::AttackTile.getID(), &Orders::AttackTile)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hover", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Hover)); +tableOrder.insert(std::pair(Orders::Hover.getID(), &Orders::Hover)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AttackMove", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AttackMove)); +tableOrder.insert(std::pair(Orders::AttackMove.getID(), &Orders::AttackMove)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InfestedCommandCenter", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InfestedCommandCenter)); +tableOrder.insert(std::pair(Orders::InfestedCommandCenter.getID(), &Orders::InfestedCommandCenter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "UnusedNothing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::UnusedNothing)); +tableOrder.insert(std::pair(Orders::UnusedNothing.getID(), &Orders::UnusedNothing)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "UnusedPowerup", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::UnusedPowerup)); +tableOrder.insert(std::pair(Orders::UnusedPowerup.getID(), &Orders::UnusedPowerup)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "TowerGuard", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::TowerGuard)); +tableOrder.insert(std::pair(Orders::TowerGuard.getID(), &Orders::TowerGuard)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "VultureMine", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::VultureMine)); +tableOrder.insert(std::pair(Orders::VultureMine.getID(), &Orders::VultureMine)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Nothing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Nothing)); +tableOrder.insert(std::pair(Orders::Nothing.getID(), &Orders::Nothing)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastInfestation", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastInfestation)); +tableOrder.insert(std::pair(Orders::CastInfestation.getID(), &Orders::CastInfestation)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InfestingCommandCenter", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InfestingCommandCenter)); +tableOrder.insert(std::pair(Orders::InfestingCommandCenter.getID(), &Orders::InfestingCommandCenter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlaceBuilding", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PlaceBuilding)); +tableOrder.insert(std::pair(Orders::PlaceBuilding.getID(), &Orders::PlaceBuilding)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CreateProtossBuilding", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CreateProtossBuilding)); +tableOrder.insert(std::pair(Orders::CreateProtossBuilding.getID(), &Orders::CreateProtossBuilding)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ConstructingBuilding", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ConstructingBuilding)); +tableOrder.insert(std::pair(Orders::ConstructingBuilding.getID(), &Orders::ConstructingBuilding)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Repair", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Repair)); +tableOrder.insert(std::pair(Orders::Repair.getID(), &Orders::Repair)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlaceAddon", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PlaceAddon)); +tableOrder.insert(std::pair(Orders::PlaceAddon.getID(), &Orders::PlaceAddon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BuildAddon", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BuildAddon)); +tableOrder.insert(std::pair(Orders::BuildAddon.getID(), &Orders::BuildAddon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Train", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Train)); +tableOrder.insert(std::pair(Orders::Train.getID(), &Orders::Train)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RallyPointUnit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RallyPointUnit)); +tableOrder.insert(std::pair(Orders::RallyPointUnit.getID(), &Orders::RallyPointUnit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RallyPointTile", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RallyPointTile)); +tableOrder.insert(std::pair(Orders::RallyPointTile.getID(), &Orders::RallyPointTile)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ZergBirth", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ZergBirth)); +tableOrder.insert(std::pair(Orders::ZergBirth.getID(), &Orders::ZergBirth)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ZergUnitMorph", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ZergUnitMorph)); +tableOrder.insert(std::pair(Orders::ZergUnitMorph.getID(), &Orders::ZergUnitMorph)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ZergBuildingMorph", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ZergBuildingMorph)); +tableOrder.insert(std::pair(Orders::ZergBuildingMorph.getID(), &Orders::ZergBuildingMorph)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "IncompleteBuilding", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::IncompleteBuilding)); +tableOrder.insert(std::pair(Orders::IncompleteBuilding.getID(), &Orders::IncompleteBuilding)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BuildNydusExit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BuildNydusExit)); +tableOrder.insert(std::pair(Orders::BuildNydusExit.getID(), &Orders::BuildNydusExit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EnterNydusCanal", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::EnterNydusCanal)); +tableOrder.insert(std::pair(Orders::EnterNydusCanal.getID(), &Orders::EnterNydusCanal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Follow", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Follow)); +tableOrder.insert(std::pair(Orders::Follow.getID(), &Orders::Follow)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Carrier", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Carrier)); +tableOrder.insert(std::pair(Orders::Carrier.getID(), &Orders::Carrier)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ReaverCarrierMove", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ReaverCarrierMove)); +tableOrder.insert(std::pair(Orders::ReaverCarrierMove.getID(), &Orders::ReaverCarrierMove)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CarrierIgnore2", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CarrierIgnore2)); +tableOrder.insert(std::pair(Orders::CarrierIgnore2.getID(), &Orders::CarrierIgnore2)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Reaver", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Reaver)); +tableOrder.insert(std::pair(Orders::Reaver.getID(), &Orders::Reaver)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "TrainFighter", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::TrainFighter)); +tableOrder.insert(std::pair(Orders::TrainFighter.getID(), &Orders::TrainFighter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InterceptorAttack", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InterceptorAttack)); +tableOrder.insert(std::pair(Orders::InterceptorAttack.getID(), &Orders::InterceptorAttack)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ScarabAttack", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ScarabAttack)); +tableOrder.insert(std::pair(Orders::ScarabAttack.getID(), &Orders::ScarabAttack)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RechargeShieldsUnit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RechargeShieldsUnit)); +tableOrder.insert(std::pair(Orders::RechargeShieldsUnit.getID(), &Orders::RechargeShieldsUnit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RechargeShieldsBattery", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RechargeShieldsBattery)); +tableOrder.insert(std::pair(Orders::RechargeShieldsBattery.getID(), &Orders::RechargeShieldsBattery)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ShieldBattery", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ShieldBattery)); +tableOrder.insert(std::pair(Orders::ShieldBattery.getID(), &Orders::ShieldBattery)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InterceptorReturn", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InterceptorReturn)); +tableOrder.insert(std::pair(Orders::InterceptorReturn.getID(), &Orders::InterceptorReturn)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BuildingLand", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BuildingLand)); +tableOrder.insert(std::pair(Orders::BuildingLand.getID(), &Orders::BuildingLand)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "BuildingLiftOff", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::BuildingLiftOff)); +tableOrder.insert(std::pair(Orders::BuildingLiftOff.getID(), &Orders::BuildingLiftOff)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "DroneLiftOff", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::DroneLiftOff)); +tableOrder.insert(std::pair(Orders::DroneLiftOff.getID(), &Orders::DroneLiftOff)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "LiftingOff", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::LiftingOff)); +tableOrder.insert(std::pair(Orders::LiftingOff.getID(), &Orders::LiftingOff)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ResearchTech", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ResearchTech)); +tableOrder.insert(std::pair(Orders::ResearchTech.getID(), &Orders::ResearchTech)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Upgrade", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Upgrade)); +tableOrder.insert(std::pair(Orders::Upgrade.getID(), &Orders::Upgrade)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Larva", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Larva)); +tableOrder.insert(std::pair(Orders::Larva.getID(), &Orders::Larva)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "SpawningLarva", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::SpawningLarva)); +tableOrder.insert(std::pair(Orders::SpawningLarva.getID(), &Orders::SpawningLarva)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Harvest1", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Harvest1)); +tableOrder.insert(std::pair(Orders::Harvest1.getID(), &Orders::Harvest1)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Harvest2", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Harvest2)); +tableOrder.insert(std::pair(Orders::Harvest2.getID(), &Orders::Harvest2)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MoveToGas", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MoveToGas)); +tableOrder.insert(std::pair(Orders::MoveToGas.getID(), &Orders::MoveToGas)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "WaitForGas", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::WaitForGas)); +tableOrder.insert(std::pair(Orders::WaitForGas.getID(), &Orders::WaitForGas)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HarvestGas", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HarvestGas)); +tableOrder.insert(std::pair(Orders::HarvestGas.getID(), &Orders::HarvestGas)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ReturnGas", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ReturnGas)); +tableOrder.insert(std::pair(Orders::ReturnGas.getID(), &Orders::ReturnGas)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MoveToMinerals", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MoveToMinerals)); +tableOrder.insert(std::pair(Orders::MoveToMinerals.getID(), &Orders::MoveToMinerals)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "WaitForMinerals", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::WaitForMinerals)); +tableOrder.insert(std::pair(Orders::WaitForMinerals.getID(), &Orders::WaitForMinerals)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MiningMinerals", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MiningMinerals)); +tableOrder.insert(std::pair(Orders::MiningMinerals.getID(), &Orders::MiningMinerals)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Harvest3", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Harvest3)); +tableOrder.insert(std::pair(Orders::Harvest3.getID(), &Orders::Harvest3)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Harvest4", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Harvest4)); +tableOrder.insert(std::pair(Orders::Harvest4.getID(), &Orders::Harvest4)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ReturnMinerals", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ReturnMinerals)); +tableOrder.insert(std::pair(Orders::ReturnMinerals.getID(), &Orders::ReturnMinerals)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Interrupted", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Interrupted)); +tableOrder.insert(std::pair(Orders::Interrupted.getID(), &Orders::Interrupted)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EnterTransport", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::EnterTransport)); +tableOrder.insert(std::pair(Orders::EnterTransport.getID(), &Orders::EnterTransport)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PickupIdle", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PickupIdle)); +tableOrder.insert(std::pair(Orders::PickupIdle.getID(), &Orders::PickupIdle)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PickupTransport", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PickupTransport)); +tableOrder.insert(std::pair(Orders::PickupTransport.getID(), &Orders::PickupTransport)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PickupBunker", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PickupBunker)); +tableOrder.insert(std::pair(Orders::PickupBunker.getID(), &Orders::PickupBunker)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Pickup4", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Pickup4)); +tableOrder.insert(std::pair(Orders::Pickup4.getID(), &Orders::Pickup4)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PowerupIdle", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PowerupIdle)); +tableOrder.insert(std::pair(Orders::PowerupIdle.getID(), &Orders::PowerupIdle)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Sieging", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Sieging)); +tableOrder.insert(std::pair(Orders::Sieging.getID(), &Orders::Sieging)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unsieging", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Unsieging)); +tableOrder.insert(std::pair(Orders::Unsieging.getID(), &Orders::Unsieging)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "InitCreepGrowth", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::InitCreepGrowth)); +tableOrder.insert(std::pair(Orders::InitCreepGrowth.getID(), &Orders::InitCreepGrowth)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "SpreadCreep", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::SpreadCreep)); +tableOrder.insert(std::pair(Orders::SpreadCreep.getID(), &Orders::SpreadCreep)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "StoppingCreepGrowth", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::StoppingCreepGrowth)); +tableOrder.insert(std::pair(Orders::StoppingCreepGrowth.getID(), &Orders::StoppingCreepGrowth)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "GuardianAspect", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::GuardianAspect)); +tableOrder.insert(std::pair(Orders::GuardianAspect.getID(), &Orders::GuardianAspect)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ArchonWarp", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ArchonWarp)); +tableOrder.insert(std::pair(Orders::ArchonWarp.getID(), &Orders::ArchonWarp)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CompletingArchonSummon", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CompletingArchonSummon)); +tableOrder.insert(std::pair(Orders::CompletingArchonSummon.getID(), &Orders::CompletingArchonSummon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HoldPosition", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HoldPosition)); +tableOrder.insert(std::pair(Orders::HoldPosition.getID(), &Orders::HoldPosition)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cloak", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Cloak)); +tableOrder.insert(std::pair(Orders::Cloak.getID(), &Orders::Cloak)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Decloak", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Decloak)); +tableOrder.insert(std::pair(Orders::Decloak.getID(), &Orders::Decloak)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unload", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Unload)); +tableOrder.insert(std::pair(Orders::Unload.getID(), &Orders::Unload)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MoveUnload", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MoveUnload)); +tableOrder.insert(std::pair(Orders::MoveUnload.getID(), &Orders::MoveUnload)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "FireYamatoGun", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::FireYamatoGun)); +tableOrder.insert(std::pair(Orders::FireYamatoGun.getID(), &Orders::FireYamatoGun)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastLockdown", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastLockdown)); +tableOrder.insert(std::pair(Orders::CastLockdown.getID(), &Orders::CastLockdown)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burrowing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Burrowing)); +tableOrder.insert(std::pair(Orders::Burrowing.getID(), &Orders::Burrowing)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burrowed", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Burrowed)); +tableOrder.insert(std::pair(Orders::Burrowed.getID(), &Orders::Burrowed)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unburrowing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Unburrowing)); +tableOrder.insert(std::pair(Orders::Unburrowing.getID(), &Orders::Unburrowing)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastDarkSwarm", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastDarkSwarm)); +tableOrder.insert(std::pair(Orders::CastDarkSwarm.getID(), &Orders::CastDarkSwarm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastParasite", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastParasite)); +tableOrder.insert(std::pair(Orders::CastParasite.getID(), &Orders::CastParasite)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastSpawnBroodlings", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastSpawnBroodlings)); +tableOrder.insert(std::pair(Orders::CastSpawnBroodlings.getID(), &Orders::CastSpawnBroodlings)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastEMPShockwave", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastEMPShockwave)); +tableOrder.insert(std::pair(Orders::CastEMPShockwave.getID(), &Orders::CastEMPShockwave)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeWait", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeWait)); +tableOrder.insert(std::pair(Orders::NukeWait.getID(), &Orders::NukeWait)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeTrain", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeTrain)); +tableOrder.insert(std::pair(Orders::NukeTrain.getID(), &Orders::NukeTrain)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeLaunch", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeLaunch)); +tableOrder.insert(std::pair(Orders::NukeLaunch.getID(), &Orders::NukeLaunch)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukePaint", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukePaint)); +tableOrder.insert(std::pair(Orders::NukePaint.getID(), &Orders::NukePaint)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeUnit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeUnit)); +tableOrder.insert(std::pair(Orders::NukeUnit.getID(), &Orders::NukeUnit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastNuclearStrike", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastNuclearStrike)); +tableOrder.insert(std::pair(Orders::CastNuclearStrike.getID(), &Orders::CastNuclearStrike)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "NukeTrack", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::NukeTrack)); +tableOrder.insert(std::pair(Orders::NukeTrack.getID(), &Orders::NukeTrack)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CloakNearbyUnits", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CloakNearbyUnits)); +tableOrder.insert(std::pair(Orders::CloakNearbyUnits.getID(), &Orders::CloakNearbyUnits)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlaceMine", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::PlaceMine)); +tableOrder.insert(std::pair(Orders::PlaceMine.getID(), &Orders::PlaceMine)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RightClickAction", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RightClickAction)); +tableOrder.insert(std::pair(Orders::RightClickAction.getID(), &Orders::RightClickAction)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastRecall", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastRecall)); +tableOrder.insert(std::pair(Orders::CastRecall.getID(), &Orders::CastRecall)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Teleport", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Teleport)); +tableOrder.insert(std::pair(Orders::Teleport.getID(), &Orders::Teleport)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastScannerSweep", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastScannerSweep)); +tableOrder.insert(std::pair(Orders::CastScannerSweep.getID(), &Orders::CastScannerSweep)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Scanner", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Scanner)); +tableOrder.insert(std::pair(Orders::Scanner.getID(), &Orders::Scanner)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastDefensiveMatrix", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastDefensiveMatrix)); +tableOrder.insert(std::pair(Orders::CastDefensiveMatrix.getID(), &Orders::CastDefensiveMatrix)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastPsionicStorm", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastPsionicStorm)); +tableOrder.insert(std::pair(Orders::CastPsionicStorm.getID(), &Orders::CastPsionicStorm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastIrradiate", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastIrradiate)); +tableOrder.insert(std::pair(Orders::CastIrradiate.getID(), &Orders::CastIrradiate)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastPlague", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastPlague)); +tableOrder.insert(std::pair(Orders::CastPlague.getID(), &Orders::CastPlague)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastConsume", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastConsume)); +tableOrder.insert(std::pair(Orders::CastConsume.getID(), &Orders::CastConsume)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastEnsnare", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastEnsnare)); +tableOrder.insert(std::pair(Orders::CastEnsnare.getID(), &Orders::CastEnsnare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastStasisField", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastStasisField)); +tableOrder.insert(std::pair(Orders::CastStasisField.getID(), &Orders::CastStasisField)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastHallucination", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastHallucination)); +tableOrder.insert(std::pair(Orders::CastHallucination.getID(), &Orders::CastHallucination)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hallucination2", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Hallucination2)); +tableOrder.insert(std::pair(Orders::Hallucination2.getID(), &Orders::Hallucination2)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ResetCollision", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ResetCollision)); +tableOrder.insert(std::pair(Orders::ResetCollision.getID(), &Orders::ResetCollision)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Patrol", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Patrol)); +tableOrder.insert(std::pair(Orders::Patrol.getID(), &Orders::Patrol)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CTFCOPInit", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CTFCOPInit)); +tableOrder.insert(std::pair(Orders::CTFCOPInit.getID(), &Orders::CTFCOPInit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CTFCOPStarted", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CTFCOPStarted)); +tableOrder.insert(std::pair(Orders::CTFCOPStarted.getID(), &Orders::CTFCOPStarted)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CTFCOP2", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CTFCOP2)); +tableOrder.insert(std::pair(Orders::CTFCOP2.getID(), &Orders::CTFCOP2)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ComputerAI", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ComputerAI)); +tableOrder.insert(std::pair(Orders::ComputerAI.getID(), &Orders::ComputerAI)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AtkMoveEP", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AtkMoveEP)); +tableOrder.insert(std::pair(Orders::AtkMoveEP.getID(), &Orders::AtkMoveEP)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HarassMove", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HarassMove)); +tableOrder.insert(std::pair(Orders::HarassMove.getID(), &Orders::HarassMove)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AIPatrol", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::AIPatrol)); +tableOrder.insert(std::pair(Orders::AIPatrol.getID(), &Orders::AIPatrol)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "GuardPost", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::GuardPost)); +tableOrder.insert(std::pair(Orders::GuardPost.getID(), &Orders::GuardPost)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RescuePassive", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RescuePassive)); +tableOrder.insert(std::pair(Orders::RescuePassive.getID(), &Orders::RescuePassive)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Neutral", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Neutral)); +tableOrder.insert(std::pair(Orders::Neutral.getID(), &Orders::Neutral)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ComputerReturn", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::ComputerReturn)); +tableOrder.insert(std::pair(Orders::ComputerReturn.getID(), &Orders::ComputerReturn)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "SelfDestructing", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::SelfDestructing)); +tableOrder.insert(std::pair(Orders::SelfDestructing.getID(), &Orders::SelfDestructing)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Critter)); +tableOrder.insert(std::pair(Orders::Critter.getID(), &Orders::Critter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HiddenGun", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HiddenGun)); +tableOrder.insert(std::pair(Orders::HiddenGun.getID(), &Orders::HiddenGun)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "OpenDoor", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::OpenDoor)); +tableOrder.insert(std::pair(Orders::OpenDoor.getID(), &Orders::OpenDoor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CloseDoor", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CloseDoor)); +tableOrder.insert(std::pair(Orders::CloseDoor.getID(), &Orders::CloseDoor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HideTrap", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HideTrap)); +tableOrder.insert(std::pair(Orders::HideTrap.getID(), &Orders::HideTrap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RevealTrap", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::RevealTrap)); +tableOrder.insert(std::pair(Orders::RevealTrap.getID(), &Orders::RevealTrap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EnableDoodad", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::EnableDoodad)); +tableOrder.insert(std::pair(Orders::EnableDoodad.getID(), &Orders::EnableDoodad)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "DisableDoodad", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::DisableDoodad)); +tableOrder.insert(std::pair(Orders::DisableDoodad.getID(), &Orders::DisableDoodad)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "WarpIn", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::WarpIn)); +tableOrder.insert(std::pair(Orders::WarpIn.getID(), &Orders::WarpIn)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Medic", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Medic)); +tableOrder.insert(std::pair(Orders::Medic.getID(), &Orders::Medic)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MedicHeal", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MedicHeal)); +tableOrder.insert(std::pair(Orders::MedicHeal.getID(), &Orders::MedicHeal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "HealMove", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::HealMove)); +tableOrder.insert(std::pair(Orders::HealMove.getID(), &Orders::HealMove)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "MedicHealToIdle", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::MedicHealToIdle)); +tableOrder.insert(std::pair(Orders::MedicHealToIdle.getID(), &Orders::MedicHealToIdle)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastRestoration", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastRestoration)); +tableOrder.insert(std::pair(Orders::CastRestoration.getID(), &Orders::CastRestoration)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastDisruptionWeb", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastDisruptionWeb)); +tableOrder.insert(std::pair(Orders::CastDisruptionWeb.getID(), &Orders::CastDisruptionWeb)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastMindControl", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastMindControl)); +tableOrder.insert(std::pair(Orders::CastMindControl.getID(), &Orders::CastMindControl)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "DarkArchonMeld", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::DarkArchonMeld)); +tableOrder.insert(std::pair(Orders::DarkArchonMeld.getID(), &Orders::DarkArchonMeld)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastFeedback", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastFeedback)); +tableOrder.insert(std::pair(Orders::CastFeedback.getID(), &Orders::CastFeedback)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastOpticalFlare", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastOpticalFlare)); +tableOrder.insert(std::pair(Orders::CastOpticalFlare.getID(), &Orders::CastOpticalFlare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "CastMaelstrom", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::CastMaelstrom)); +tableOrder.insert(std::pair(Orders::CastMaelstrom.getID(), &Orders::CastMaelstrom)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "JunkYardDog", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::JunkYardDog)); +tableOrder.insert(std::pair(Orders::JunkYardDog.getID(), &Orders::JunkYardDog)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fatal", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Fatal)); +tableOrder.insert(std::pair(Orders::Fatal.getID(), &Orders::Fatal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::None)); +tableOrder.insert(std::pair(Orders::None.getID(), &Orders::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/Order;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Orders::Unknown)); +tableOrder.insert(std::pair(Orders::Unknown.getID(), &Orders::Unknown)); +cls = env->FindClass("Lbwapi/PlayerType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/PlayerType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::None)); +tablePlayerType.insert(std::pair(PlayerTypes::None.getID(), &PlayerTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Computer", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Computer)); +tablePlayerType.insert(std::pair(PlayerTypes::Computer.getID(), &PlayerTypes::Computer)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Player", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Player)); +tablePlayerType.insert(std::pair(PlayerTypes::Player.getID(), &PlayerTypes::Player)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "RescuePassive", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::RescuePassive)); +tablePlayerType.insert(std::pair(PlayerTypes::RescuePassive.getID(), &PlayerTypes::RescuePassive)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EitherPreferComputer", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::EitherPreferComputer)); +tablePlayerType.insert(std::pair(PlayerTypes::EitherPreferComputer.getID(), &PlayerTypes::EitherPreferComputer)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EitherPreferHuman", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::EitherPreferHuman)); +tablePlayerType.insert(std::pair(PlayerTypes::EitherPreferHuman.getID(), &PlayerTypes::EitherPreferHuman)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Neutral", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Neutral)); +tablePlayerType.insert(std::pair(PlayerTypes::Neutral.getID(), &PlayerTypes::Neutral)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Closed", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Closed)); +tablePlayerType.insert(std::pair(PlayerTypes::Closed.getID(), &PlayerTypes::Closed)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "PlayerLeft", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::PlayerLeft)); +tablePlayerType.insert(std::pair(PlayerTypes::PlayerLeft.getID(), &PlayerTypes::PlayerLeft)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ComputerLeft", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::ComputerLeft)); +tablePlayerType.insert(std::pair(PlayerTypes::ComputerLeft.getID(), &PlayerTypes::ComputerLeft)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/PlayerType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&PlayerTypes::Unknown)); +tablePlayerType.insert(std::pair(PlayerTypes::Unknown.getID(), &PlayerTypes::Unknown)); +cls = env->FindClass("Lbwapi/Race;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/Race;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Zerg)); +tableRace.insert(std::pair(Races::Zerg.getID(), &Races::Zerg)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Terran)); +tableRace.insert(std::pair(Races::Terran.getID(), &Races::Terran)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Protoss)); +tableRace.insert(std::pair(Races::Protoss.getID(), &Races::Protoss)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Random", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Random)); +tableRace.insert(std::pair(Races::Random.getID(), &Races::Random)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::None)); +tableRace.insert(std::pair(Races::None.getID(), &Races::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/Race;"), env->CallStaticObjectMethod(cls, getId, (jlong)&Races::Unknown)); +tableRace.insert(std::pair(Races::Unknown.getID(), &Races::Unknown)); +cls = env->FindClass("Lbwapi/TechType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/TechType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stim_Packs", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Stim_Packs)); +tableTechType.insert(std::pair(TechTypes::Stim_Packs.getID(), &TechTypes::Stim_Packs)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lockdown", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Lockdown)); +tableTechType.insert(std::pair(TechTypes::Lockdown.getID(), &TechTypes::Lockdown)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EMP_Shockwave", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::EMP_Shockwave)); +tableTechType.insert(std::pair(TechTypes::EMP_Shockwave.getID(), &TechTypes::EMP_Shockwave)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spider_Mines", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Spider_Mines)); +tableTechType.insert(std::pair(TechTypes::Spider_Mines.getID(), &TechTypes::Spider_Mines)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Scanner_Sweep", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Scanner_Sweep)); +tableTechType.insert(std::pair(TechTypes::Scanner_Sweep.getID(), &TechTypes::Scanner_Sweep)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Tank_Siege_Mode", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Tank_Siege_Mode)); +tableTechType.insert(std::pair(TechTypes::Tank_Siege_Mode.getID(), &TechTypes::Tank_Siege_Mode)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Defensive_Matrix", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Defensive_Matrix)); +tableTechType.insert(std::pair(TechTypes::Defensive_Matrix.getID(), &TechTypes::Defensive_Matrix)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Irradiate", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Irradiate)); +tableTechType.insert(std::pair(TechTypes::Irradiate.getID(), &TechTypes::Irradiate)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Yamato_Gun", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Yamato_Gun)); +tableTechType.insert(std::pair(TechTypes::Yamato_Gun.getID(), &TechTypes::Yamato_Gun)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cloaking_Field", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Cloaking_Field)); +tableTechType.insert(std::pair(TechTypes::Cloaking_Field.getID(), &TechTypes::Cloaking_Field)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Personnel_Cloaking", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Personnel_Cloaking)); +tableTechType.insert(std::pair(TechTypes::Personnel_Cloaking.getID(), &TechTypes::Personnel_Cloaking)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burrowing", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Burrowing)); +tableTechType.insert(std::pair(TechTypes::Burrowing.getID(), &TechTypes::Burrowing)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Infestation", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Infestation)); +tableTechType.insert(std::pair(TechTypes::Infestation.getID(), &TechTypes::Infestation)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spawn_Broodlings", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Spawn_Broodlings)); +tableTechType.insert(std::pair(TechTypes::Spawn_Broodlings.getID(), &TechTypes::Spawn_Broodlings)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dark_Swarm", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Dark_Swarm)); +tableTechType.insert(std::pair(TechTypes::Dark_Swarm.getID(), &TechTypes::Dark_Swarm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Plague", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Plague)); +tableTechType.insert(std::pair(TechTypes::Plague.getID(), &TechTypes::Plague)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Consume", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Consume)); +tableTechType.insert(std::pair(TechTypes::Consume.getID(), &TechTypes::Consume)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ensnare", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Ensnare)); +tableTechType.insert(std::pair(TechTypes::Ensnare.getID(), &TechTypes::Ensnare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Parasite", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Parasite)); +tableTechType.insert(std::pair(TechTypes::Parasite.getID(), &TechTypes::Parasite)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Storm", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Psionic_Storm)); +tableTechType.insert(std::pair(TechTypes::Psionic_Storm.getID(), &TechTypes::Psionic_Storm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hallucination", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Hallucination)); +tableTechType.insert(std::pair(TechTypes::Hallucination.getID(), &TechTypes::Hallucination)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Recall", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Recall)); +tableTechType.insert(std::pair(TechTypes::Recall.getID(), &TechTypes::Recall)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stasis_Field", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Stasis_Field)); +tableTechType.insert(std::pair(TechTypes::Stasis_Field.getID(), &TechTypes::Stasis_Field)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Archon_Warp", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Archon_Warp)); +tableTechType.insert(std::pair(TechTypes::Archon_Warp.getID(), &TechTypes::Archon_Warp)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Restoration", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Restoration)); +tableTechType.insert(std::pair(TechTypes::Restoration.getID(), &TechTypes::Restoration)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Disruption_Web", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Disruption_Web)); +tableTechType.insert(std::pair(TechTypes::Disruption_Web.getID(), &TechTypes::Disruption_Web)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Mind_Control", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Mind_Control)); +tableTechType.insert(std::pair(TechTypes::Mind_Control.getID(), &TechTypes::Mind_Control)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dark_Archon_Meld", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Dark_Archon_Meld)); +tableTechType.insert(std::pair(TechTypes::Dark_Archon_Meld.getID(), &TechTypes::Dark_Archon_Meld)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Feedback", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Feedback)); +tableTechType.insert(std::pair(TechTypes::Feedback.getID(), &TechTypes::Feedback)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Optical_Flare", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Optical_Flare)); +tableTechType.insert(std::pair(TechTypes::Optical_Flare.getID(), &TechTypes::Optical_Flare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Maelstrom", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Maelstrom)); +tableTechType.insert(std::pair(TechTypes::Maelstrom.getID(), &TechTypes::Maelstrom)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lurker_Aspect", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Lurker_Aspect)); +tableTechType.insert(std::pair(TechTypes::Lurker_Aspect.getID(), &TechTypes::Lurker_Aspect)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Healing", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Healing)); +tableTechType.insert(std::pair(TechTypes::Healing.getID(), &TechTypes::Healing)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::None)); +tableTechType.insert(std::pair(TechTypes::None.getID(), &TechTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Nuclear_Strike", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Nuclear_Strike)); +tableTechType.insert(std::pair(TechTypes::Nuclear_Strike.getID(), &TechTypes::Nuclear_Strike)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/TechType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&TechTypes::Unknown)); +tableTechType.insert(std::pair(TechTypes::Unknown.getID(), &TechTypes::Unknown)); +cls = env->FindClass("Lbwapi/UnitCommandType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/UnitCommandType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Attack_Move", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Attack_Move)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Attack_Move.getID(), &UnitCommandTypes::Attack_Move)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Attack_Unit", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Attack_Unit)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Attack_Unit.getID(), &UnitCommandTypes::Attack_Unit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Build", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Build)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Build.getID(), &UnitCommandTypes::Build)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Build_Addon", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Build_Addon)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Build_Addon.getID(), &UnitCommandTypes::Build_Addon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Train", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Train)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Train.getID(), &UnitCommandTypes::Train)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Morph", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Morph)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Morph.getID(), &UnitCommandTypes::Morph)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Research", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Research)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Research.getID(), &UnitCommandTypes::Research)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Upgrade", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Upgrade)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Upgrade.getID(), &UnitCommandTypes::Upgrade)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Set_Rally_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Set_Rally_Position)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Set_Rally_Position.getID(), &UnitCommandTypes::Set_Rally_Position)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Set_Rally_Unit", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Set_Rally_Unit)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Set_Rally_Unit.getID(), &UnitCommandTypes::Set_Rally_Unit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Move", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Move)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Move.getID(), &UnitCommandTypes::Move)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Patrol", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Patrol)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Patrol.getID(), &UnitCommandTypes::Patrol)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hold_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Hold_Position)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Hold_Position.getID(), &UnitCommandTypes::Hold_Position)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stop", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Stop)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Stop.getID(), &UnitCommandTypes::Stop)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Follow", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Follow)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Follow.getID(), &UnitCommandTypes::Follow)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gather", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Gather)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Gather.getID(), &UnitCommandTypes::Gather)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Return_Cargo", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Return_Cargo)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Return_Cargo.getID(), &UnitCommandTypes::Return_Cargo)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Repair", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Repair)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Repair.getID(), &UnitCommandTypes::Repair)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burrow", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Burrow)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Burrow.getID(), &UnitCommandTypes::Burrow)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unburrow", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unburrow)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unburrow.getID(), &UnitCommandTypes::Unburrow)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cloak", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cloak)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cloak.getID(), &UnitCommandTypes::Cloak)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Decloak", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Decloak)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Decloak.getID(), &UnitCommandTypes::Decloak)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Siege", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Siege)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Siege.getID(), &UnitCommandTypes::Siege)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unsiege", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unsiege)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unsiege.getID(), &UnitCommandTypes::Unsiege)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lift", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Lift)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Lift.getID(), &UnitCommandTypes::Lift)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Land", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Land)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Land.getID(), &UnitCommandTypes::Land)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Load", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Load)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Load.getID(), &UnitCommandTypes::Load)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unload", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unload)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unload.getID(), &UnitCommandTypes::Unload)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unload_All", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unload_All)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unload_All.getID(), &UnitCommandTypes::Unload_All)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unload_All_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unload_All_Position)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unload_All_Position.getID(), &UnitCommandTypes::Unload_All_Position)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Right_Click_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Right_Click_Position)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Right_Click_Position.getID(), &UnitCommandTypes::Right_Click_Position)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Right_Click_Unit", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Right_Click_Unit)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Right_Click_Unit.getID(), &UnitCommandTypes::Right_Click_Unit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Halt_Construction", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Halt_Construction)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Halt_Construction.getID(), &UnitCommandTypes::Halt_Construction)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Construction", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Construction)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Construction.getID(), &UnitCommandTypes::Cancel_Construction)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Addon", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Addon)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Addon.getID(), &UnitCommandTypes::Cancel_Addon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Train", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Train)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Train.getID(), &UnitCommandTypes::Cancel_Train)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Train_Slot", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Train_Slot)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Train_Slot.getID(), &UnitCommandTypes::Cancel_Train_Slot)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Morph", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Morph)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Morph.getID(), &UnitCommandTypes::Cancel_Morph)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Research", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Research)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Research.getID(), &UnitCommandTypes::Cancel_Research)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Cancel_Upgrade", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Cancel_Upgrade)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Cancel_Upgrade.getID(), &UnitCommandTypes::Cancel_Upgrade)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Use_Tech", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Use_Tech)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Use_Tech.getID(), &UnitCommandTypes::Use_Tech)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Use_Tech_Position", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Use_Tech_Position)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Use_Tech_Position.getID(), &UnitCommandTypes::Use_Tech_Position)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Use_Tech_Unit", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Use_Tech_Unit)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Use_Tech_Unit.getID(), &UnitCommandTypes::Use_Tech_Unit)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Place_COP", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Place_COP)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Place_COP.getID(), &UnitCommandTypes::Place_COP)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::None)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::None.getID(), &UnitCommandTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/UnitCommandType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitCommandTypes::Unknown)); +tableUnitCommandType.insert(std::pair(UnitCommandTypes::Unknown.getID(), &UnitCommandTypes::Unknown)); +cls = env->FindClass("Lbwapi/UnitSizeType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/UnitSizeType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Independent", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Independent)); +tableUnitSizeType.insert(std::pair(UnitSizeTypes::Independent.getID(), &UnitSizeTypes::Independent)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Small", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Small)); +tableUnitSizeType.insert(std::pair(UnitSizeTypes::Small.getID(), &UnitSizeTypes::Small)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Medium", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Medium)); +tableUnitSizeType.insert(std::pair(UnitSizeTypes::Medium.getID(), &UnitSizeTypes::Medium)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Large", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Large)); +tableUnitSizeType.insert(std::pair(UnitSizeTypes::Large.getID(), &UnitSizeTypes::Large)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::None)); +tableUnitSizeType.insert(std::pair(UnitSizeTypes::None.getID(), &UnitSizeTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/UnitSizeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitSizeTypes::Unknown)); +tableUnitSizeType.insert(std::pair(UnitSizeTypes::Unknown.getID(), &UnitSizeTypes::Unknown)); +cls = env->FindClass("Lbwapi/UnitType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/UnitType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Marine", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Marine)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Marine.getID(), &UnitTypes::Terran_Marine)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Ghost", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Ghost)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Ghost.getID(), &UnitTypes::Terran_Ghost)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Vulture", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Vulture)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Vulture.getID(), &UnitTypes::Terran_Vulture)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Goliath", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Goliath)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Goliath.getID(), &UnitTypes::Terran_Goliath)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Siege_Tank_Tank_Mode", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Siege_Tank_Tank_Mode)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Siege_Tank_Tank_Mode.getID(), &UnitTypes::Terran_Siege_Tank_Tank_Mode)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_SCV", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_SCV)); +tableUnitType.insert(std::pair(UnitTypes::Terran_SCV.getID(), &UnitTypes::Terran_SCV)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Wraith", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Wraith)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Wraith.getID(), &UnitTypes::Terran_Wraith)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Science_Vessel", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Science_Vessel)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Science_Vessel.getID(), &UnitTypes::Terran_Science_Vessel)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Gui_Montag", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Gui_Montag)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Gui_Montag.getID(), &UnitTypes::Hero_Gui_Montag)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Dropship", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Dropship)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Dropship.getID(), &UnitTypes::Terran_Dropship)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Battlecruiser", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Battlecruiser)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Battlecruiser.getID(), &UnitTypes::Terran_Battlecruiser)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Vulture_Spider_Mine", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Vulture_Spider_Mine)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Vulture_Spider_Mine.getID(), &UnitTypes::Terran_Vulture_Spider_Mine)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Nuclear_Missile", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Nuclear_Missile)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Nuclear_Missile.getID(), &UnitTypes::Terran_Nuclear_Missile)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Civilian", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Civilian)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Civilian.getID(), &UnitTypes::Terran_Civilian)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Sarah_Kerrigan", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Sarah_Kerrigan)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Sarah_Kerrigan.getID(), &UnitTypes::Hero_Sarah_Kerrigan)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Alan_Schezar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Alan_Schezar)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Alan_Schezar.getID(), &UnitTypes::Hero_Alan_Schezar)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Jim_Raynor_Vulture", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Jim_Raynor_Vulture)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Jim_Raynor_Vulture.getID(), &UnitTypes::Hero_Jim_Raynor_Vulture)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Jim_Raynor_Marine", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Jim_Raynor_Marine)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Jim_Raynor_Marine.getID(), &UnitTypes::Hero_Jim_Raynor_Marine)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Tom_Kazansky", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Tom_Kazansky)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Tom_Kazansky.getID(), &UnitTypes::Hero_Tom_Kazansky)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Magellan", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Magellan)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Magellan.getID(), &UnitTypes::Hero_Magellan)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Edmund_Duke_Tank_Mode", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Edmund_Duke_Tank_Mode)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Edmund_Duke_Tank_Mode.getID(), &UnitTypes::Hero_Edmund_Duke_Tank_Mode)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Edmund_Duke_Siege_Mode", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Edmund_Duke_Siege_Mode)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Edmund_Duke_Siege_Mode.getID(), &UnitTypes::Hero_Edmund_Duke_Siege_Mode)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Arcturus_Mengsk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Arcturus_Mengsk)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Arcturus_Mengsk.getID(), &UnitTypes::Hero_Arcturus_Mengsk)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Hyperion", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Hyperion)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Hyperion.getID(), &UnitTypes::Hero_Hyperion)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Norad_II", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Norad_II)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Norad_II.getID(), &UnitTypes::Hero_Norad_II)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Siege_Tank_Siege_Mode", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Siege_Tank_Siege_Mode)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Siege_Tank_Siege_Mode.getID(), &UnitTypes::Terran_Siege_Tank_Siege_Mode)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Firebat", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Firebat)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Firebat.getID(), &UnitTypes::Terran_Firebat)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spell_Scanner_Sweep", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Spell_Scanner_Sweep)); +tableUnitType.insert(std::pair(UnitTypes::Spell_Scanner_Sweep.getID(), &UnitTypes::Spell_Scanner_Sweep)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Medic", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Medic)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Medic.getID(), &UnitTypes::Terran_Medic)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Larva", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Larva)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Larva.getID(), &UnitTypes::Zerg_Larva)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Egg", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Egg)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Egg.getID(), &UnitTypes::Zerg_Egg)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Zergling", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Zergling)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Zergling.getID(), &UnitTypes::Zerg_Zergling)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Hydralisk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Hydralisk)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Hydralisk.getID(), &UnitTypes::Zerg_Hydralisk)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Ultralisk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Ultralisk)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Ultralisk.getID(), &UnitTypes::Zerg_Ultralisk)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Broodling", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Broodling)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Broodling.getID(), &UnitTypes::Zerg_Broodling)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Drone", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Drone)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Drone.getID(), &UnitTypes::Zerg_Drone)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Overlord", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Overlord)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Overlord.getID(), &UnitTypes::Zerg_Overlord)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Mutalisk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Mutalisk)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Mutalisk.getID(), &UnitTypes::Zerg_Mutalisk)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Guardian", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Guardian)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Guardian.getID(), &UnitTypes::Zerg_Guardian)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Queen", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Queen)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Queen.getID(), &UnitTypes::Zerg_Queen)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Defiler", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Defiler)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Defiler.getID(), &UnitTypes::Zerg_Defiler)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Scourge", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Scourge)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Scourge.getID(), &UnitTypes::Zerg_Scourge)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Torrasque", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Torrasque)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Torrasque.getID(), &UnitTypes::Hero_Torrasque)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Matriarch", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Matriarch)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Matriarch.getID(), &UnitTypes::Hero_Matriarch)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Infested_Terran", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Infested_Terran)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Infested_Terran.getID(), &UnitTypes::Zerg_Infested_Terran)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Infested_Kerrigan", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Infested_Kerrigan)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Infested_Kerrigan.getID(), &UnitTypes::Hero_Infested_Kerrigan)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Unclean_One", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Unclean_One)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Unclean_One.getID(), &UnitTypes::Hero_Unclean_One)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Hunter_Killer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Hunter_Killer)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Hunter_Killer.getID(), &UnitTypes::Hero_Hunter_Killer)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Devouring_One", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Devouring_One)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Devouring_One.getID(), &UnitTypes::Hero_Devouring_One)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Kukulza_Mutalisk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Kukulza_Mutalisk)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Kukulza_Mutalisk.getID(), &UnitTypes::Hero_Kukulza_Mutalisk)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Kukulza_Guardian", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Kukulza_Guardian)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Kukulza_Guardian.getID(), &UnitTypes::Hero_Kukulza_Guardian)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Yggdrasill", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Yggdrasill)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Yggdrasill.getID(), &UnitTypes::Hero_Yggdrasill)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Valkyrie", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Valkyrie)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Valkyrie.getID(), &UnitTypes::Terran_Valkyrie)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Cocoon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Cocoon)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Cocoon.getID(), &UnitTypes::Zerg_Cocoon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Corsair", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Corsair)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Corsair.getID(), &UnitTypes::Protoss_Corsair)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Dark_Templar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Dark_Templar)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Dark_Templar.getID(), &UnitTypes::Protoss_Dark_Templar)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Devourer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Devourer)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Devourer.getID(), &UnitTypes::Zerg_Devourer)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Dark_Archon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Dark_Archon)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Dark_Archon.getID(), &UnitTypes::Protoss_Dark_Archon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Probe", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Probe)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Probe.getID(), &UnitTypes::Protoss_Probe)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Zealot", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Zealot)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Zealot.getID(), &UnitTypes::Protoss_Zealot)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Dragoon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Dragoon)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Dragoon.getID(), &UnitTypes::Protoss_Dragoon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_High_Templar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_High_Templar)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_High_Templar.getID(), &UnitTypes::Protoss_High_Templar)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Archon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Archon)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Archon.getID(), &UnitTypes::Protoss_Archon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Shuttle", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Shuttle)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Shuttle.getID(), &UnitTypes::Protoss_Shuttle)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Scout", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Scout)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Scout.getID(), &UnitTypes::Protoss_Scout)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Arbiter", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Arbiter)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Arbiter.getID(), &UnitTypes::Protoss_Arbiter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Carrier", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Carrier)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Carrier.getID(), &UnitTypes::Protoss_Carrier)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Interceptor", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Interceptor)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Interceptor.getID(), &UnitTypes::Protoss_Interceptor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Dark_Templar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Dark_Templar)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Dark_Templar.getID(), &UnitTypes::Hero_Dark_Templar)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Zeratul", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Zeratul)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Zeratul.getID(), &UnitTypes::Hero_Zeratul)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Tassadar_Zeratul_Archon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Tassadar_Zeratul_Archon)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Tassadar_Zeratul_Archon.getID(), &UnitTypes::Hero_Tassadar_Zeratul_Archon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Fenix_Zealot", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Fenix_Zealot)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Fenix_Zealot.getID(), &UnitTypes::Hero_Fenix_Zealot)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Fenix_Dragoon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Fenix_Dragoon)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Fenix_Dragoon.getID(), &UnitTypes::Hero_Fenix_Dragoon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Tassadar", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Tassadar)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Tassadar.getID(), &UnitTypes::Hero_Tassadar)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Mojo", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Mojo)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Mojo.getID(), &UnitTypes::Hero_Mojo)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Warbringer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Warbringer)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Warbringer.getID(), &UnitTypes::Hero_Warbringer)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Gantrithor", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Gantrithor)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Gantrithor.getID(), &UnitTypes::Hero_Gantrithor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Reaver", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Reaver)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Reaver.getID(), &UnitTypes::Protoss_Reaver)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Observer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Observer)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Observer.getID(), &UnitTypes::Protoss_Observer)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Scarab", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Scarab)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Scarab.getID(), &UnitTypes::Protoss_Scarab)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Danimoth", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Danimoth)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Danimoth.getID(), &UnitTypes::Hero_Danimoth)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Aldaris", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Aldaris)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Aldaris.getID(), &UnitTypes::Hero_Aldaris)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Artanis", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Artanis)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Artanis.getID(), &UnitTypes::Hero_Artanis)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Rhynadon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Rhynadon)); +tableUnitType.insert(std::pair(UnitTypes::Critter_Rhynadon.getID(), &UnitTypes::Critter_Rhynadon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Bengalaas", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Bengalaas)); +tableUnitType.insert(std::pair(UnitTypes::Critter_Bengalaas.getID(), &UnitTypes::Critter_Bengalaas)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Cargo_Ship", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Cargo_Ship)); +tableUnitType.insert(std::pair(UnitTypes::Special_Cargo_Ship.getID(), &UnitTypes::Special_Cargo_Ship)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Mercenary_Gunship", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Mercenary_Gunship)); +tableUnitType.insert(std::pair(UnitTypes::Special_Mercenary_Gunship.getID(), &UnitTypes::Special_Mercenary_Gunship)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Scantid", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Scantid)); +tableUnitType.insert(std::pair(UnitTypes::Critter_Scantid.getID(), &UnitTypes::Critter_Scantid)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Kakaru", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Kakaru)); +tableUnitType.insert(std::pair(UnitTypes::Critter_Kakaru.getID(), &UnitTypes::Critter_Kakaru)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Ragnasaur", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Ragnasaur)); +tableUnitType.insert(std::pair(UnitTypes::Critter_Ragnasaur.getID(), &UnitTypes::Critter_Ragnasaur)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Critter_Ursadon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Critter_Ursadon)); +tableUnitType.insert(std::pair(UnitTypes::Critter_Ursadon.getID(), &UnitTypes::Critter_Ursadon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Lurker_Egg", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Lurker_Egg)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Lurker_Egg.getID(), &UnitTypes::Zerg_Lurker_Egg)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Raszagal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Raszagal)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Raszagal.getID(), &UnitTypes::Hero_Raszagal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Samir_Duran", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Samir_Duran)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Samir_Duran.getID(), &UnitTypes::Hero_Samir_Duran)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Alexei_Stukov", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Alexei_Stukov)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Alexei_Stukov.getID(), &UnitTypes::Hero_Alexei_Stukov)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Map_Revealer", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Map_Revealer)); +tableUnitType.insert(std::pair(UnitTypes::Special_Map_Revealer.getID(), &UnitTypes::Special_Map_Revealer)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Gerard_DuGalle", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Gerard_DuGalle)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Gerard_DuGalle.getID(), &UnitTypes::Hero_Gerard_DuGalle)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Lurker", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Lurker)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Lurker.getID(), &UnitTypes::Zerg_Lurker)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hero_Infested_Duran", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Hero_Infested_Duran)); +tableUnitType.insert(std::pair(UnitTypes::Hero_Infested_Duran.getID(), &UnitTypes::Hero_Infested_Duran)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spell_Disruption_Web", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Spell_Disruption_Web)); +tableUnitType.insert(std::pair(UnitTypes::Spell_Disruption_Web.getID(), &UnitTypes::Spell_Disruption_Web)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Command_Center", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Command_Center)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Command_Center.getID(), &UnitTypes::Terran_Command_Center)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Comsat_Station", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Comsat_Station)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Comsat_Station.getID(), &UnitTypes::Terran_Comsat_Station)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Nuclear_Silo", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Nuclear_Silo)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Nuclear_Silo.getID(), &UnitTypes::Terran_Nuclear_Silo)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Supply_Depot", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Supply_Depot)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Supply_Depot.getID(), &UnitTypes::Terran_Supply_Depot)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Refinery", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Refinery)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Refinery.getID(), &UnitTypes::Terran_Refinery)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Barracks", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Barracks)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Barracks.getID(), &UnitTypes::Terran_Barracks)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Academy", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Academy)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Academy.getID(), &UnitTypes::Terran_Academy)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Factory", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Factory)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Factory.getID(), &UnitTypes::Terran_Factory)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Starport", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Starport)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Starport.getID(), &UnitTypes::Terran_Starport)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Control_Tower", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Control_Tower)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Control_Tower.getID(), &UnitTypes::Terran_Control_Tower)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Science_Facility", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Science_Facility)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Science_Facility.getID(), &UnitTypes::Terran_Science_Facility)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Covert_Ops", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Covert_Ops)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Covert_Ops.getID(), &UnitTypes::Terran_Covert_Ops)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Physics_Lab", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Physics_Lab)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Physics_Lab.getID(), &UnitTypes::Terran_Physics_Lab)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Machine_Shop", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Machine_Shop)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Machine_Shop.getID(), &UnitTypes::Terran_Machine_Shop)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Engineering_Bay", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Engineering_Bay)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Engineering_Bay.getID(), &UnitTypes::Terran_Engineering_Bay)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Armory", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Armory)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Armory.getID(), &UnitTypes::Terran_Armory)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Missile_Turret", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Missile_Turret)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Missile_Turret.getID(), &UnitTypes::Terran_Missile_Turret)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Bunker", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Terran_Bunker)); +tableUnitType.insert(std::pair(UnitTypes::Terran_Bunker.getID(), &UnitTypes::Terran_Bunker)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Crashed_Norad_II", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Crashed_Norad_II)); +tableUnitType.insert(std::pair(UnitTypes::Special_Crashed_Norad_II.getID(), &UnitTypes::Special_Crashed_Norad_II)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Ion_Cannon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Ion_Cannon)); +tableUnitType.insert(std::pair(UnitTypes::Special_Ion_Cannon.getID(), &UnitTypes::Special_Ion_Cannon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Uraj_Crystal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Uraj_Crystal)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Uraj_Crystal.getID(), &UnitTypes::Powerup_Uraj_Crystal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Khalis_Crystal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Khalis_Crystal)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Khalis_Crystal.getID(), &UnitTypes::Powerup_Khalis_Crystal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Infested_Command_Center", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Infested_Command_Center)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Infested_Command_Center.getID(), &UnitTypes::Zerg_Infested_Command_Center)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Hatchery", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Hatchery)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Hatchery.getID(), &UnitTypes::Zerg_Hatchery)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Lair", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Lair)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Lair.getID(), &UnitTypes::Zerg_Lair)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Hive", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Hive)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Hive.getID(), &UnitTypes::Zerg_Hive)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Nydus_Canal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Nydus_Canal)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Nydus_Canal.getID(), &UnitTypes::Zerg_Nydus_Canal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Hydralisk_Den", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Hydralisk_Den)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Hydralisk_Den.getID(), &UnitTypes::Zerg_Hydralisk_Den)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Defiler_Mound", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Defiler_Mound)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Defiler_Mound.getID(), &UnitTypes::Zerg_Defiler_Mound)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Greater_Spire", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Greater_Spire)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Greater_Spire.getID(), &UnitTypes::Zerg_Greater_Spire)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Queens_Nest", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Queens_Nest)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Queens_Nest.getID(), &UnitTypes::Zerg_Queens_Nest)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Evolution_Chamber", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Evolution_Chamber)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Evolution_Chamber.getID(), &UnitTypes::Zerg_Evolution_Chamber)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Ultralisk_Cavern", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Ultralisk_Cavern)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Ultralisk_Cavern.getID(), &UnitTypes::Zerg_Ultralisk_Cavern)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Spire", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Spire)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Spire.getID(), &UnitTypes::Zerg_Spire)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Spawning_Pool", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Spawning_Pool)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Spawning_Pool.getID(), &UnitTypes::Zerg_Spawning_Pool)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Creep_Colony", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Creep_Colony)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Creep_Colony.getID(), &UnitTypes::Zerg_Creep_Colony)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Spore_Colony", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Spore_Colony)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Spore_Colony.getID(), &UnitTypes::Zerg_Spore_Colony)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Sunken_Colony", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Sunken_Colony)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Sunken_Colony.getID(), &UnitTypes::Zerg_Sunken_Colony)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Overmind_With_Shell", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Overmind_With_Shell)); +tableUnitType.insert(std::pair(UnitTypes::Special_Overmind_With_Shell.getID(), &UnitTypes::Special_Overmind_With_Shell)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Overmind", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Overmind)); +tableUnitType.insert(std::pair(UnitTypes::Special_Overmind.getID(), &UnitTypes::Special_Overmind)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Extractor", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Zerg_Extractor)); +tableUnitType.insert(std::pair(UnitTypes::Zerg_Extractor.getID(), &UnitTypes::Zerg_Extractor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Mature_Chrysalis", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Mature_Chrysalis)); +tableUnitType.insert(std::pair(UnitTypes::Special_Mature_Chrysalis.getID(), &UnitTypes::Special_Mature_Chrysalis)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Cerebrate", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Cerebrate)); +tableUnitType.insert(std::pair(UnitTypes::Special_Cerebrate.getID(), &UnitTypes::Special_Cerebrate)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Cerebrate_Daggoth", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Cerebrate_Daggoth)); +tableUnitType.insert(std::pair(UnitTypes::Special_Cerebrate_Daggoth.getID(), &UnitTypes::Special_Cerebrate_Daggoth)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Nexus", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Nexus)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Nexus.getID(), &UnitTypes::Protoss_Nexus)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Robotics_Facility", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Robotics_Facility)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Robotics_Facility.getID(), &UnitTypes::Protoss_Robotics_Facility)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Pylon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Pylon)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Pylon.getID(), &UnitTypes::Protoss_Pylon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Assimilator", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Assimilator)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Assimilator.getID(), &UnitTypes::Protoss_Assimilator)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Observatory", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Observatory)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Observatory.getID(), &UnitTypes::Protoss_Observatory)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Gateway", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Gateway)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Gateway.getID(), &UnitTypes::Protoss_Gateway)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Photon_Cannon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Photon_Cannon)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Photon_Cannon.getID(), &UnitTypes::Protoss_Photon_Cannon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Citadel_of_Adun", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Citadel_of_Adun)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Citadel_of_Adun.getID(), &UnitTypes::Protoss_Citadel_of_Adun)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Cybernetics_Core", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Cybernetics_Core)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Cybernetics_Core.getID(), &UnitTypes::Protoss_Cybernetics_Core)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Templar_Archives", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Templar_Archives)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Templar_Archives.getID(), &UnitTypes::Protoss_Templar_Archives)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Forge", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Forge)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Forge.getID(), &UnitTypes::Protoss_Forge)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Stargate", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Stargate)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Stargate.getID(), &UnitTypes::Protoss_Stargate)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Stasis_Cell_Prison", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Stasis_Cell_Prison)); +tableUnitType.insert(std::pair(UnitTypes::Special_Stasis_Cell_Prison.getID(), &UnitTypes::Special_Stasis_Cell_Prison)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Fleet_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Fleet_Beacon)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Fleet_Beacon.getID(), &UnitTypes::Protoss_Fleet_Beacon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Arbiter_Tribunal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Arbiter_Tribunal)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Arbiter_Tribunal.getID(), &UnitTypes::Protoss_Arbiter_Tribunal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Robotics_Support_Bay", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Robotics_Support_Bay)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Robotics_Support_Bay.getID(), &UnitTypes::Protoss_Robotics_Support_Bay)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Shield_Battery", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Protoss_Shield_Battery)); +tableUnitType.insert(std::pair(UnitTypes::Protoss_Shield_Battery.getID(), &UnitTypes::Protoss_Shield_Battery)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Khaydarin_Crystal_Form", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Khaydarin_Crystal_Form)); +tableUnitType.insert(std::pair(UnitTypes::Special_Khaydarin_Crystal_Form.getID(), &UnitTypes::Special_Khaydarin_Crystal_Form)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Protoss_Temple", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Protoss_Temple)); +tableUnitType.insert(std::pair(UnitTypes::Special_Protoss_Temple.getID(), &UnitTypes::Special_Protoss_Temple)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_XelNaga_Temple", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_XelNaga_Temple)); +tableUnitType.insert(std::pair(UnitTypes::Special_XelNaga_Temple.getID(), &UnitTypes::Special_XelNaga_Temple)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Resource_Mineral_Field", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Resource_Mineral_Field)); +tableUnitType.insert(std::pair(UnitTypes::Resource_Mineral_Field.getID(), &UnitTypes::Resource_Mineral_Field)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Resource_Mineral_Field_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Resource_Mineral_Field_Type_2)); +tableUnitType.insert(std::pair(UnitTypes::Resource_Mineral_Field_Type_2.getID(), &UnitTypes::Resource_Mineral_Field_Type_2)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Resource_Mineral_Field_Type_3", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Resource_Mineral_Field_Type_3)); +tableUnitType.insert(std::pair(UnitTypes::Resource_Mineral_Field_Type_3.getID(), &UnitTypes::Resource_Mineral_Field_Type_3)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Independant_Starport", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Independant_Starport)); +tableUnitType.insert(std::pair(UnitTypes::Special_Independant_Starport.getID(), &UnitTypes::Special_Independant_Starport)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Resource_Vespene_Geyser", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Resource_Vespene_Geyser)); +tableUnitType.insert(std::pair(UnitTypes::Resource_Vespene_Geyser.getID(), &UnitTypes::Resource_Vespene_Geyser)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Warp_Gate", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Warp_Gate)); +tableUnitType.insert(std::pair(UnitTypes::Special_Warp_Gate.getID(), &UnitTypes::Special_Warp_Gate)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Psi_Disrupter", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Psi_Disrupter)); +tableUnitType.insert(std::pair(UnitTypes::Special_Psi_Disrupter.getID(), &UnitTypes::Special_Psi_Disrupter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Zerg_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Zerg_Beacon)); +tableUnitType.insert(std::pair(UnitTypes::Special_Zerg_Beacon.getID(), &UnitTypes::Special_Zerg_Beacon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Terran_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Terran_Beacon)); +tableUnitType.insert(std::pair(UnitTypes::Special_Terran_Beacon.getID(), &UnitTypes::Special_Terran_Beacon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Protoss_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Protoss_Beacon)); +tableUnitType.insert(std::pair(UnitTypes::Special_Protoss_Beacon.getID(), &UnitTypes::Special_Protoss_Beacon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Zerg_Flag_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Zerg_Flag_Beacon)); +tableUnitType.insert(std::pair(UnitTypes::Special_Zerg_Flag_Beacon.getID(), &UnitTypes::Special_Zerg_Flag_Beacon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Terran_Flag_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Terran_Flag_Beacon)); +tableUnitType.insert(std::pair(UnitTypes::Special_Terran_Flag_Beacon.getID(), &UnitTypes::Special_Terran_Flag_Beacon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Protoss_Flag_Beacon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Protoss_Flag_Beacon)); +tableUnitType.insert(std::pair(UnitTypes::Special_Protoss_Flag_Beacon.getID(), &UnitTypes::Special_Protoss_Flag_Beacon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Power_Generator", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Power_Generator)); +tableUnitType.insert(std::pair(UnitTypes::Special_Power_Generator.getID(), &UnitTypes::Special_Power_Generator)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Overmind_Cocoon", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Overmind_Cocoon)); +tableUnitType.insert(std::pair(UnitTypes::Special_Overmind_Cocoon.getID(), &UnitTypes::Special_Overmind_Cocoon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spell_Dark_Swarm", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Spell_Dark_Swarm)); +tableUnitType.insert(std::pair(UnitTypes::Spell_Dark_Swarm.getID(), &UnitTypes::Spell_Dark_Swarm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Floor_Missile_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Floor_Missile_Trap)); +tableUnitType.insert(std::pair(UnitTypes::Special_Floor_Missile_Trap.getID(), &UnitTypes::Special_Floor_Missile_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Floor_Hatch", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Floor_Hatch)); +tableUnitType.insert(std::pair(UnitTypes::Special_Floor_Hatch.getID(), &UnitTypes::Special_Floor_Hatch)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Upper_Level_Door", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Upper_Level_Door)); +tableUnitType.insert(std::pair(UnitTypes::Special_Upper_Level_Door.getID(), &UnitTypes::Special_Upper_Level_Door)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Right_Upper_Level_Door", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Right_Upper_Level_Door)); +tableUnitType.insert(std::pair(UnitTypes::Special_Right_Upper_Level_Door.getID(), &UnitTypes::Special_Right_Upper_Level_Door)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Pit_Door", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Pit_Door)); +tableUnitType.insert(std::pair(UnitTypes::Special_Pit_Door.getID(), &UnitTypes::Special_Pit_Door)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Right_Pit_Door", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Right_Pit_Door)); +tableUnitType.insert(std::pair(UnitTypes::Special_Right_Pit_Door.getID(), &UnitTypes::Special_Right_Pit_Door)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Floor_Gun_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Floor_Gun_Trap)); +tableUnitType.insert(std::pair(UnitTypes::Special_Floor_Gun_Trap.getID(), &UnitTypes::Special_Floor_Gun_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Wall_Missile_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Wall_Missile_Trap)); +tableUnitType.insert(std::pair(UnitTypes::Special_Wall_Missile_Trap.getID(), &UnitTypes::Special_Wall_Missile_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Wall_Flame_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Wall_Flame_Trap)); +tableUnitType.insert(std::pair(UnitTypes::Special_Wall_Flame_Trap.getID(), &UnitTypes::Special_Wall_Flame_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Right_Wall_Missile_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Right_Wall_Missile_Trap)); +tableUnitType.insert(std::pair(UnitTypes::Special_Right_Wall_Missile_Trap.getID(), &UnitTypes::Special_Right_Wall_Missile_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Right_Wall_Flame_Trap", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Right_Wall_Flame_Trap)); +tableUnitType.insert(std::pair(UnitTypes::Special_Right_Wall_Flame_Trap.getID(), &UnitTypes::Special_Right_Wall_Flame_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Special_Start_Location", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Special_Start_Location)); +tableUnitType.insert(std::pair(UnitTypes::Special_Start_Location.getID(), &UnitTypes::Special_Start_Location)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Flag", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Flag)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Flag.getID(), &UnitTypes::Powerup_Flag)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Young_Chrysalis", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Young_Chrysalis)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Young_Chrysalis.getID(), &UnitTypes::Powerup_Young_Chrysalis)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Psi_Emitter", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Psi_Emitter)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Psi_Emitter.getID(), &UnitTypes::Powerup_Psi_Emitter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Data_Disk", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Data_Disk)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Data_Disk.getID(), &UnitTypes::Powerup_Data_Disk)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Khaydarin_Crystal", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Khaydarin_Crystal)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Khaydarin_Crystal.getID(), &UnitTypes::Powerup_Khaydarin_Crystal)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Mineral_Cluster_Type_1", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Mineral_Cluster_Type_1)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Mineral_Cluster_Type_1.getID(), &UnitTypes::Powerup_Mineral_Cluster_Type_1)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Mineral_Cluster_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Mineral_Cluster_Type_2)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Mineral_Cluster_Type_2.getID(), &UnitTypes::Powerup_Mineral_Cluster_Type_2)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Protoss_Gas_Orb_Type_1", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Protoss_Gas_Orb_Type_1)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Protoss_Gas_Orb_Type_1.getID(), &UnitTypes::Powerup_Protoss_Gas_Orb_Type_1)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Protoss_Gas_Orb_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Protoss_Gas_Orb_Type_2)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Protoss_Gas_Orb_Type_2.getID(), &UnitTypes::Powerup_Protoss_Gas_Orb_Type_2)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Zerg_Gas_Sac_Type_1", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Zerg_Gas_Sac_Type_1)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Zerg_Gas_Sac_Type_1.getID(), &UnitTypes::Powerup_Zerg_Gas_Sac_Type_1)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Zerg_Gas_Sac_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Zerg_Gas_Sac_Type_2)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Zerg_Gas_Sac_Type_2.getID(), &UnitTypes::Powerup_Zerg_Gas_Sac_Type_2)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Terran_Gas_Tank_Type_1", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Terran_Gas_Tank_Type_1)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Terran_Gas_Tank_Type_1.getID(), &UnitTypes::Powerup_Terran_Gas_Tank_Type_1)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Powerup_Terran_Gas_Tank_Type_2", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Powerup_Terran_Gas_Tank_Type_2)); +tableUnitType.insert(std::pair(UnitTypes::Powerup_Terran_Gas_Tank_Type_2.getID(), &UnitTypes::Powerup_Terran_Gas_Tank_Type_2)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::None)); +tableUnitType.insert(std::pair(UnitTypes::None.getID(), &UnitTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "AllUnits", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::AllUnits)); +tableUnitType.insert(std::pair(UnitTypes::AllUnits.getID(), &UnitTypes::AllUnits)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Men", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Men)); +tableUnitType.insert(std::pair(UnitTypes::Men.getID(), &UnitTypes::Men)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Buildings", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Buildings)); +tableUnitType.insert(std::pair(UnitTypes::Buildings.getID(), &UnitTypes::Buildings)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Factories", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Factories)); +tableUnitType.insert(std::pair(UnitTypes::Factories.getID(), &UnitTypes::Factories)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/UnitType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UnitTypes::Unknown)); +tableUnitType.insert(std::pair(UnitTypes::Unknown.getID(), &UnitTypes::Unknown)); +cls = env->FindClass("Lbwapi/UpgradeType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/UpgradeType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Infantry_Armor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Infantry_Armor)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Infantry_Armor.getID(), &UpgradeTypes::Terran_Infantry_Armor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Vehicle_Plating", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Vehicle_Plating)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Vehicle_Plating.getID(), &UpgradeTypes::Terran_Vehicle_Plating)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Ship_Plating", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Ship_Plating)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Ship_Plating.getID(), &UpgradeTypes::Terran_Ship_Plating)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Carapace", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Carapace)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Carapace.getID(), &UpgradeTypes::Zerg_Carapace)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Flyer_Carapace", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Flyer_Carapace)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Flyer_Carapace.getID(), &UpgradeTypes::Zerg_Flyer_Carapace)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Ground_Armor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Ground_Armor)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Ground_Armor.getID(), &UpgradeTypes::Protoss_Ground_Armor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Air_Armor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Air_Armor)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Air_Armor.getID(), &UpgradeTypes::Protoss_Air_Armor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Infantry_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Infantry_Weapons)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Infantry_Weapons.getID(), &UpgradeTypes::Terran_Infantry_Weapons)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Vehicle_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Vehicle_Weapons)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Vehicle_Weapons.getID(), &UpgradeTypes::Terran_Vehicle_Weapons)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Terran_Ship_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Terran_Ship_Weapons)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Terran_Ship_Weapons.getID(), &UpgradeTypes::Terran_Ship_Weapons)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Melee_Attacks", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Melee_Attacks)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Melee_Attacks.getID(), &UpgradeTypes::Zerg_Melee_Attacks)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Missile_Attacks", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Missile_Attacks)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Missile_Attacks.getID(), &UpgradeTypes::Zerg_Missile_Attacks)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Zerg_Flyer_Attacks", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Zerg_Flyer_Attacks)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Zerg_Flyer_Attacks.getID(), &UpgradeTypes::Zerg_Flyer_Attacks)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Ground_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Ground_Weapons)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Ground_Weapons.getID(), &UpgradeTypes::Protoss_Ground_Weapons)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Air_Weapons", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Air_Weapons)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Air_Weapons.getID(), &UpgradeTypes::Protoss_Air_Weapons)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Protoss_Plasma_Shields", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Protoss_Plasma_Shields)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Protoss_Plasma_Shields.getID(), &UpgradeTypes::Protoss_Plasma_Shields)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "U_238_Shells", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::U_238_Shells)); +tableUpgradeType.insert(std::pair(UpgradeTypes::U_238_Shells.getID(), &UpgradeTypes::U_238_Shells)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ion_Thrusters", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Ion_Thrusters)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Ion_Thrusters.getID(), &UpgradeTypes::Ion_Thrusters)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Titan_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Titan_Reactor)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Titan_Reactor.getID(), &UpgradeTypes::Titan_Reactor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ocular_Implants", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Ocular_Implants)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Ocular_Implants.getID(), &UpgradeTypes::Ocular_Implants)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Moebius_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Moebius_Reactor)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Moebius_Reactor.getID(), &UpgradeTypes::Moebius_Reactor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Apollo_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Apollo_Reactor)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Apollo_Reactor.getID(), &UpgradeTypes::Apollo_Reactor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Colossus_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Colossus_Reactor)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Colossus_Reactor.getID(), &UpgradeTypes::Colossus_Reactor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ventral_Sacs", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Ventral_Sacs)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Ventral_Sacs.getID(), &UpgradeTypes::Ventral_Sacs)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Antennae", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Antennae)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Antennae.getID(), &UpgradeTypes::Antennae)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Pneumatized_Carapace", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Pneumatized_Carapace)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Pneumatized_Carapace.getID(), &UpgradeTypes::Pneumatized_Carapace)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Metabolic_Boost", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Metabolic_Boost)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Metabolic_Boost.getID(), &UpgradeTypes::Metabolic_Boost)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Adrenal_Glands", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Adrenal_Glands)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Adrenal_Glands.getID(), &UpgradeTypes::Adrenal_Glands)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Muscular_Augments", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Muscular_Augments)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Muscular_Augments.getID(), &UpgradeTypes::Muscular_Augments)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Grooved_Spines", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Grooved_Spines)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Grooved_Spines.getID(), &UpgradeTypes::Grooved_Spines)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gamete_Meiosis", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Gamete_Meiosis)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Gamete_Meiosis.getID(), &UpgradeTypes::Gamete_Meiosis)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Metasynaptic_Node", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Metasynaptic_Node)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Metasynaptic_Node.getID(), &UpgradeTypes::Metasynaptic_Node)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Singularity_Charge", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Singularity_Charge)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Singularity_Charge.getID(), &UpgradeTypes::Singularity_Charge)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Leg_Enhancements", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Leg_Enhancements)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Leg_Enhancements.getID(), &UpgradeTypes::Leg_Enhancements)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Scarab_Damage", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Scarab_Damage)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Scarab_Damage.getID(), &UpgradeTypes::Scarab_Damage)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Reaver_Capacity", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Reaver_Capacity)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Reaver_Capacity.getID(), &UpgradeTypes::Reaver_Capacity)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gravitic_Drive", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Gravitic_Drive)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Gravitic_Drive.getID(), &UpgradeTypes::Gravitic_Drive)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Sensor_Array", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Sensor_Array)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Sensor_Array.getID(), &UpgradeTypes::Sensor_Array)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gravitic_Boosters", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Gravitic_Boosters)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Gravitic_Boosters.getID(), &UpgradeTypes::Gravitic_Boosters)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Khaydarin_Amulet", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Khaydarin_Amulet)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Khaydarin_Amulet.getID(), &UpgradeTypes::Khaydarin_Amulet)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Apial_Sensors", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Apial_Sensors)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Apial_Sensors.getID(), &UpgradeTypes::Apial_Sensors)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gravitic_Thrusters", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Gravitic_Thrusters)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Gravitic_Thrusters.getID(), &UpgradeTypes::Gravitic_Thrusters)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Carrier_Capacity", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Carrier_Capacity)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Carrier_Capacity.getID(), &UpgradeTypes::Carrier_Capacity)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Khaydarin_Core", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Khaydarin_Core)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Khaydarin_Core.getID(), &UpgradeTypes::Khaydarin_Core)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Argus_Jewel", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Argus_Jewel)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Argus_Jewel.getID(), &UpgradeTypes::Argus_Jewel)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Argus_Talisman", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Argus_Talisman)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Argus_Talisman.getID(), &UpgradeTypes::Argus_Talisman)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Caduceus_Reactor", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Caduceus_Reactor)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Caduceus_Reactor.getID(), &UpgradeTypes::Caduceus_Reactor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Chitinous_Plating", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Chitinous_Plating)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Chitinous_Plating.getID(), &UpgradeTypes::Chitinous_Plating)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anabolic_Synthesis", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Anabolic_Synthesis)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Anabolic_Synthesis.getID(), &UpgradeTypes::Anabolic_Synthesis)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Charon_Boosters", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Charon_Boosters)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Charon_Boosters.getID(), &UpgradeTypes::Charon_Boosters)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Upgrade_60", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Upgrade_60)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Upgrade_60.getID(), &UpgradeTypes::Upgrade_60)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::None)); +tableUpgradeType.insert(std::pair(UpgradeTypes::None.getID(), &UpgradeTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/UpgradeType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&UpgradeTypes::Unknown)); +tableUpgradeType.insert(std::pair(UpgradeTypes::Unknown.getID(), &UpgradeTypes::Unknown)); +cls = env->FindClass("Lbwapi/WeaponType;"); +getId = env->GetStaticMethodID(cls, "get", "(J)Lbwapi/WeaponType;"); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gauss_Rifle", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Gauss_Rifle)); +tableWeaponType.insert(std::pair(WeaponTypes::Gauss_Rifle.getID(), &WeaponTypes::Gauss_Rifle)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gauss_Rifle_Jim_Raynor", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Gauss_Rifle_Jim_Raynor)); +tableWeaponType.insert(std::pair(WeaponTypes::Gauss_Rifle_Jim_Raynor.getID(), &WeaponTypes::Gauss_Rifle_Jim_Raynor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle)); +tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle.getID(), &WeaponTypes::C_10_Canister_Rifle)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Sarah_Kerrigan", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle_Sarah_Kerrigan)); +tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle_Sarah_Kerrigan.getID(), &WeaponTypes::C_10_Canister_Rifle_Sarah_Kerrigan)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Samir_Duran", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle_Samir_Duran)); +tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle_Samir_Duran.getID(), &WeaponTypes::C_10_Canister_Rifle_Samir_Duran)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Infested_Duran", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle_Infested_Duran)); +tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle_Infested_Duran.getID(), &WeaponTypes::C_10_Canister_Rifle_Infested_Duran)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "C_10_Canister_Rifle_Alexei_Stukov", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::C_10_Canister_Rifle_Alexei_Stukov)); +tableWeaponType.insert(std::pair(WeaponTypes::C_10_Canister_Rifle_Alexei_Stukov.getID(), &WeaponTypes::C_10_Canister_Rifle_Alexei_Stukov)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fragmentation_Grenade", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Fragmentation_Grenade)); +tableWeaponType.insert(std::pair(WeaponTypes::Fragmentation_Grenade.getID(), &WeaponTypes::Fragmentation_Grenade)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fragmentation_Grenade_Jim_Raynor", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Fragmentation_Grenade_Jim_Raynor)); +tableWeaponType.insert(std::pair(WeaponTypes::Fragmentation_Grenade_Jim_Raynor.getID(), &WeaponTypes::Fragmentation_Grenade_Jim_Raynor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spider_Mines", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Spider_Mines)); +tableWeaponType.insert(std::pair(WeaponTypes::Spider_Mines.getID(), &WeaponTypes::Spider_Mines)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Twin_Autocannons", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Twin_Autocannons)); +tableWeaponType.insert(std::pair(WeaponTypes::Twin_Autocannons.getID(), &WeaponTypes::Twin_Autocannons)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Twin_Autocannons_Alan_Schezar", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Twin_Autocannons_Alan_Schezar)); +tableWeaponType.insert(std::pair(WeaponTypes::Twin_Autocannons_Alan_Schezar.getID(), &WeaponTypes::Twin_Autocannons_Alan_Schezar)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hellfire_Missile_Pack", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Hellfire_Missile_Pack)); +tableWeaponType.insert(std::pair(WeaponTypes::Hellfire_Missile_Pack.getID(), &WeaponTypes::Hellfire_Missile_Pack)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hellfire_Missile_Pack_Alan_Schezar", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Hellfire_Missile_Pack_Alan_Schezar)); +tableWeaponType.insert(std::pair(WeaponTypes::Hellfire_Missile_Pack_Alan_Schezar.getID(), &WeaponTypes::Hellfire_Missile_Pack_Alan_Schezar)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Arclite_Cannon)); +tableWeaponType.insert(std::pair(WeaponTypes::Arclite_Cannon.getID(), &WeaponTypes::Arclite_Cannon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Cannon_Edmund_Duke", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Arclite_Cannon_Edmund_Duke)); +tableWeaponType.insert(std::pair(WeaponTypes::Arclite_Cannon_Edmund_Duke.getID(), &WeaponTypes::Arclite_Cannon_Edmund_Duke)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Fusion_Cutter", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Fusion_Cutter)); +tableWeaponType.insert(std::pair(WeaponTypes::Fusion_Cutter.getID(), &WeaponTypes::Fusion_Cutter)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gemini_Missiles", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Gemini_Missiles)); +tableWeaponType.insert(std::pair(WeaponTypes::Gemini_Missiles.getID(), &WeaponTypes::Gemini_Missiles)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Gemini_Missiles_Tom_Kazansky", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Gemini_Missiles_Tom_Kazansky)); +tableWeaponType.insert(std::pair(WeaponTypes::Gemini_Missiles_Tom_Kazansky.getID(), &WeaponTypes::Gemini_Missiles_Tom_Kazansky)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burst_Lasers", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Burst_Lasers)); +tableWeaponType.insert(std::pair(WeaponTypes::Burst_Lasers.getID(), &WeaponTypes::Burst_Lasers)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Burst_Lasers_Tom_Kazansky", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Burst_Lasers_Tom_Kazansky)); +tableWeaponType.insert(std::pair(WeaponTypes::Burst_Lasers_Tom_Kazansky.getID(), &WeaponTypes::Burst_Lasers_Tom_Kazansky)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATS_Laser_Battery", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATS_Laser_Battery)); +tableWeaponType.insert(std::pair(WeaponTypes::ATS_Laser_Battery.getID(), &WeaponTypes::ATS_Laser_Battery)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATS_Laser_Battery_Hero", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATS_Laser_Battery_Hero)); +tableWeaponType.insert(std::pair(WeaponTypes::ATS_Laser_Battery_Hero.getID(), &WeaponTypes::ATS_Laser_Battery_Hero)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATS_Laser_Battery_Hyperion", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATS_Laser_Battery_Hyperion)); +tableWeaponType.insert(std::pair(WeaponTypes::ATS_Laser_Battery_Hyperion.getID(), &WeaponTypes::ATS_Laser_Battery_Hyperion)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATA_Laser_Battery", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATA_Laser_Battery)); +tableWeaponType.insert(std::pair(WeaponTypes::ATA_Laser_Battery.getID(), &WeaponTypes::ATA_Laser_Battery)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATA_Laser_Battery_Hero", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATA_Laser_Battery_Hero)); +tableWeaponType.insert(std::pair(WeaponTypes::ATA_Laser_Battery_Hero.getID(), &WeaponTypes::ATA_Laser_Battery_Hero)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "ATA_Laser_Battery_Hyperion", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::ATA_Laser_Battery_Hyperion)); +tableWeaponType.insert(std::pair(WeaponTypes::ATA_Laser_Battery_Hyperion.getID(), &WeaponTypes::ATA_Laser_Battery_Hyperion)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Flame_Thrower", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Flame_Thrower)); +tableWeaponType.insert(std::pair(WeaponTypes::Flame_Thrower.getID(), &WeaponTypes::Flame_Thrower)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Flame_Thrower_Gui_Montag", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Flame_Thrower_Gui_Montag)); +tableWeaponType.insert(std::pair(WeaponTypes::Flame_Thrower_Gui_Montag.getID(), &WeaponTypes::Flame_Thrower_Gui_Montag)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Shock_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Arclite_Shock_Cannon)); +tableWeaponType.insert(std::pair(WeaponTypes::Arclite_Shock_Cannon.getID(), &WeaponTypes::Arclite_Shock_Cannon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Arclite_Shock_Cannon_Edmund_Duke", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Arclite_Shock_Cannon_Edmund_Duke)); +tableWeaponType.insert(std::pair(WeaponTypes::Arclite_Shock_Cannon_Edmund_Duke.getID(), &WeaponTypes::Arclite_Shock_Cannon_Edmund_Duke)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Longbolt_Missile", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Longbolt_Missile)); +tableWeaponType.insert(std::pair(WeaponTypes::Longbolt_Missile.getID(), &WeaponTypes::Longbolt_Missile)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Claws", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Claws)); +tableWeaponType.insert(std::pair(WeaponTypes::Claws.getID(), &WeaponTypes::Claws)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Claws_Devouring_One", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Claws_Devouring_One)); +tableWeaponType.insert(std::pair(WeaponTypes::Claws_Devouring_One.getID(), &WeaponTypes::Claws_Devouring_One)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Claws_Infested_Kerrigan", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Claws_Infested_Kerrigan)); +tableWeaponType.insert(std::pair(WeaponTypes::Claws_Infested_Kerrigan.getID(), &WeaponTypes::Claws_Infested_Kerrigan)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Needle_Spines", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Needle_Spines)); +tableWeaponType.insert(std::pair(WeaponTypes::Needle_Spines.getID(), &WeaponTypes::Needle_Spines)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Needle_Spines_Hunter_Killer", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Needle_Spines_Hunter_Killer)); +tableWeaponType.insert(std::pair(WeaponTypes::Needle_Spines_Hunter_Killer.getID(), &WeaponTypes::Needle_Spines_Hunter_Killer)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Kaiser_Blades", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Kaiser_Blades)); +tableWeaponType.insert(std::pair(WeaponTypes::Kaiser_Blades.getID(), &WeaponTypes::Kaiser_Blades)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Kaiser_Blades_Torrasque", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Kaiser_Blades_Torrasque)); +tableWeaponType.insert(std::pair(WeaponTypes::Kaiser_Blades_Torrasque.getID(), &WeaponTypes::Kaiser_Blades_Torrasque)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Toxic_Spores", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Toxic_Spores)); +tableWeaponType.insert(std::pair(WeaponTypes::Toxic_Spores.getID(), &WeaponTypes::Toxic_Spores)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spines", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Spines)); +tableWeaponType.insert(std::pair(WeaponTypes::Spines.getID(), &WeaponTypes::Spines)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Acid_Spore", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Acid_Spore)); +tableWeaponType.insert(std::pair(WeaponTypes::Acid_Spore.getID(), &WeaponTypes::Acid_Spore)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Acid_Spore_Kukulza", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Acid_Spore_Kukulza)); +tableWeaponType.insert(std::pair(WeaponTypes::Acid_Spore_Kukulza.getID(), &WeaponTypes::Acid_Spore_Kukulza)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Glave_Wurm", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Glave_Wurm)); +tableWeaponType.insert(std::pair(WeaponTypes::Glave_Wurm.getID(), &WeaponTypes::Glave_Wurm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Glave_Wurm_Kukulza", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Glave_Wurm_Kukulza)); +tableWeaponType.insert(std::pair(WeaponTypes::Glave_Wurm_Kukulza.getID(), &WeaponTypes::Glave_Wurm_Kukulza)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Seeker_Spores", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Seeker_Spores)); +tableWeaponType.insert(std::pair(WeaponTypes::Seeker_Spores.getID(), &WeaponTypes::Seeker_Spores)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Subterranean_Tentacle", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Subterranean_Tentacle)); +tableWeaponType.insert(std::pair(WeaponTypes::Subterranean_Tentacle.getID(), &WeaponTypes::Subterranean_Tentacle)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Suicide_Infested_Terran", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Suicide_Infested_Terran)); +tableWeaponType.insert(std::pair(WeaponTypes::Suicide_Infested_Terran.getID(), &WeaponTypes::Suicide_Infested_Terran)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Suicide_Scourge", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Suicide_Scourge)); +tableWeaponType.insert(std::pair(WeaponTypes::Suicide_Scourge.getID(), &WeaponTypes::Suicide_Scourge)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Particle_Beam", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Particle_Beam)); +tableWeaponType.insert(std::pair(WeaponTypes::Particle_Beam.getID(), &WeaponTypes::Particle_Beam)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psi_Blades", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psi_Blades)); +tableWeaponType.insert(std::pair(WeaponTypes::Psi_Blades.getID(), &WeaponTypes::Psi_Blades)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psi_Blades_Fenix", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psi_Blades_Fenix)); +tableWeaponType.insert(std::pair(WeaponTypes::Psi_Blades_Fenix.getID(), &WeaponTypes::Psi_Blades_Fenix)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Phase_Disruptor)); +tableWeaponType.insert(std::pair(WeaponTypes::Phase_Disruptor.getID(), &WeaponTypes::Phase_Disruptor)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor_Fenix", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Phase_Disruptor_Fenix)); +tableWeaponType.insert(std::pair(WeaponTypes::Phase_Disruptor_Fenix.getID(), &WeaponTypes::Phase_Disruptor_Fenix)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psi_Assault", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psi_Assault)); +tableWeaponType.insert(std::pair(WeaponTypes::Psi_Assault.getID(), &WeaponTypes::Psi_Assault)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Shockwave", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psionic_Shockwave)); +tableWeaponType.insert(std::pair(WeaponTypes::Psionic_Shockwave.getID(), &WeaponTypes::Psionic_Shockwave)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Shockwave_TZ_Archon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psionic_Shockwave_TZ_Archon)); +tableWeaponType.insert(std::pair(WeaponTypes::Psionic_Shockwave_TZ_Archon.getID(), &WeaponTypes::Psionic_Shockwave_TZ_Archon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dual_Photon_Blasters", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Dual_Photon_Blasters)); +tableWeaponType.insert(std::pair(WeaponTypes::Dual_Photon_Blasters.getID(), &WeaponTypes::Dual_Photon_Blasters)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dual_Photon_Blasters_Mojo", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Dual_Photon_Blasters_Mojo)); +tableWeaponType.insert(std::pair(WeaponTypes::Dual_Photon_Blasters_Mojo.getID(), &WeaponTypes::Dual_Photon_Blasters_Mojo)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dual_Photon_Blasters_Artanis", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Dual_Photon_Blasters_Artanis)); +tableWeaponType.insert(std::pair(WeaponTypes::Dual_Photon_Blasters_Artanis.getID(), &WeaponTypes::Dual_Photon_Blasters_Artanis)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anti_Matter_Missiles", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Anti_Matter_Missiles)); +tableWeaponType.insert(std::pair(WeaponTypes::Anti_Matter_Missiles.getID(), &WeaponTypes::Anti_Matter_Missiles)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anti_Matter_Missiles_Mojo", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Anti_Matter_Missiles_Mojo)); +tableWeaponType.insert(std::pair(WeaponTypes::Anti_Matter_Missiles_Mojo.getID(), &WeaponTypes::Anti_Matter_Missiles_Mojo)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Anti_Matter_Missiles_Artanis", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Anti_Matter_Missiles_Artanis)); +tableWeaponType.insert(std::pair(WeaponTypes::Anti_Matter_Missiles_Artanis.getID(), &WeaponTypes::Anti_Matter_Missiles_Artanis)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Phase_Disruptor_Cannon)); +tableWeaponType.insert(std::pair(WeaponTypes::Phase_Disruptor_Cannon.getID(), &WeaponTypes::Phase_Disruptor_Cannon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Phase_Disruptor_Cannon_Danimoth", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Phase_Disruptor_Cannon_Danimoth)); +tableWeaponType.insert(std::pair(WeaponTypes::Phase_Disruptor_Cannon_Danimoth.getID(), &WeaponTypes::Phase_Disruptor_Cannon_Danimoth)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Pulse_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Pulse_Cannon)); +tableWeaponType.insert(std::pair(WeaponTypes::Pulse_Cannon.getID(), &WeaponTypes::Pulse_Cannon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "STS_Photon_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::STS_Photon_Cannon)); +tableWeaponType.insert(std::pair(WeaponTypes::STS_Photon_Cannon.getID(), &WeaponTypes::STS_Photon_Cannon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "STA_Photon_Cannon", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::STA_Photon_Cannon)); +tableWeaponType.insert(std::pair(WeaponTypes::STA_Photon_Cannon.getID(), &WeaponTypes::STA_Photon_Cannon)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Scarab", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Scarab)); +tableWeaponType.insert(std::pair(WeaponTypes::Scarab.getID(), &WeaponTypes::Scarab)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Neutron_Flare", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Neutron_Flare)); +tableWeaponType.insert(std::pair(WeaponTypes::Neutron_Flare.getID(), &WeaponTypes::Neutron_Flare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Halo_Rockets", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Halo_Rockets)); +tableWeaponType.insert(std::pair(WeaponTypes::Halo_Rockets.getID(), &WeaponTypes::Halo_Rockets)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Corrosive_Acid", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Corrosive_Acid)); +tableWeaponType.insert(std::pair(WeaponTypes::Corrosive_Acid.getID(), &WeaponTypes::Corrosive_Acid)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Subterranean_Spines", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Subterranean_Spines)); +tableWeaponType.insert(std::pair(WeaponTypes::Subterranean_Spines.getID(), &WeaponTypes::Subterranean_Spines)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Warp_Blades", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Warp_Blades)); +tableWeaponType.insert(std::pair(WeaponTypes::Warp_Blades.getID(), &WeaponTypes::Warp_Blades)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Warp_Blades_Hero", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Warp_Blades_Hero)); +tableWeaponType.insert(std::pair(WeaponTypes::Warp_Blades_Hero.getID(), &WeaponTypes::Warp_Blades_Hero)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Warp_Blades_Zeratul", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Warp_Blades_Zeratul)); +tableWeaponType.insert(std::pair(WeaponTypes::Warp_Blades_Zeratul.getID(), &WeaponTypes::Warp_Blades_Zeratul)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Independant_Laser_Battery", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Independant_Laser_Battery)); +tableWeaponType.insert(std::pair(WeaponTypes::Independant_Laser_Battery.getID(), &WeaponTypes::Independant_Laser_Battery)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Twin_Autocannons_Floor_Trap", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Twin_Autocannons_Floor_Trap)); +tableWeaponType.insert(std::pair(WeaponTypes::Twin_Autocannons_Floor_Trap.getID(), &WeaponTypes::Twin_Autocannons_Floor_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hellfire_Missile_Pack_Wall_Trap", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Hellfire_Missile_Pack_Wall_Trap)); +tableWeaponType.insert(std::pair(WeaponTypes::Hellfire_Missile_Pack_Wall_Trap.getID(), &WeaponTypes::Hellfire_Missile_Pack_Wall_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Flame_Thrower_Wall_Trap", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Flame_Thrower_Wall_Trap)); +tableWeaponType.insert(std::pair(WeaponTypes::Flame_Thrower_Wall_Trap.getID(), &WeaponTypes::Flame_Thrower_Wall_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Hellfire_Missile_Pack_Floor_Trap", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Hellfire_Missile_Pack_Floor_Trap)); +tableWeaponType.insert(std::pair(WeaponTypes::Hellfire_Missile_Pack_Floor_Trap.getID(), &WeaponTypes::Hellfire_Missile_Pack_Floor_Trap)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Yamato_Gun", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Yamato_Gun)); +tableWeaponType.insert(std::pair(WeaponTypes::Yamato_Gun.getID(), &WeaponTypes::Yamato_Gun)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Nuclear_Strike", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Nuclear_Strike)); +tableWeaponType.insert(std::pair(WeaponTypes::Nuclear_Strike.getID(), &WeaponTypes::Nuclear_Strike)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Lockdown", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Lockdown)); +tableWeaponType.insert(std::pair(WeaponTypes::Lockdown.getID(), &WeaponTypes::Lockdown)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "EMP_Shockwave", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::EMP_Shockwave)); +tableWeaponType.insert(std::pair(WeaponTypes::EMP_Shockwave.getID(), &WeaponTypes::EMP_Shockwave)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Irradiate", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Irradiate)); +tableWeaponType.insert(std::pair(WeaponTypes::Irradiate.getID(), &WeaponTypes::Irradiate)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Parasite", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Parasite)); +tableWeaponType.insert(std::pair(WeaponTypes::Parasite.getID(), &WeaponTypes::Parasite)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Spawn_Broodlings", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Spawn_Broodlings)); +tableWeaponType.insert(std::pair(WeaponTypes::Spawn_Broodlings.getID(), &WeaponTypes::Spawn_Broodlings)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Ensnare", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Ensnare)); +tableWeaponType.insert(std::pair(WeaponTypes::Ensnare.getID(), &WeaponTypes::Ensnare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Dark_Swarm", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Dark_Swarm)); +tableWeaponType.insert(std::pair(WeaponTypes::Dark_Swarm.getID(), &WeaponTypes::Dark_Swarm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Plague", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Plague)); +tableWeaponType.insert(std::pair(WeaponTypes::Plague.getID(), &WeaponTypes::Plague)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Consume", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Consume)); +tableWeaponType.insert(std::pair(WeaponTypes::Consume.getID(), &WeaponTypes::Consume)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Stasis_Field", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Stasis_Field)); +tableWeaponType.insert(std::pair(WeaponTypes::Stasis_Field.getID(), &WeaponTypes::Stasis_Field)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Psionic_Storm", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Psionic_Storm)); +tableWeaponType.insert(std::pair(WeaponTypes::Psionic_Storm.getID(), &WeaponTypes::Psionic_Storm)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Disruption_Web", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Disruption_Web)); +tableWeaponType.insert(std::pair(WeaponTypes::Disruption_Web.getID(), &WeaponTypes::Disruption_Web)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Restoration", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Restoration)); +tableWeaponType.insert(std::pair(WeaponTypes::Restoration.getID(), &WeaponTypes::Restoration)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Mind_Control", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Mind_Control)); +tableWeaponType.insert(std::pair(WeaponTypes::Mind_Control.getID(), &WeaponTypes::Mind_Control)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Feedback", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Feedback)); +tableWeaponType.insert(std::pair(WeaponTypes::Feedback.getID(), &WeaponTypes::Feedback)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Optical_Flare", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Optical_Flare)); +tableWeaponType.insert(std::pair(WeaponTypes::Optical_Flare.getID(), &WeaponTypes::Optical_Flare)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Maelstrom", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Maelstrom)); +tableWeaponType.insert(std::pair(WeaponTypes::Maelstrom.getID(), &WeaponTypes::Maelstrom)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "None", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::None)); +tableWeaponType.insert(std::pair(WeaponTypes::None.getID(), &WeaponTypes::None)); +env->SetStaticObjectField(cls, env->GetStaticFieldID(cls, "Unknown", "Lbwapi/WeaponType;"), env->CallStaticObjectMethod(cls, getId, (jlong)&WeaponTypes::Unknown)); +tableWeaponType.insert(std::pair(WeaponTypes::Unknown.getID(), &WeaponTypes::Unknown)); println("Connecting to Broodwar..."); reconnect(); println("Connection successful, starting match..."); @@ -4579,7 +6414,7 @@ println("Connecting to Broodwar..."); jclass posCls = env->FindClass("Lbwapi/Position;"); jobject moduleObj = env->GetObjectField(obj, env->GetFieldID(cls, "module", "Lbwapi/AIModule;")); jclass moduleCls = env->GetObjectClass(moduleObj); - env->SetObjectField(obj, env->GetFieldID(cls, "game", "Lbwapi/Game;"), env->CallStaticObjectMethod(gamecls, env->GetStaticMethodID(gamecls, "get", "(J)Lbwapi/Game;"), (long)Broodwar)); + env->SetObjectField(obj, env->GetFieldID(cls, "game", "Lbwapi/Game;"), env->CallStaticObjectMethod(gamecls, env->GetStaticMethodID(gamecls, "get", "(J)Lbwapi/Game;"), (long)Broodwarptr)); jmethodID updateMethodID = env->GetMethodID(env->GetObjectClass(obj), "update", "()V"); jmethodID matchStartCallback = env->GetMethodID(moduleCls, "onStart", "()V"); @@ -4601,11 +6436,11 @@ println("Connecting to Broodwar..."); jmethodID unitCompleteCallback = env->GetMethodID(moduleCls, "onUnitComplete", "(Lbwapi/Unit;)V"); jmethodID playerDroppedCallback = env->GetMethodID(moduleCls, "onPlayerDropped", "(Lbwapi/Player;)V"); while (true) { - if (Broodwar != NULL) { + if (Broodwarptr != NULL) { println("Waiting..."); - while (!Broodwar->isInGame()) { + while (!Broodwarptr->isInGame()) { BWAPIClient.update(); - if (Broodwar == NULL) { + if (Broodwarptr == NULL) { println("Match ended."); return; } @@ -4619,10 +6454,15 @@ println("Connecting to Broodwar..."); env->CallVoidMethod(obj, updateMethodID); - for(std::list::iterator it = Broodwar->getEvents().begin(); it!=Broodwar->getEvents().end(); it++) + for(std::list::const_iterator it = Broodwar->getEvents().begin(); it!=Broodwar->getEvents().end(); it++) { switch (it->getType()) { case EventType::MatchStart: + BWTA::BWTA_Result::regions.clear(); + BWTA::BWTA_Result::baselocations.clear(); + BWTA::BWTA_Result::startlocations.clear(); + BWTA::BWTA_Result::chokepoints.clear(); + BWTA::BWTA_Result::unwalkablePolygons.clear(); env->CallVoidMethod(moduleObj, matchStartCallback); break; case EventType::MatchEnd: @@ -4641,7 +6481,7 @@ println("Connecting to Broodwar..."); env->CallVoidMethod(moduleObj, playerLeftCallback, env->CallStaticObjectMethod(playerCls, env->GetStaticMethodID(playerCls, "get", "(J)Lbwapi/Player;"), (jlong)it->getPlayer())); break; case EventType::NukeDetect: - env->CallVoidMethod(moduleObj, nukeDetectCallback, env->NewObject(posCls, env->GetMethodID(posCls,"", "(II)V"), it->getPosition().x(), it->getPosition().y())); + env->CallVoidMethod(moduleObj, nukeDetectCallback, env->NewObject(posCls, env->GetMethodID(posCls,"", "(II)V"), it->getPosition().x, it->getPosition().y)); break; case EventType::UnitDiscover: env->CallVoidMethod(moduleObj, unitDiscoverCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); @@ -4673,9 +6513,6 @@ println("Connecting to Broodwar..."); case EventType::UnitComplete: env->CallVoidMethod(moduleObj, unitCompleteCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, "get", "(J)Lbwapi/Unit;"), (jlong)it->getUnit())); break; - case EventType::PlayerDropped: - env->CallVoidMethod(moduleObj, playerDroppedCallback, env->CallStaticObjectMethod(playerCls, env->GetStaticMethodID(playerCls, "get", "(J)Lbwapi/Player;"))); - break; } } diff --git a/compiled4/bwapi4/AIModule.class b/compiled4/bwapi4/AIModule.class index cdcf13a..62d94c7 100644 Binary files a/compiled4/bwapi4/AIModule.class and b/compiled4/bwapi4/AIModule.class differ diff --git a/compiled4/bwapi4/AbstractPoint.class b/compiled4/bwapi4/AbstractPoint.class new file mode 100644 index 0000000..3ef0504 Binary files /dev/null and b/compiled4/bwapi4/AbstractPoint.class differ diff --git a/compiled4/bwapi4/BestFilter.class b/compiled4/bwapi4/BestFilter.class index 86527df..7f9ede7 100644 Binary files a/compiled4/bwapi4/BestFilter.class and b/compiled4/bwapi4/BestFilter.class differ diff --git a/compiled4/bwapi4/Bullet.class b/compiled4/bwapi4/Bullet.class index 191d546..2dcaf2e 100644 Binary files a/compiled4/bwapi4/Bullet.class and b/compiled4/bwapi4/Bullet.class differ diff --git a/compiled4/bwapi4/BulletType.class b/compiled4/bwapi4/BulletType.class index d8d677a..2ce8d19 100644 Binary files a/compiled4/bwapi4/BulletType.class and b/compiled4/bwapi4/BulletType.class differ diff --git a/compiled4/bwapi4/Bulletset.class b/compiled4/bwapi4/Bulletset.class index 5a72080..353dc2a 100644 Binary files a/compiled4/bwapi4/Bulletset.class and b/compiled4/bwapi4/Bulletset.class differ diff --git a/compiled4/bwapi4/CenteredObject.class b/compiled4/bwapi4/CenteredObject.class new file mode 100644 index 0000000..38f785b Binary files /dev/null and b/compiled4/bwapi4/CenteredObject.class differ diff --git a/compiled4/bwapi4/Client.class b/compiled4/bwapi4/Client.class index c6347eb..00d3ba9 100644 Binary files a/compiled4/bwapi4/Client.class and b/compiled4/bwapi4/Client.class differ diff --git a/compiled4/bwapi4/Color.class b/compiled4/bwapi4/Color.class index 7a47320..8ca1194 100644 Binary files a/compiled4/bwapi4/Color.class and b/compiled4/bwapi4/Color.class differ diff --git a/compiled4/bwapi4/CompareFilter.class b/compiled4/bwapi4/CompareFilter.class index aedec34..566d1ad 100644 Binary files a/compiled4/bwapi4/CompareFilter.class and b/compiled4/bwapi4/CompareFilter.class differ diff --git a/compiled4/bwapi4/DamageType.class b/compiled4/bwapi4/DamageType.class index df19040..4b12781 100644 Binary files a/compiled4/bwapi4/DamageType.class and b/compiled4/bwapi4/DamageType.class differ diff --git a/compiled4/bwapi4/Error.class b/compiled4/bwapi4/Error.class index d00d670..47fcf2f 100644 Binary files a/compiled4/bwapi4/Error.class and b/compiled4/bwapi4/Error.class differ diff --git a/compiled4/bwapi4/Event.class b/compiled4/bwapi4/Event.class index ba33011..321ad11 100644 Binary files a/compiled4/bwapi4/Event.class and b/compiled4/bwapi4/Event.class differ diff --git a/compiled4/bwapi4/ExplosionType.class b/compiled4/bwapi4/ExplosionType.class index f8703c9..feddefd 100644 Binary files a/compiled4/bwapi4/ExplosionType.class and b/compiled4/bwapi4/ExplosionType.class differ diff --git a/compiled4/bwapi4/Force.class b/compiled4/bwapi4/Force.class index c1481c6..73df7e3 100644 Binary files a/compiled4/bwapi4/Force.class and b/compiled4/bwapi4/Force.class differ diff --git a/compiled4/bwapi4/Forceset.class b/compiled4/bwapi4/Forceset.class index 4ee89c2..b32b92d 100644 Binary files a/compiled4/bwapi4/Forceset.class and b/compiled4/bwapi4/Forceset.class differ diff --git a/compiled4/bwapi4/Game.class b/compiled4/bwapi4/Game.class index b001212..e7521c8 100644 Binary files a/compiled4/bwapi4/Game.class and b/compiled4/bwapi4/Game.class differ diff --git a/compiled4/bwapi4/GameType.class b/compiled4/bwapi4/GameType.class index 4a5045b..1150941 100644 Binary files a/compiled4/bwapi4/GameType.class and b/compiled4/bwapi4/GameType.class differ diff --git a/compiled4/bwapi4/GameWrapper.class b/compiled4/bwapi4/GameWrapper.class index 6d348a9..4202c6c 100644 Binary files a/compiled4/bwapi4/GameWrapper.class and b/compiled4/bwapi4/GameWrapper.class differ diff --git a/compiled4/bwapi4/InterfaceEvent.class b/compiled4/bwapi4/InterfaceEvent.class index c2a4a0c..f0994c9 100644 Binary files a/compiled4/bwapi4/InterfaceEvent.class and b/compiled4/bwapi4/InterfaceEvent.class differ diff --git a/compiled4/bwapi4/Order.class b/compiled4/bwapi4/Order.class index f3f8360..74399e6 100644 Binary files a/compiled4/bwapi4/Order.class and b/compiled4/bwapi4/Order.class differ diff --git a/compiled4/bwapi4/Player.class b/compiled4/bwapi4/Player.class index 8cb93cf..12c4102 100644 Binary files a/compiled4/bwapi4/Player.class and b/compiled4/bwapi4/Player.class differ diff --git a/compiled4/bwapi4/PlayerType.class b/compiled4/bwapi4/PlayerType.class index 1f668b0..b7f6982 100644 Binary files a/compiled4/bwapi4/PlayerType.class and b/compiled4/bwapi4/PlayerType.class differ diff --git a/compiled4/bwapi4/Playerset.class b/compiled4/bwapi4/Playerset.class index 07493b1..762e4f4 100644 Binary files a/compiled4/bwapi4/Playerset.class and b/compiled4/bwapi4/Playerset.class differ diff --git a/compiled4/bwapi4/Point.class b/compiled4/bwapi4/Point.class index b86556d..f617b9b 100644 Binary files a/compiled4/bwapi4/Point.class and b/compiled4/bwapi4/Point.class differ diff --git a/compiled4/bwapi4/Position.class b/compiled4/bwapi4/Position.class index 4daec44..a4aa9aa 100644 Binary files a/compiled4/bwapi4/Position.class and b/compiled4/bwapi4/Position.class differ diff --git a/compiled4/bwapi4/PositionOrUnit.class b/compiled4/bwapi4/PositionOrUnit.class index 761460b..61e786d 100644 Binary files a/compiled4/bwapi4/PositionOrUnit.class and b/compiled4/bwapi4/PositionOrUnit.class differ diff --git a/compiled4/bwapi4/PositionedObject.class b/compiled4/bwapi4/PositionedObject.class new file mode 100644 index 0000000..68cf07d Binary files /dev/null and b/compiled4/bwapi4/PositionedObject.class differ diff --git a/compiled4/bwapi4/Race.class b/compiled4/bwapi4/Race.class index f013dab..ee0913c 100644 Binary files a/compiled4/bwapi4/Race.class and b/compiled4/bwapi4/Race.class differ diff --git a/compiled4/bwapi4/Region.class b/compiled4/bwapi4/Region.class index b13fa9a..f3db5bf 100644 Binary files a/compiled4/bwapi4/Region.class and b/compiled4/bwapi4/Region.class differ diff --git a/compiled4/bwapi4/Regionset.class b/compiled4/bwapi4/Regionset.class index 77bf48b..2ff83d3 100644 Binary files a/compiled4/bwapi4/Regionset.class and b/compiled4/bwapi4/Regionset.class differ diff --git a/compiled4/bwapi4/TechType.class b/compiled4/bwapi4/TechType.class index 7eea5eb..3d83711 100644 Binary files a/compiled4/bwapi4/TechType.class and b/compiled4/bwapi4/TechType.class differ diff --git a/compiled4/bwapi4/UnaryFilter.class b/compiled4/bwapi4/UnaryFilter.class index 0a3b286..686ac7e 100644 Binary files a/compiled4/bwapi4/UnaryFilter.class and b/compiled4/bwapi4/UnaryFilter.class differ diff --git a/compiled4/bwapi4/Unit.class b/compiled4/bwapi4/Unit.class index 3cb6f8b..2d6f921 100644 Binary files a/compiled4/bwapi4/Unit.class and b/compiled4/bwapi4/Unit.class differ diff --git a/compiled4/bwapi4/UnitCommand.class b/compiled4/bwapi4/UnitCommand.class index a1c58fe..d41833f 100644 Binary files a/compiled4/bwapi4/UnitCommand.class and b/compiled4/bwapi4/UnitCommand.class differ diff --git a/compiled4/bwapi4/UnitCommandType.class b/compiled4/bwapi4/UnitCommandType.class index dcd4f7e..9b81c5d 100644 Binary files a/compiled4/bwapi4/UnitCommandType.class and b/compiled4/bwapi4/UnitCommandType.class differ diff --git a/compiled4/bwapi4/UnitSizeType.class b/compiled4/bwapi4/UnitSizeType.class index 8936dfb..a7a0409 100644 Binary files a/compiled4/bwapi4/UnitSizeType.class and b/compiled4/bwapi4/UnitSizeType.class differ diff --git a/compiled4/bwapi4/UnitType.class b/compiled4/bwapi4/UnitType.class index 4293d03..95366c3 100644 Binary files a/compiled4/bwapi4/UnitType.class and b/compiled4/bwapi4/UnitType.class differ diff --git a/compiled4/bwapi4/Unitset.class b/compiled4/bwapi4/Unitset.class index f5c581a..35322b6 100644 Binary files a/compiled4/bwapi4/Unitset.class and b/compiled4/bwapi4/Unitset.class differ diff --git a/compiled4/bwapi4/UpgradeType.class b/compiled4/bwapi4/UpgradeType.class index f670702..d50b2e4 100644 Binary files a/compiled4/bwapi4/UpgradeType.class and b/compiled4/bwapi4/UpgradeType.class differ diff --git a/compiled4/bwapi4/WeaponType.class b/compiled4/bwapi4/WeaponType.class index 2a6643e..041e90e 100644 Binary files a/compiled4/bwapi4/WeaponType.class and b/compiled4/bwapi4/WeaponType.class differ diff --git a/concat_header4.h b/concat_header4.h index a25c3ae..5a80927 100644 --- a/concat_header4.h +++ b/concat_header4.h @@ -1,5 +1,16 @@ /* DO NOT EDIT THIS FILE - it is machine generated */ #include +/* Header for class bwapi4_AbstractPoint */ + +#ifndef _Included_bwapi4_AbstractPoint +#define _Included_bwapi4_AbstractPoint +#ifdef __cplusplus +extern "C" { +#endif +#ifdef __cplusplus +} +#endif +#endif /* Header for class bwapi4_AIModule */ #ifndef _Included_bwapi4_AIModule @@ -314,6 +325,17 @@ extern "C" { } #endif #endif +/* Header for class bwapi4_CenteredObject */ + +#ifndef _Included_bwapi4_CenteredObject +#define _Included_bwapi4_CenteredObject +#ifdef __cplusplus +extern "C" { +#endif +#ifdef __cplusplus +} +#endif +#endif /* Header for class bwapi4_Client */ #ifndef _Included_bwapi4_Client @@ -513,7 +535,7 @@ JNIEXPORT jstring JNICALL Java_bwapi4_Force_getName_1native /* * Class: bwapi4_Force * Method: getPlayers_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Force_getPlayers_1native (JNIEnv *, jobject, jlong); @@ -532,7 +554,7 @@ extern "C" { /* * Class: bwapi4_Forceset * Method: getPlayers_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Forceset_getPlayers_1native (JNIEnv *, jobject, jlong); @@ -551,7 +573,7 @@ extern "C" { /* * Class: bwapi4_Game * Method: getForces_native - * Signature: (J)Lbwapi4/Forceset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getForces_1native (JNIEnv *, jobject, jlong); @@ -559,7 +581,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getForces_1native /* * Class: bwapi4_Game * Method: getPlayers_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getPlayers_1native (JNIEnv *, jobject, jlong); @@ -567,7 +589,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getPlayers_1native /* * Class: bwapi4_Game * Method: getAllUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getAllUnits_1native (JNIEnv *, jobject, jlong); @@ -575,7 +597,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getAllUnits_1native /* * Class: bwapi4_Game * Method: getMinerals_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getMinerals_1native (JNIEnv *, jobject, jlong); @@ -583,7 +605,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getMinerals_1native /* * Class: bwapi4_Game * Method: getGeysers_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getGeysers_1native (JNIEnv *, jobject, jlong); @@ -591,7 +613,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getGeysers_1native /* * Class: bwapi4_Game * Method: getNeutralUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getNeutralUnits_1native (JNIEnv *, jobject, jlong); @@ -599,7 +621,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getNeutralUnits_1native /* * Class: bwapi4_Game * Method: getStaticMinerals_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticMinerals_1native (JNIEnv *, jobject, jlong); @@ -607,7 +629,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticMinerals_1native /* * Class: bwapi4_Game * Method: getStaticGeysers_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticGeysers_1native (JNIEnv *, jobject, jlong); @@ -615,7 +637,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticGeysers_1native /* * Class: bwapi4_Game * Method: getStaticNeutralUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticNeutralUnits_1native (JNIEnv *, jobject, jlong); @@ -623,7 +645,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticNeutralUnits_1native /* * Class: bwapi4_Game * Method: getBullets_native - * Signature: (J)Lbwapi4/Bulletset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getBullets_1native (JNIEnv *, jobject, jlong); @@ -799,7 +821,7 @@ JNIEXPORT void JNICALL Java_bwapi4_Game_enableFlag_1native /* * Class: bwapi4_Game * Method: getUnitsOnTile_native - * Signature: (JIILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JIILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JIILbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jint, jint, jobject); @@ -807,7 +829,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JIILbwapi4_Un /* * Class: bwapi4_Game * Method: getUnitsOnTile_native - * Signature: (JLbwapi4/TilePosition;Lbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/TilePosition;Lbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JLbwapi4_TilePosition_2Lbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jobject, jobject); @@ -815,7 +837,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JLbwapi4_Tile /* * Class: bwapi4_Game * Method: getUnitsInRectangle_native - * Signature: (JIIIILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JIIIILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JIIIILbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jint, jint, jint, jint, jobject); @@ -823,7 +845,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JIIIILbw /* * Class: bwapi4_Game * Method: getUnitsInRectangle_native - * Signature: (JLbwapi4/Position;Lbwapi4/Position;Lbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/Position;Lbwapi4/Position;Lbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JLbwapi4_Position_2Lbwapi4_Position_2Lbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jobject, jobject, jobject); @@ -831,7 +853,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JLbwapi4 /* * Class: bwapi4_Game * Method: getUnitsInRadius_native - * Signature: (JIIILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JIIILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRadius_1native__JIIILbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jint, jint, jint, jobject); @@ -839,7 +861,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRadius_1native__JIIILbwapi4 /* * Class: bwapi4_Game * Method: getUnitsInRadius_native - * Signature: (JLbwapi4/Position;ILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/Position;ILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRadius_1native__JLbwapi4_Position_2ILbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jobject, jint, jobject); @@ -1276,6 +1298,14 @@ JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canUpgrade_1native__JLbwapi4_Upgrade JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canUpgrade_1native__JLbwapi4_UpgradeType_2Lbwapi4_Unit_2Z (JNIEnv *, jobject, jlong, jobject, jobject, jboolean); +/* + * Class: bwapi4_Game + * Method: printf_native + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_printf_1native + (JNIEnv *, jobject, jlong, jstring); + /* * Class: bwapi4_Game * Method: vPrintf_native @@ -1284,6 +1314,14 @@ JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canUpgrade_1native__JLbwapi4_Upgrade JNIEXPORT void JNICALL Java_bwapi4_Game_vPrintf_1native (JNIEnv *, jobject, jlong, jstring, jobjectArray); +/* + * Class: bwapi4_Game + * Method: sendText_native + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_sendText_1native + (JNIEnv *, jobject, jlong, jstring); + /* * Class: bwapi4_Game * Method: vSendText_native @@ -1292,6 +1330,14 @@ JNIEXPORT void JNICALL Java_bwapi4_Game_vPrintf_1native JNIEXPORT void JNICALL Java_bwapi4_Game_vSendText_1native (JNIEnv *, jobject, jlong, jstring, jobjectArray); +/* + * Class: bwapi4_Game + * Method: sendTextEx_native + * Signature: (JZLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_sendTextEx_1native + (JNIEnv *, jobject, jlong, jboolean, jstring); + /* * Class: bwapi4_Game * Method: vSendTextEx_native @@ -1383,7 +1429,7 @@ JNIEXPORT void JNICALL Java_bwapi4_Game_setLocalSpeed_1native /* * Class: bwapi4_Game * Method: issueCommand_native - * Signature: (JLbwapi4/Unitset;Lbwapi4/UnitCommand;)Z + * Signature: (JLjava/util/List;Lbwapi4/UnitCommand;)Z */ JNIEXPORT jboolean JNICALL Java_bwapi4_Game_issueCommand_1native (JNIEnv *, jobject, jlong, jobject, jobject); @@ -1391,7 +1437,7 @@ JNIEXPORT jboolean JNICALL Java_bwapi4_Game_issueCommand_1native /* * Class: bwapi4_Game * Method: getSelectedUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getSelectedUnits_1native (JNIEnv *, jobject, jlong); @@ -1423,7 +1469,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_neutral_1native /* * Class: bwapi4_Game * Method: allies_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_allies_1native (JNIEnv *, jobject, jlong); @@ -1431,7 +1477,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_allies_1native /* * Class: bwapi4_Game * Method: enemies_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_enemies_1native (JNIEnv *, jobject, jlong); @@ -1439,7 +1485,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_enemies_1native /* * Class: bwapi4_Game * Method: observers_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_observers_1native (JNIEnv *, jobject, jlong); @@ -1468,6 +1514,62 @@ JNIEXPORT void JNICALL Java_bwapi4_Game_setTextSize_1native__JLbwapi4_Text_Size_ JNIEXPORT void JNICALL Java_bwapi4_Game_vDrawText_1native (JNIEnv *, jobject, jlong, jobject, jint, jint, jstring, jobjectArray); +/* + * Class: bwapi4_Game + * Method: drawText_native + * Signature: (JLbwapi4/CoordinateType/Enum;IILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawText_1native + (JNIEnv *, jobject, jlong, jobject, jint, jint, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextMap_native + * Signature: (JIILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMap_1native__JIILjava_lang_String_2 + (JNIEnv *, jobject, jlong, jint, jint, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextMap_native + * Signature: (JLbwapi4/Position;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMap_1native__JLbwapi4_Position_2Ljava_lang_String_2 + (JNIEnv *, jobject, jlong, jobject, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextMouse_native + * Signature: (JIILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMouse_1native__JIILjava_lang_String_2 + (JNIEnv *, jobject, jlong, jint, jint, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextMouse_native + * Signature: (JLbwapi4/Position;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMouse_1native__JLbwapi4_Position_2Ljava_lang_String_2 + (JNIEnv *, jobject, jlong, jobject, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextScreen_native + * Signature: (JIILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextScreen_1native__JIILjava_lang_String_2 + (JNIEnv *, jobject, jlong, jint, jint, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextScreen_native + * Signature: (JLbwapi4/Position;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextScreen_1native__JLbwapi4_Position_2Ljava_lang_String_2 + (JNIEnv *, jobject, jlong, jobject, jstring); + /* * Class: bwapi4_Game * Method: drawBox_native @@ -2919,7 +3021,7 @@ extern "C" { /* * Class: bwapi4_Playerset * Method: getUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Playerset_getUnits_1native (JNIEnv *, jobject, jlong); @@ -3045,6 +3147,17 @@ JNIEXPORT jdouble JNICALL Java_bwapi4_Position_getLength JNIEXPORT jboolean JNICALL Java_bwapi4_Position_hasPath (JNIEnv *, jobject, jobject); +#ifdef __cplusplus +} +#endif +#endif +/* Header for class bwapi4_PositionedObject */ + +#ifndef _Included_bwapi4_PositionedObject +#define _Included_bwapi4_PositionedObject +#ifdef __cplusplus +extern "C" { +#endif #ifdef __cplusplus } #endif @@ -3217,7 +3330,7 @@ JNIEXPORT jint JNICALL Java_bwapi4_Region_getDistance_1native /* * Class: bwapi4_Region * Method: getUnits_native - * Signature: (JLbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Region_getUnits_1native (JNIEnv *, jobject, jlong, jobject); @@ -3244,7 +3357,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Regionset_getCenter_1native /* * Class: bwapi4_Regionset * Method: getUnits_native - * Signature: (JLbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Regionset_getUnits_1native (JNIEnv *, jobject, jlong, jobject); @@ -3880,7 +3993,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getTransport_1native /* * Class: bwapi4_Unit * Method: getLoadedUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getLoadedUnits_1native (JNIEnv *, jobject, jlong); @@ -3904,7 +4017,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getCarrier_1native /* * Class: bwapi4_Unit * Method: getInterceptors_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getInterceptors_1native (JNIEnv *, jobject, jlong); @@ -3920,7 +4033,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getHatchery_1native /* * Class: bwapi4_Unit * Method: getLarva_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getLarva_1native (JNIEnv *, jobject, jlong); @@ -3928,7 +4041,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getLarva_1native /* * Class: bwapi4_Unit * Method: getUnitsInRadius_native - * Signature: (JILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getUnitsInRadius_1native (JNIEnv *, jobject, jlong, jint, jobject); @@ -3936,7 +4049,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getUnitsInRadius_1native /* * Class: bwapi4_Unit * Method: getUnitsInWeaponRange_native - * Signature: (JLbwapi4/WeaponType;Lbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/WeaponType;Lbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getUnitsInWeaponRange_1native (JNIEnv *, jobject, jlong, jobject, jobject); @@ -7052,7 +7165,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getPosition_1native /* * Class: bwapi4_Unitset * Method: getLoadedUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getLoadedUnits_1native (JNIEnv *, jobject, jlong); @@ -7060,7 +7173,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getLoadedUnits_1native /* * Class: bwapi4_Unitset * Method: getInterceptors_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getInterceptors_1native (JNIEnv *, jobject, jlong); @@ -7068,7 +7181,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getInterceptors_1native /* * Class: bwapi4_Unitset * Method: getLarva_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getLarva_1native (JNIEnv *, jobject, jlong); @@ -7100,7 +7213,7 @@ JNIEXPORT void JNICALL Java_bwapi4_Unitset_setClientInfo_1native__JII /* * Class: bwapi4_Unitset * Method: getUnitsInRadius_native - * Signature: (JILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getUnitsInRadius_1native (JNIEnv *, jobject, jlong, jint, jobject); diff --git a/headers4/bwapi4_AbstractPoint.h b/headers4/bwapi4_AbstractPoint.h new file mode 100644 index 0000000..d559dcc --- /dev/null +++ b/headers4/bwapi4_AbstractPoint.h @@ -0,0 +1,13 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class bwapi4_AbstractPoint */ + +#ifndef _Included_bwapi4_AbstractPoint +#define _Included_bwapi4_AbstractPoint +#ifdef __cplusplus +extern "C" { +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/headers4/bwapi4_CenteredObject.h b/headers4/bwapi4_CenteredObject.h new file mode 100644 index 0000000..d386d6e --- /dev/null +++ b/headers4/bwapi4_CenteredObject.h @@ -0,0 +1,13 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class bwapi4_CenteredObject */ + +#ifndef _Included_bwapi4_CenteredObject +#define _Included_bwapi4_CenteredObject +#ifdef __cplusplus +extern "C" { +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/headers4/bwapi4_Force.h b/headers4/bwapi4_Force.h index a64f65d..c6b8227 100644 --- a/headers4/bwapi4_Force.h +++ b/headers4/bwapi4_Force.h @@ -26,7 +26,7 @@ JNIEXPORT jstring JNICALL Java_bwapi4_Force_getName_1native /* * Class: bwapi4_Force * Method: getPlayers_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Force_getPlayers_1native (JNIEnv *, jobject, jlong); diff --git a/headers4/bwapi4_Forceset.h b/headers4/bwapi4_Forceset.h index 2b1d86f..a36287d 100644 --- a/headers4/bwapi4_Forceset.h +++ b/headers4/bwapi4_Forceset.h @@ -10,7 +10,7 @@ extern "C" { /* * Class: bwapi4_Forceset * Method: getPlayers_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Forceset_getPlayers_1native (JNIEnv *, jobject, jlong); diff --git a/headers4/bwapi4_Game.h b/headers4/bwapi4_Game.h index 87bfe25..506686e 100644 --- a/headers4/bwapi4_Game.h +++ b/headers4/bwapi4_Game.h @@ -10,7 +10,7 @@ extern "C" { /* * Class: bwapi4_Game * Method: getForces_native - * Signature: (J)Lbwapi4/Forceset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getForces_1native (JNIEnv *, jobject, jlong); @@ -18,7 +18,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getForces_1native /* * Class: bwapi4_Game * Method: getPlayers_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getPlayers_1native (JNIEnv *, jobject, jlong); @@ -26,7 +26,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getPlayers_1native /* * Class: bwapi4_Game * Method: getAllUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getAllUnits_1native (JNIEnv *, jobject, jlong); @@ -34,7 +34,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getAllUnits_1native /* * Class: bwapi4_Game * Method: getMinerals_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getMinerals_1native (JNIEnv *, jobject, jlong); @@ -42,7 +42,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getMinerals_1native /* * Class: bwapi4_Game * Method: getGeysers_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getGeysers_1native (JNIEnv *, jobject, jlong); @@ -50,7 +50,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getGeysers_1native /* * Class: bwapi4_Game * Method: getNeutralUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getNeutralUnits_1native (JNIEnv *, jobject, jlong); @@ -58,7 +58,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getNeutralUnits_1native /* * Class: bwapi4_Game * Method: getStaticMinerals_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticMinerals_1native (JNIEnv *, jobject, jlong); @@ -66,7 +66,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticMinerals_1native /* * Class: bwapi4_Game * Method: getStaticGeysers_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticGeysers_1native (JNIEnv *, jobject, jlong); @@ -74,7 +74,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticGeysers_1native /* * Class: bwapi4_Game * Method: getStaticNeutralUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticNeutralUnits_1native (JNIEnv *, jobject, jlong); @@ -82,7 +82,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getStaticNeutralUnits_1native /* * Class: bwapi4_Game * Method: getBullets_native - * Signature: (J)Lbwapi4/Bulletset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getBullets_1native (JNIEnv *, jobject, jlong); @@ -258,7 +258,7 @@ JNIEXPORT void JNICALL Java_bwapi4_Game_enableFlag_1native /* * Class: bwapi4_Game * Method: getUnitsOnTile_native - * Signature: (JIILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JIILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JIILbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jint, jint, jobject); @@ -266,7 +266,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JIILbwapi4_Un /* * Class: bwapi4_Game * Method: getUnitsOnTile_native - * Signature: (JLbwapi4/TilePosition;Lbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/TilePosition;Lbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JLbwapi4_TilePosition_2Lbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jobject, jobject); @@ -274,7 +274,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsOnTile_1native__JLbwapi4_Tile /* * Class: bwapi4_Game * Method: getUnitsInRectangle_native - * Signature: (JIIIILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JIIIILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JIIIILbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jint, jint, jint, jint, jobject); @@ -282,7 +282,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JIIIILbw /* * Class: bwapi4_Game * Method: getUnitsInRectangle_native - * Signature: (JLbwapi4/Position;Lbwapi4/Position;Lbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/Position;Lbwapi4/Position;Lbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JLbwapi4_Position_2Lbwapi4_Position_2Lbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jobject, jobject, jobject); @@ -290,7 +290,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRectangle_1native__JLbwapi4 /* * Class: bwapi4_Game * Method: getUnitsInRadius_native - * Signature: (JIIILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JIIILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRadius_1native__JIIILbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jint, jint, jint, jobject); @@ -298,7 +298,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRadius_1native__JIIILbwapi4 /* * Class: bwapi4_Game * Method: getUnitsInRadius_native - * Signature: (JLbwapi4/Position;ILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/Position;ILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getUnitsInRadius_1native__JLbwapi4_Position_2ILbwapi4_UnitFilter_2 (JNIEnv *, jobject, jlong, jobject, jint, jobject); @@ -735,6 +735,14 @@ JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canUpgrade_1native__JLbwapi4_Upgrade JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canUpgrade_1native__JLbwapi4_UpgradeType_2Lbwapi4_Unit_2Z (JNIEnv *, jobject, jlong, jobject, jobject, jboolean); +/* + * Class: bwapi4_Game + * Method: printf_native + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_printf_1native + (JNIEnv *, jobject, jlong, jstring); + /* * Class: bwapi4_Game * Method: vPrintf_native @@ -743,6 +751,14 @@ JNIEXPORT jboolean JNICALL Java_bwapi4_Game_canUpgrade_1native__JLbwapi4_Upgrade JNIEXPORT void JNICALL Java_bwapi4_Game_vPrintf_1native (JNIEnv *, jobject, jlong, jstring, jobjectArray); +/* + * Class: bwapi4_Game + * Method: sendText_native + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_sendText_1native + (JNIEnv *, jobject, jlong, jstring); + /* * Class: bwapi4_Game * Method: vSendText_native @@ -751,6 +767,14 @@ JNIEXPORT void JNICALL Java_bwapi4_Game_vPrintf_1native JNIEXPORT void JNICALL Java_bwapi4_Game_vSendText_1native (JNIEnv *, jobject, jlong, jstring, jobjectArray); +/* + * Class: bwapi4_Game + * Method: sendTextEx_native + * Signature: (JZLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_sendTextEx_1native + (JNIEnv *, jobject, jlong, jboolean, jstring); + /* * Class: bwapi4_Game * Method: vSendTextEx_native @@ -842,7 +866,7 @@ JNIEXPORT void JNICALL Java_bwapi4_Game_setLocalSpeed_1native /* * Class: bwapi4_Game * Method: issueCommand_native - * Signature: (JLbwapi4/Unitset;Lbwapi4/UnitCommand;)Z + * Signature: (JLjava/util/List;Lbwapi4/UnitCommand;)Z */ JNIEXPORT jboolean JNICALL Java_bwapi4_Game_issueCommand_1native (JNIEnv *, jobject, jlong, jobject, jobject); @@ -850,7 +874,7 @@ JNIEXPORT jboolean JNICALL Java_bwapi4_Game_issueCommand_1native /* * Class: bwapi4_Game * Method: getSelectedUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_getSelectedUnits_1native (JNIEnv *, jobject, jlong); @@ -882,7 +906,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_neutral_1native /* * Class: bwapi4_Game * Method: allies_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_allies_1native (JNIEnv *, jobject, jlong); @@ -890,7 +914,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_allies_1native /* * Class: bwapi4_Game * Method: enemies_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_enemies_1native (JNIEnv *, jobject, jlong); @@ -898,7 +922,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Game_enemies_1native /* * Class: bwapi4_Game * Method: observers_native - * Signature: (J)Lbwapi4/Playerset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Game_observers_1native (JNIEnv *, jobject, jlong); @@ -927,6 +951,62 @@ JNIEXPORT void JNICALL Java_bwapi4_Game_setTextSize_1native__JLbwapi4_Text_Size_ JNIEXPORT void JNICALL Java_bwapi4_Game_vDrawText_1native (JNIEnv *, jobject, jlong, jobject, jint, jint, jstring, jobjectArray); +/* + * Class: bwapi4_Game + * Method: drawText_native + * Signature: (JLbwapi4/CoordinateType/Enum;IILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawText_1native + (JNIEnv *, jobject, jlong, jobject, jint, jint, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextMap_native + * Signature: (JIILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMap_1native__JIILjava_lang_String_2 + (JNIEnv *, jobject, jlong, jint, jint, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextMap_native + * Signature: (JLbwapi4/Position;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMap_1native__JLbwapi4_Position_2Ljava_lang_String_2 + (JNIEnv *, jobject, jlong, jobject, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextMouse_native + * Signature: (JIILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMouse_1native__JIILjava_lang_String_2 + (JNIEnv *, jobject, jlong, jint, jint, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextMouse_native + * Signature: (JLbwapi4/Position;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextMouse_1native__JLbwapi4_Position_2Ljava_lang_String_2 + (JNIEnv *, jobject, jlong, jobject, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextScreen_native + * Signature: (JIILjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextScreen_1native__JIILjava_lang_String_2 + (JNIEnv *, jobject, jlong, jint, jint, jstring); + +/* + * Class: bwapi4_Game + * Method: drawTextScreen_native + * Signature: (JLbwapi4/Position;Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_bwapi4_Game_drawTextScreen_1native__JLbwapi4_Position_2Ljava_lang_String_2 + (JNIEnv *, jobject, jlong, jobject, jstring); + /* * Class: bwapi4_Game * Method: drawBox_native diff --git a/headers4/bwapi4_Playerset.h b/headers4/bwapi4_Playerset.h index 75e9a08..30a7187 100644 --- a/headers4/bwapi4_Playerset.h +++ b/headers4/bwapi4_Playerset.h @@ -10,7 +10,7 @@ extern "C" { /* * Class: bwapi4_Playerset * Method: getUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Playerset_getUnits_1native (JNIEnv *, jobject, jlong); diff --git a/headers4/bwapi4_PositionedObject.h b/headers4/bwapi4_PositionedObject.h new file mode 100644 index 0000000..d0ec265 --- /dev/null +++ b/headers4/bwapi4_PositionedObject.h @@ -0,0 +1,13 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class bwapi4_PositionedObject */ + +#ifndef _Included_bwapi4_PositionedObject +#define _Included_bwapi4_PositionedObject +#ifdef __cplusplus +extern "C" { +#endif +#ifdef __cplusplus +} +#endif +#endif diff --git a/headers4/bwapi4_Region.h b/headers4/bwapi4_Region.h index 959830a..5f0aa02 100644 --- a/headers4/bwapi4_Region.h +++ b/headers4/bwapi4_Region.h @@ -114,7 +114,7 @@ JNIEXPORT jint JNICALL Java_bwapi4_Region_getDistance_1native /* * Class: bwapi4_Region * Method: getUnits_native - * Signature: (JLbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Region_getUnits_1native (JNIEnv *, jobject, jlong, jobject); diff --git a/headers4/bwapi4_Regionset.h b/headers4/bwapi4_Regionset.h index 21eb2f4..9ea0a7e 100644 --- a/headers4/bwapi4_Regionset.h +++ b/headers4/bwapi4_Regionset.h @@ -18,7 +18,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Regionset_getCenter_1native /* * Class: bwapi4_Regionset * Method: getUnits_native - * Signature: (JLbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Regionset_getUnits_1native (JNIEnv *, jobject, jlong, jobject); diff --git a/headers4/bwapi4_Unit.h b/headers4/bwapi4_Unit.h index 95b845f..74a00c3 100644 --- a/headers4/bwapi4_Unit.h +++ b/headers4/bwapi4_Unit.h @@ -554,7 +554,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getTransport_1native /* * Class: bwapi4_Unit * Method: getLoadedUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getLoadedUnits_1native (JNIEnv *, jobject, jlong); @@ -578,7 +578,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getCarrier_1native /* * Class: bwapi4_Unit * Method: getInterceptors_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getInterceptors_1native (JNIEnv *, jobject, jlong); @@ -594,7 +594,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getHatchery_1native /* * Class: bwapi4_Unit * Method: getLarva_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getLarva_1native (JNIEnv *, jobject, jlong); @@ -602,7 +602,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getLarva_1native /* * Class: bwapi4_Unit * Method: getUnitsInRadius_native - * Signature: (JILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getUnitsInRadius_1native (JNIEnv *, jobject, jlong, jint, jobject); @@ -610,7 +610,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getUnitsInRadius_1native /* * Class: bwapi4_Unit * Method: getUnitsInWeaponRange_native - * Signature: (JLbwapi4/WeaponType;Lbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JLbwapi4/WeaponType;Lbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unit_getUnitsInWeaponRange_1native (JNIEnv *, jobject, jlong, jobject, jobject); diff --git a/headers4/bwapi4_Unitset.h b/headers4/bwapi4_Unitset.h index 65ea203..9d0d856 100644 --- a/headers4/bwapi4_Unitset.h +++ b/headers4/bwapi4_Unitset.h @@ -18,7 +18,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getPosition_1native /* * Class: bwapi4_Unitset * Method: getLoadedUnits_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getLoadedUnits_1native (JNIEnv *, jobject, jlong); @@ -26,7 +26,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getLoadedUnits_1native /* * Class: bwapi4_Unitset * Method: getInterceptors_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getInterceptors_1native (JNIEnv *, jobject, jlong); @@ -34,7 +34,7 @@ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getInterceptors_1native /* * Class: bwapi4_Unitset * Method: getLarva_native - * Signature: (J)Lbwapi4/Unitset; + * Signature: (J)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getLarva_1native (JNIEnv *, jobject, jlong); @@ -66,7 +66,7 @@ JNIEXPORT void JNICALL Java_bwapi4_Unitset_setClientInfo_1native__JII /* * Class: bwapi4_Unitset * Method: getUnitsInRadius_native - * Signature: (JILbwapi4/UnitFilter;)Lbwapi4/Unitset; + * Signature: (JILbwapi4/UnitFilter;)Ljava/util/List; */ JNIEXPORT jobject JNICALL Java_bwapi4_Unitset_getUnitsInRadius_1native (JNIEnv *, jobject, jlong, jint, jobject); diff --git a/manual-bwapi4/AbstractPoint.java b/manual-bwapi4/AbstractPoint.java new file mode 100644 index 0000000..29af5b8 --- /dev/null +++ b/manual-bwapi4/AbstractPoint.java @@ -0,0 +1,30 @@ +package bwapi4; + +/** + * Common ancestor for location based objects to simplify distance computation. + * This will be refactored into interface with default methods when java 8 becomes widely used. + * + * Idea by Rafał Poniatowski + */ +public abstract class AbstractPoint { + + public abstract T getPoint(); + + public int getX(){ + return getPoint().getX(); + } + + public int getY(){ + return getPoint().getY(); + } + + public double distanceTo(AbstractPoint otherPosition) { + return distanceTo(otherPosition.getX(), otherPosition.getY()); + } + + public double distanceTo(int x, int y) { + double dx = x - getX(); + double dy = y - getY(); + return Math.sqrt(dx * dx + dy * dy); + } +} \ No newline at end of file diff --git a/manual-bwapi4/CenteredObject.java b/manual-bwapi4/CenteredObject.java new file mode 100644 index 0000000..2a200ac --- /dev/null +++ b/manual-bwapi4/CenteredObject.java @@ -0,0 +1,15 @@ +package bwapi4; + +import bwapi4.Position; + +/** + * Interrmediate class used to translate getPoint() calls to getCenter() calls. + */ +public abstract class CenteredObject extends AbstractPoint { + + public Position getPoint(){ + return getCenter(); + } + + public abstract Position getCenter(); +} \ No newline at end of file diff --git a/manual-bwapi4/Position.java b/manual-bwapi4/Position.java index 3cef294..296e717 100644 --- a/manual-bwapi4/Position.java +++ b/manual-bwapi4/Position.java @@ -7,7 +7,7 @@ import java.util.Map; /** * Positions are measured in pixels and are the highest resolution. */ -public class Position { +public class Position extends AbstractPoint{ private int x, y; @@ -83,4 +83,8 @@ public class Position { } private long pointer; + + public Position getPoint(){ + return this; + } } \ No newline at end of file diff --git a/manual-bwapi4/PositionedObject.java b/manual-bwapi4/PositionedObject.java new file mode 100644 index 0000000..d739a6a --- /dev/null +++ b/manual-bwapi4/PositionedObject.java @@ -0,0 +1,15 @@ +package bwapi4; + +import bwapi4.Position; + +/** + * Interrmediate class used to translate getPoint() calls to getPosition() calls. + */ +public abstract class PositionedObject extends AbstractPoint { + + public Position getPoint(){ + return getPosition(); + } + + public abstract Position getPosition(); +} \ No newline at end of file diff --git a/out/production/InvokeGenerator/generator/CJavaPipeline.class b/out/production/InvokeGenerator/generator/CJavaPipeline.class index 151e15a..cd421c0 100644 Binary files a/out/production/InvokeGenerator/generator/CJavaPipeline.class and b/out/production/InvokeGenerator/generator/CJavaPipeline.class differ diff --git a/out/production/InvokeGenerator/generator/JavaContext.class b/out/production/InvokeGenerator/generator/JavaContext.class index ff6bf79..807e71e 100644 Binary files a/out/production/InvokeGenerator/generator/JavaContext.class and b/out/production/InvokeGenerator/generator/JavaContext.class differ diff --git a/out/production/InvokeGenerator/generator/MirrorContext.class b/out/production/InvokeGenerator/generator/MirrorContext.class index 4b015cc..cc13e29 100644 Binary files a/out/production/InvokeGenerator/generator/MirrorContext.class and b/out/production/InvokeGenerator/generator/MirrorContext.class differ diff --git a/out/production/InvokeGenerator/generator/c/Bind.class b/out/production/InvokeGenerator/generator/c/Bind.class index 0529129..2956d04 100644 Binary files a/out/production/InvokeGenerator/generator/c/Bind.class and b/out/production/InvokeGenerator/generator/c/Bind.class differ diff --git a/out/production/InvokeGenerator/generator/c/TypeTable.class b/out/production/InvokeGenerator/generator/c/TypeTable.class index bf2a3f9..7f5e5cc 100644 Binary files a/out/production/InvokeGenerator/generator/c/TypeTable.class and b/out/production/InvokeGenerator/generator/c/TypeTable.class differ diff --git a/out/production/InvokeGenerator/generator/ccalls/CallImplementer.class b/out/production/InvokeGenerator/generator/ccalls/CallImplementer.class index 4ac35cd..d85470f 100644 Binary files a/out/production/InvokeGenerator/generator/ccalls/CallImplementer.class and b/out/production/InvokeGenerator/generator/ccalls/CallImplementer.class differ diff --git a/out/production/InvokeGenerator/generator/java/Mirror.class b/out/production/InvokeGenerator/generator/java/Mirror.class index 7a329ae..b3878d8 100644 Binary files a/out/production/InvokeGenerator/generator/java/Mirror.class and b/out/production/InvokeGenerator/generator/java/Mirror.class differ diff --git a/out/production/InvokeGenerator/test/api/TestBot1$1.class b/out/production/InvokeGenerator/test/api/TestBot1$1.class index 5d93f1c..32c54c4 100644 Binary files a/out/production/InvokeGenerator/test/api/TestBot1$1.class and b/out/production/InvokeGenerator/test/api/TestBot1$1.class differ diff --git a/out/production/InvokeGenerator/test/api/TestBot1.class b/out/production/InvokeGenerator/test/api/TestBot1.class index 92b99fd..112919f 100644 Binary files a/out/production/InvokeGenerator/test/api/TestBot1.class and b/out/production/InvokeGenerator/test/api/TestBot1.class differ diff --git a/out/production/InvokeGenerator/util/PointerTest.class b/out/production/InvokeGenerator/util/PointerTest.class new file mode 100644 index 0000000..c00cec3 Binary files /dev/null and b/out/production/InvokeGenerator/util/PointerTest.class differ diff --git a/src/generator/CJavaPipeline.java b/src/generator/CJavaPipeline.java index 0c57d7c..f5e79d3 100644 --- a/src/generator/CJavaPipeline.java +++ b/src/generator/CJavaPipeline.java @@ -33,14 +33,14 @@ public class CJavaPipeline { public static final int BWAPI_V4 = 4; - public static int BWAPI_VERSION = BWAPI_V3; + public static int BWAPI_VERSION = BWAPI_V4; /** * Classes from BWAPI 4 that don't need mirroring * Not used in mirroring BWAPI 3 */ private static final List ignoredClasses = new ArrayList<>(Arrays.asList("Vectorset", "ConstVectorset", "VSetIterator", - "Interface", "RectangleArray", "UnitImpl", "PlayerImpl", "GameImpl", "BulletImpl", "ForceImpl", "TournamentModule", "RegionImpl")); + "Interface", "RectangleArray", "UnitImpl", "PlayerImpl", "GameImpl", "BulletImpl", "ForceImpl", "TournamentModule", "RegionImpl", "SetContainer", "InterfaceEvent")); private static final HashMap superClasses = new HashMap<>(); @@ -268,4 +268,8 @@ public class CJavaPipeline { private static final String C_IMPLEMENTATION_FILE_PROPERTY = "impl_file"; private static final String HEADER_FILE_PROPERTY = "header_file"; + public static boolean isBWAPI3(){ + return BWAPI_VERSION == BWAPI_V3; + } + } diff --git a/src/generator/JavaContext.java b/src/generator/JavaContext.java index d71a0cc..ffc1680 100644 --- a/src/generator/JavaContext.java +++ b/src/generator/JavaContext.java @@ -148,14 +148,21 @@ public class JavaContext { return implementCopyReturn(javaType, "cresult"); } + public static String checkBWAPI3brackets(){ + if(CJavaPipeline.isBWAPI3()){ + return "()"; + } + return ""; + } + public String implementCopyReturn(String javaType, String fieldName) { switch (javaType) { case "TilePosition": - return ", "+fieldName+".x()" + - ", "+fieldName+".y()"; + return ", "+fieldName+".x" + checkBWAPI3brackets() + + ", "+fieldName+".y" + checkBWAPI3brackets() ; case "Position": - return ", "+fieldName+".x()" + - ", "+fieldName+".y()"; + return ", "+fieldName+".x" + checkBWAPI3brackets() + + ", "+fieldName+".y" + checkBWAPI3brackets() ; case "Color": return ", "+fieldName+".red()" + ", "+fieldName+".green()" + diff --git a/src/generator/MirrorContext.java b/src/generator/MirrorContext.java index afdd583..f235924 100644 --- a/src/generator/MirrorContext.java +++ b/src/generator/MirrorContext.java @@ -25,53 +25,65 @@ public class MirrorContext { cToJavaTypes.put("string", "String"); } - public void setPackage(String packageName){ + public void setPackage(String packageName) { this.packageName = packageName; } - public String getPackage(){ + public String getPackage() { return packageName; } - public String getPackageDirs(){ - return getPackage().replaceAll("\\.", "/"); + public String getPackageDirs() { + return getPackage().replaceAll("\\.", "/"); } @SuppressWarnings("ResultOfMethodCallIgnored") - public void prepareWrite(File root){ + public void prepareWrite(File root) { File dir = new File(root, getPackageDirs()); dir.mkdirs(); } - public boolean isCollection(String cType){ + private boolean isCollection(String cType) { return cType.startsWith("set<"); } - public String extractCollectionGeneric(String cType){ - cType= cType.substring(cType.indexOf("<") + 1, cType.lastIndexOf(">")).trim(); - if(cType.contains(":")){ + private boolean isBWAPI4Collection(String cType) { + return cType.endsWith("set"); + } + + private String extractCollectionGeneric(String cType) { + cType = cType.substring(cType.indexOf("<") + 1, cType.lastIndexOf(">")).trim(); + if (cType.contains(":")) { cType = cType.substring(cType.lastIndexOf(":") + 1); } - if(cType.endsWith("*")){ + if (cType.endsWith("*")) { cType = cType.substring(0, cType.lastIndexOf("*")); } return cType; } - public String toJavaType(String cType){ - if(isCollection(cType)){ - return "List<" + extractCollectionGeneric(cType)+">"; + private String extractBWAPI4CollectionGeneric(String cType) { + return cType.substring(0, cType.length() - 3); + } + + + public String toJavaType(String cType) { + if (isCollection(cType)) { + return "List<" + extractCollectionGeneric(cType) + ">"; + } + if (isBWAPI4Collection(cType)) { + return "List<" + extractBWAPI4CollectionGeneric(cType) + ">"; } String result = cToJavaTypes.get(cType); int ddIndex; - if(result != null && (ddIndex = result.lastIndexOf(':')) != -1){ + if (result != null && (ddIndex = result.lastIndexOf(':')) != -1) { result = result.substring(ddIndex + 1); } - if( cType.endsWith("*")){ + if (cType.endsWith("*")) { return cType.substring(0, cType.length() - 1); } - if(CJavaPipeline.BWAPI_VERSION == CJavaPipeline.BWAPI_V4 && cType.contains("bwapi.")){ + if (CJavaPipeline.BWAPI_VERSION == CJavaPipeline.BWAPI_V4 && cType.contains("bwapi.")) { cType = cType.replace("bwapi.", "bwapi4."); } return result != null ? result : cType; diff --git a/src/generator/c/Bind.java b/src/generator/c/Bind.java index f2d40ce..e248828 100644 --- a/src/generator/c/Bind.java +++ b/src/generator/c/Bind.java @@ -4,11 +4,14 @@ import c.CClass; import c.CDeclaration; import c.DeclarationType; import c.Field; +import generator.CJavaPipeline; import impl.ClassVariable; import java.io.PrintStream; import java.util.List; +import static generator.JavaContext.checkBWAPI3brackets; + /** * User: PC * Date: 18. 6. 2014 @@ -28,6 +31,13 @@ public class Bind { out.println("\t\tprintln(\"BWAPI ready.\");"); } + private String broodwarPtrSuffix() { + if (!CJavaPipeline.isBWAPI3()) { + return "ptr"; + } + return ""; + } + private void implementGameStart() { out.println("println(\"Connecting to Broodwar...\");\n" + "\t\treconnect();\n" + @@ -41,7 +51,7 @@ public class Bind { "\t\tjobject moduleObj = env->GetObjectField(obj, env->GetFieldID(cls, \"module\", \"Lbwapi/AIModule;\"));\n" + "\t\tjclass moduleCls = env->GetObjectClass(moduleObj);\n" + "\t\tenv->SetObjectField(obj, env->GetFieldID(cls, \"game\", \"Lbwapi/Game;\"), " + - "env->CallStaticObjectMethod(gamecls, env->GetStaticMethodID(gamecls, \"get\", \"(J)Lbwapi/Game;\"), (long)Broodwar));\n" + + "env->CallStaticObjectMethod(gamecls, env->GetStaticMethodID(gamecls, \"get\", \"(J)Lbwapi/Game;\"), (long)Broodwar" + broodwarPtrSuffix() + "));\n" + "\n" + "\t\tjmethodID updateMethodID = env->GetMethodID(env->GetObjectClass(obj), \"update\", \"()V\");"); @@ -66,27 +76,32 @@ public class Bind { out.println( "\t\twhile (true) {\n" + - " if (Broodwar != NULL) {\n" + - "\t\t\t\tprintln(\"Waiting...\");\n" + - " while (!Broodwar->isInGame()) {\n" + - " BWAPIClient.update();\n" + - "\t\t\t\t\tif (Broodwar == NULL) {\n" + - " println(\"Match ended.\");\n" + - " return;\n" + - " }\n" + - " }\n" + - " }\n" + - "\n" + - "\t\t\tprintln(\"Game ready!!!\");\n" + - "\n" + - "\t\t\twhile (Broodwar->isInGame()) {\n" + - "\t\t\t\t\n" + - "\t\t\t\tenv->CallVoidMethod(obj, updateMethodID);\n"); + " if (Broodwar" + broodwarPtrSuffix() + " != NULL) {\n" + + "\t\t\t\tprintln(\"Waiting...\");\n" + + " while (!Broodwar" + broodwarPtrSuffix() + "->isInGame()) {\n" + + " BWAPIClient.update();\n" + + "\t\t\t\t\tif (Broodwar" + broodwarPtrSuffix() + " == NULL) {\n" + + " println(\"Match ended.\");\n" + + " return;\n" + + " }\n" + + " }\n" + + " }\n" + + "\n" + + "\t\t\tprintln(\"Game ready!!!\");\n" + + "\n" + + "\t\t\twhile (Broodwar->isInGame()) {\n" + + "\t\t\t\t\n" + + "\t\t\t\tenv->CallVoidMethod(obj, updateMethodID);\n"); out.println("\n" + - "\t\t\t\tfor(std::list::iterator it = Broodwar->getEvents().begin(); it!=Broodwar->getEvents().end(); it++)\n" + + "\t\t\t\tfor(std::list::const_iterator it = Broodwar->getEvents().begin(); it!=Broodwar->getEvents().end(); it++)\n" + "\t\t\t\t {\n" + "\t\t\t\t\t switch (it->getType()) {\n" + "\t\t\t\t\t\t case EventType::MatchStart:\n" + + "\t\t\t\t\t\t\t BWTA::BWTA_Result::regions.clear();\n" + + "\t\t\t\t\t\t\t BWTA::BWTA_Result::baselocations.clear();\n" + + "\t\t\t\t\t\t\t BWTA::BWTA_Result::startlocations.clear();\n" + + "\t\t\t\t\t\t\t BWTA::BWTA_Result::chokepoints.clear();\n" + + "\t\t\t\t\t\t\t BWTA::BWTA_Result::unwalkablePolygons.clear();\n" + "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, matchStartCallback);\n" + "\t\t\t\t\t\t break;\n" + "\t\t\t\t\t\t case EventType::MatchEnd:\n" + @@ -105,7 +120,7 @@ public class Bind { "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, playerLeftCallback, env->CallStaticObjectMethod(playerCls, env->GetStaticMethodID(playerCls, \"get\", \"(J)Lbwapi/Player;\"), (jlong)it->getPlayer()));\n" + "\t\t\t\t\t\t break;\n" + "\t\t\t\t\t\t case EventType::NukeDetect:\n" + - "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, nukeDetectCallback, env->NewObject(posCls, env->GetMethodID(posCls,\"\", \"(II)V\"), it->getPosition().x(), it->getPosition().y()));\n" + + "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, nukeDetectCallback, env->NewObject(posCls, env->GetMethodID(posCls,\"\", \"(II)V\"), it->getPosition().x" + checkBWAPI3brackets() + ", it->getPosition().y" + checkBWAPI3brackets() + "));\n" + "\t\t\t\t\t\t break;\n" + "\t\t\t\t\t\t case EventType::UnitDiscover:\n" + "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, unitDiscoverCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, \"get\", \"(J)Lbwapi/Unit;\"), (jlong)it->getUnit()));\n" + @@ -137,20 +152,22 @@ public class Bind { "\t\t\t\t\t\t case EventType::UnitComplete:\n" + "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, unitCompleteCallback, env->CallStaticObjectMethod(unitCls, env->GetStaticMethodID(unitCls, \"get\", \"(J)Lbwapi/Unit;\"), (jlong)it->getUnit()));\n" + "\t\t\t\t\t\t break;\n" + - "\t\t\t\t\t\t case EventType::PlayerDropped:\n" + - "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, playerDroppedCallback, env->CallStaticObjectMethod(playerCls, env->GetStaticMethodID(playerCls, \"get\", \"(J)Lbwapi/Player;\")));\n" + - "\t\t\t\t\t\t break;\n" + + (CJavaPipeline.isBWAPI3() ? + "\t\t\t\t\t\t case EventType::PlayerDropped:\n" + + "\t\t\t\t\t\t\t env->CallVoidMethod(moduleObj, playerDroppedCallback, env->CallStaticObjectMethod(playerCls, env->GetStaticMethodID(playerCls, \"get\", \"(J)Lbwapi/Player;\")));\n" + + "\t\t\t\t\t\t break;\n" + : "") + "\n" + "\t\t\t\t\t }\n" + "\t\t\t\t }"); out.println( "\t\t\t\tBWAPIClient.update();\n" + - "\t\t\t\tif (!BWAPI::BWAPIClient.isConnected()) {\n" + - "\t\t\t\t\t\tprintln(\"Reconnecting...\");\n" + - "\t\t\t\t\t\treconnect();\n" + - "\t\t\t\t}\n" + - "\t\t\t}\n" + - "\t\t}"); + "\t\t\t\tif (!BWAPI::BWAPIClient.isConnected()) {\n" + + "\t\t\t\t\t\tprintln(\"Reconnecting...\");\n" + + "\t\t\t\t\t\treconnect();\n" + + "\t\t\t\t}\n" + + "\t\t\t}\n" + + "\t\t}"); } private void implementHelpers() { @@ -200,10 +217,9 @@ public class Bind { if (field.getDeclType().equals(DeclarationType.VARIABLE)) { if (!printedIntro) { out.println("cls = env->FindClass(\"Lbwapi/" + cClass.getName() + ";\");"); - if(cClass.getName().equals("Color")){ + if (cClass.getName().equals("Color")) { out.println("getId = env->GetMethodID(cls,\"\", \"(III)V\");"); - } - else{ + } else { out.println("getId = env->GetStaticMethodID(cls, \"get\", \"(J)Lbwapi/" + cClass.getName() + ";\");"); } printedIntro = true; @@ -215,14 +231,14 @@ public class Bind { private void bindVariable(CClass cClass, ClassVariable classVariable) { - String cValue = cClass.getName() + "s::" + classVariable.getName(); + String cValue = cClass.getName() + "s::" + classVariable.getName(); - if(cClass.getName().equals("Color")){ + if (cClass.getName().equals("Color")) { out.println( - "env->SetStaticObjectField(cls, " + - "env->GetStaticFieldID(cls, \"" + classVariable.getName() + "\", \"Lbwapi/" + classVariable.getType() + ";\"), " + - "env->NewObject(cls, getId, " + cValue + ".red(), " + cValue + ".green(), "+ cValue + ".blue())" + - ");"); + "env->SetStaticObjectField(cls, " + + "env->GetStaticFieldID(cls, \"" + classVariable.getName() + "\", \"Lbwapi/" + classVariable.getType() + ";\"), " + + "env->NewObject(cls, getId, " + cValue + ".red(), " + cValue + ".green(), " + cValue + ".blue())" + + ");"); return; } out.println( @@ -230,7 +246,7 @@ public class Bind { "env->GetStaticFieldID(cls, \"" + classVariable.getName() + "\", \"Lbwapi/" + classVariable.getType() + ";\"), " + "env->CallStaticObjectMethod(cls, getId, (jlong)&" + cValue + ")" + ");"); - if(cClass.getName().equals("Position") || cClass.getName().equals("TilePosition")){ + if (cClass.getName().equals("Position") || cClass.getName().equals("TilePosition")) { return; } out.println("table" + cClass.getName() + ".insert(std::pair(" + cValue + ".getID(), &" + cValue + "));"); diff --git a/src/generator/c/TypeTable.java b/src/generator/c/TypeTable.java index 33306db..21f29c2 100644 --- a/src/generator/c/TypeTable.java +++ b/src/generator/c/TypeTable.java @@ -4,6 +4,8 @@ import c.CClass; import c.CDeclaration; import c.DeclarationType; import c.Field; +import generator.CJavaPipeline; +import util.PointerTest; import java.io.PrintStream; import java.util.List; @@ -43,7 +45,7 @@ public class TypeTable { } public void implementTypeTable(String type) { - out.println("std::map table" + type + ";"); + out.println("std::map table" + type + ";"); } } diff --git a/src/generator/ccalls/CallImplementer.java b/src/generator/ccalls/CallImplementer.java index 8603045..f449b69 100644 --- a/src/generator/ccalls/CallImplementer.java +++ b/src/generator/ccalls/CallImplementer.java @@ -1,8 +1,10 @@ package generator.ccalls; import c.Param; +import generator.CJavaPipeline; import generator.JavaContext; import util.Generic; +import util.PointerTest; import java.io.BufferedReader; import java.io.File; @@ -51,9 +53,10 @@ public class CallImplementer { out.print("#include \"../concat_header.h\"\n" + "#include \n" + "#include \n" + - "#include \n" + + (CJavaPipeline.isBWAPI3() ? "#include \n" : "") + "#include \n" + "#include \n" + + "#include \"../BWTA_Result.h\"" + "\n" + "using namespace BWAPI;\n\n"); } @@ -62,7 +65,7 @@ public class CallImplementer { if (javaContext.isValueType(clsName)) { out.println(javaContext.copyJavaObjectToC(clsName, VARIABLE_PREFIX + objName, "obj")); } else { - out.println(clsName + "*" + SPACE + VARIABLE_PREFIX + objName + SPACE + "=" + SPACE + "(" + clsName + "*)pointer" + SEMICOLON); + out.println(PointerTest.test(clsName) + SPACE + VARIABLE_PREFIX + objName + SPACE + "=" + SPACE + "(" + PointerTest.test(clsName) + ")pointer" + SEMICOLON); } } @@ -79,7 +82,7 @@ public class CallImplementer { if (javaContext.isCollection(param.third)) { String genericType = Generic.extractGeneric(param.third); - out.println("std::set<" + genericType + "*> " + param.second + SEMICOLON); + out.println("std::set<" + PointerTest.test(genericType) + "> " + param.second + SEMICOLON); out.println("jclass colClass = env->GetObjectClass(" + paramName + ");"); out.println("jmethodID sizeMethodId = FindCachedMethod(env, colClass, \"size\", \"()I\");"); @@ -88,7 +91,7 @@ public class CallImplementer { out.println("for( int i = 0; i < size; i++ ) {"); out.println("jobject jobj = env->CallObjectMethod(" + paramName + ",getMethodId);"); out.print(param.second + ".insert("); - out.print("(" + genericType + "*)"); + out.print("(" + PointerTest.test(genericType) + ")"); out.print("env->GetLongField(jobj, FindCachedField(env, env->GetObjectClass(jobj), \"pointer\", \"J\"))"); out.println(");"); out.println("}"); @@ -96,7 +99,7 @@ public class CallImplementer { } - out.println(param.third + "*" + SPACE + param.second + SPACE + "=" + SPACE + "(" + param.third + "*)" + + out.println(PointerTest.test(param.third) + SPACE + param.second + SPACE + "=" + SPACE + "(" + PointerTest.test(param.third) + ")" + "env->GetLongField(" + paramName + ", " + "FindCachedField(env, env->GetObjectClass(" + paramName + "), \"pointer\", \"J\")" + ")" + SEMICOLON); } @@ -131,7 +134,7 @@ public class CallImplementer { } } else { if (javaContext.isConstantTye(param.third)) { - out.print("*"); + out.print(PointerTest.test(param.third, false)); } if (param.first.equals("jboolean")) { out.print("(bool)"); @@ -160,14 +163,32 @@ public class CallImplementer { out.println("}"); } + private String wrapInCCollection(String genericType) { + String buffer = ""; + boolean isBWAPI4Collection = !CJavaPipeline.isBWAPI3(); + if (!isBWAPI4Collection) { + buffer += "std::set<"; + } + if (!javaContext.isConstantTye(genericType) && !javaContext.isValueType(genericType)) { + buffer += (PointerTest.test(genericType)); + } + if (!isBWAPI4Collection) { + buffer += ">"; + } else { + buffer += "set"; + } + return buffer; + } + /** * this basically just converts a std::set to java.util.ArrayList * it simply creates an array list and then loops through the set and calls list.add(element) + * * @param genericType */ private void implementCollectionReturn(String genericType) { String classGenericType = genericType; - if(classGenericType.contains("::")){ + if (classGenericType.contains("::")) { classGenericType = classGenericType.substring(classGenericType.lastIndexOf(":") + 1); } @@ -178,22 +199,18 @@ public class CallImplementer { out.println("jmethodID addMethodID = FindCachedMethod(env, listCls, \"add\", \"(Ljava/lang/Object;)Z\");"); out.println("jclass elemClass = FindCachedClass(env, \"" + javaContext.getPackageName() + "/" + classGenericType + "\");"); - if(!javaContext.isValueType(genericType)){ + if (!javaContext.isValueType(genericType)) { out.println("jmethodID getMethodID = FindCachedMethodStatic(env, elemClass, \"get\", \"(J)L" + javaContext.getPackageName() + "/" + classGenericType + ";\");"); - } - else{ + } else { out.println("jmethodID elemConsID = FindCachedMethod(env, elemClass, \"\", \"(" + javaContext.copyConstructor(genericType) + ")V\");"); } + //the for loop - out.print("for(std::set<" + genericType); - if (!javaContext.isConstantTye(genericType) && !javaContext.isValueType(genericType)) { - out.print("*"); - } - out.println(">::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){"); + out.print("for(" + wrapInCCollection(genericType) + "::const_iterator it = cresult.begin(); it != cresult.end(); it++ ){"); out.print("const " + genericType); - if(!javaContext.isValueType(genericType)){ - out.print("*"); + if (!javaContext.isValueType(genericType)) { + out.print(PointerTest.test(genericType, false)); } out.print(" elem_ptr = "); if (javaContext.isConstantTye(genericType)) { @@ -201,11 +218,10 @@ public class CallImplementer { } else { out.println("*it;"); } - if(!javaContext.isValueType(genericType)){ + if (!javaContext.isValueType(genericType)) { out.println("jobject elem = env->CallStaticObjectMethod(elemClass, getMethodID, (long)elem_ptr) ;"); - } - else{ - out.println("jobject elem = env->NewObject(elemClass, elemConsID" + javaContext.implementCopyReturn(genericType, "elem_ptr") +")" + SEMICOLON); + } else { + out.println("jobject elem = env->NewObject(elemClass, elemConsID" + javaContext.implementCopyReturn(genericType, "elem_ptr") + ")" + SEMICOLON); } out.println("env->CallVoidMethod(result, addMethodID, elem);"); out.println("}"); @@ -225,11 +241,7 @@ public class CallImplementer { //case 1 - method returns a collection type, this requires a LOT of work, so get the std::set and proceed in implementCollectionReturn if (javaRetType.startsWith("List<")) { String genericType = convertToBWTA(Generic.extractGeneric(javaRetType)); - out.print("std::set<" + genericType); - if (!javaContext.isConstantTye(genericType) && !javaContext.isValueType(genericType)) { - out.print("*"); - } - out.print("> cresult = " + objectAccessor + javaMethodName + "("); + out.print(wrapInCCollection(genericType) + " cresult = " + objectAccessor + javaMethodName + "("); implementRealParams(params); out.println(")" + SEMICOLON); implementCollectionReturn(genericType); diff --git a/src/generator/java/Mirror.java b/src/generator/java/Mirror.java index f4ea5d0..31906b2 100644 --- a/src/generator/java/Mirror.java +++ b/src/generator/java/Mirror.java @@ -93,8 +93,8 @@ public abstract class Mirror { for (String pkg : context.getAdditionalImports()) { out.println("import" + SPACE + pkg + SEMICOLON); } - if(superClass != null){ - out.println("import bwapi."+superClass + SEMICOLON); + if (superClass != null) { + out.println("import" + SPACE + context.getPackage() + "." + superClass + SEMICOLON); } out.println(); writeJavadoc(getDecl()); diff --git a/src/test/api/TestBot1.java b/src/test/api/TestBot1.java index bd98512..12df25f 100644 --- a/src/test/api/TestBot1.java +++ b/src/test/api/TestBot1.java @@ -43,6 +43,14 @@ public class TestBot1 { StringBuilder units = new StringBuilder("My units:\n"); + for(Player player : game.getPlayers()){ + System.out.println(player.getName()); + for(Unit enemyUnit: player.getUnits()){ + System.out.println(enemyUnit.getType()); + } + } + + for (Unit myUnit : self.getUnits()) { units.append(myUnit.getType()).append(" ").append(myUnit.getTilePosition()).append("\n"); diff --git a/src/util/PointerTest.java b/src/util/PointerTest.java new file mode 100644 index 0000000..76c2aa8 --- /dev/null +++ b/src/util/PointerTest.java @@ -0,0 +1,33 @@ +package util; + +import generator.CJavaPipeline; + +import java.util.Arrays; +import java.util.List; + +/** + * User: PC + * Date: 7. 2. 2015 + * Time: 16:39 + */ +public class PointerTest { + + private static final List BWAPI4_INTERFACES = Arrays.asList("Client", "Game", "AIModule" ,"Event"); + + private static boolean testCls(String cls){ + return BWAPI4_INTERFACES.contains(cls) || cls.endsWith("set"); + } + + public static String test(String cls) { + return test(cls, true); + } + + + public static String test(String cls, boolean print) { + if (CJavaPipeline.isBWAPI3()) { + return (print ? cls : "" )+ "*"; + } + return (print ? cls : "" ) + (testCls(cls) ? "*" : ""); + } + +}