Skip to content

Commit

Permalink
bwmirror 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vjurenka committed Jul 12, 2015
1 parent 2ea9e62 commit 2ab7047
Show file tree
Hide file tree
Showing 38 changed files with 3,024 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api/bwapi/BestFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import java.util.Collection;
import java.util.List;

/**
template<typename _PARAM> class BWAPI::BestFilter< _PARAM > The BestFilter is used to compare two objects with each other. Each function object compares two of the same object and returns the most desirable one. Note : A function object should return one of the two given parameters, never nullptr. Both parameters being given should never be nullptr.
*/
/**
*/
public class BestFilter {


Expand Down
42 changes: 42 additions & 0 deletions api/bwapi/Bullet.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,98 @@
import java.util.Collection;
import java.util.List;

/**
An interface object representing a bullet or missile spawned from an attack. The Bullet interface allows you to detect bullets, missiles, and other types of non-melee attacks or special abilities that would normally be visible through human eyes (A lurker spike or a Queen's flying parasite), allowing quicker reaction to unavoidable consequences. For example, ordering medics to restore units that are about to receive a lockdown to compensate for latency and minimize its effects. You can't know entirely which unit will be receiving a lockdown unless you can detect the lockdown missile using the Bullet class. Bullet objects are re-used after they are destroyed, however their ID is updated when it represents a new Bullet. If Flag::CompleteMapInformation is disabled, then a Bullet is accessible if and only if it is visible. Otherwise if Flag::CompleteMapInformation is enabled, then all Bullets in the game are accessible. See also Game::getBullets, BulletInterface::exists
*/
public class Bullet {

/**
Retrieves a unique identifier for the current Bullet. Returns An integer value containing the identifier.
*/
public int getID() {
return getID_native(pointer);
}

/**
Checks if the Bullet exists in the view of the BWAPI player. Return values true If the bullet exists or is visible. false If the bullet was destroyed or has gone out of scope. If Flag::CompleteMapInformation is disabled, and a Bullet is not visible, then the return value will be false regardless of the Bullet's true existence. This is because absolutely no state information on invisible enemy bullets is made available to the AI. If Flag::CompleteMapInformation is enabled, then this function is accurate for all Bullet information. See also isVisible, UnitInterface::exists
*/
public boolean exists() {
return exists_native(pointer);
}

/**
Retrieves the Player interface that owns the Bullet. Return values nullptr If the Player object for this Bullet is inaccessible. Returns The owning Player interface object.
*/
public Player getPlayer() {
return getPlayer_native(pointer);
}

/**
Retrieves the type of this Bullet. Return values BulletTypes::Unknown if the Bullet is inaccessible. Returns A BulletType representing the Bullet's type.
*/
public BulletType getType() {
return getType_native(pointer);
}

/**
Retrieves the Unit interface that the Bullet spawned from. Return values nullptr If the source can not be identified or is inaccessible. Returns The owning Unit interface object. See also getTarget
*/
public Unit getSource() {
return getSource_native(pointer);
}

/**
Retrieves the Bullet's current position. Return values Positions::Unknown If the Bullet is inaccessible. Returns A Position containing the Bullet's current coordinates. See also getTargetPosition
*/
public Position getPosition() {
return getPosition_native(pointer);
}

/**
Retrieve's the direction the Bullet is facing. If the angle is 0, then the Bullet is facing right. Return values 0.0 If the bullet is inaccessible. Returns A double representing the direction the Bullet is facing.
*/
public double getAngle() {
return getAngle_native(pointer);
}

/**
Retrieves the X component of the Bullet's velocity, measured in pixels per frame. Return values 0.0 if the Bullet is inaccessible. Returns A double representing the number of pixels moved on the X axis per frame. See also getVelocityY, getAngle
*/
public double getVelocityX() {
return getVelocityX_native(pointer);
}

/**
Retrieves the Y component of the Bullet's velocity, measured in pixels per frame. Return values 0.0 if the Bullet is inaccessible. Returns A double representing the number of pixels moved on the Y axis per frame. See also getVelocityX, getAngle
*/
public double getVelocityY() {
return getVelocityY_native(pointer);
}

/**
Retrieves the Unit interface that the Bullet is heading to. Return values nullptr If the Bullet's target Unit is inaccessible, the Bullet is targetting the ground, or if the Bullet itself is inaccessible. Returns The target Unit interface object, if one exists. See also getTargetPosition, getSource
*/
public Unit getTarget() {
return getTarget_native(pointer);
}

/**
Retrieves the target position that the Bullet is heading to. Return values Positions::Unknown If the bullet is inaccessible. Returns A Position indicating where the Bullet is headed. See also getTarget, getPosition
*/
public Position getTargetPosition() {
return getTargetPosition_native(pointer);
}

/**
Retrieves the timer that indicates the Bullet's life span. Bullets are not permanent objects, so they will often have a limited life span. This life span is measured in frames. Normally a Bullet will reach its target before being removed. Return values 0 If the Bullet is inaccessible. Returns An integer representing the remaining number of frames until the Bullet self-destructs.
*/
public int getRemoveTimer() {
return getRemoveTimer_native(pointer);
}

/**
Retrieves the visibility state of the Bullet. Parameters player (optional) If this parameter is specified, then the Bullet's visibility to the given player is checked. If this parameter is omitted, then a default value of nullptr is used, which will check if the BWAPI player has vision of the Bullet. Note If player is nullptr and Broodwar->self() is also nullptr, then the visibility of the Bullet is determined by checking if at least one other player has vision of the Bullet. Return values true If the Bullet is visible to the specified player. false If the Bullet is not visible to the specified player.
*/
public boolean isVisible() {
return isVisible_native(pointer);
}
Expand Down
6 changes: 6 additions & 0 deletions api/bwapi/BulletType.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import java.util.Collection;
import java.util.List;

/**
This class represents a type of bullet. Note Internally, these are the same IDs as flingy types in Broodwar. See also BulletTypes
*/
/**
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. Parameters id The id that corresponds to this type. It is typically an integer value that corresponds to an internal Broodwar type. If the given id is invalid, then it becomes Types::Unknown.
*/
public class BulletType {

public String toString() {
Expand Down
3 changes: 3 additions & 0 deletions api/bwapi/Bulletset.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import java.util.Collection;
import java.util.List;

/**
A container for a set of Bullet objects.
*/
public class Bulletset {


Expand Down
6 changes: 6 additions & 0 deletions api/bwapi/CompareFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import java.util.Collection;
import java.util.List;

/**
template<typename PType, typename RType = int, class Container = std::function<RType(PType)>> class BWAPI::CompareFilter< PType, RType, Container > The CompareFilter is a container in which a stored function predicate returns a value. Arithmetic and bitwise operators will return a new CompareFilter that applies the operation to the result of the original functor. If any relational operators are used, then it creates a UnaryFilter that returns the result of the operation. Template Parameters PType The parameter type, which is the type passed into the functor. RType (optional) The functor's return type. It is int by default. Container (optional) Storage container for the function predicate. It is std::function<RType(PType)> by default.
*/
/**
*/
public class CompareFilter {


Expand Down
6 changes: 6 additions & 0 deletions api/bwapi/DamageType.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import java.util.Collection;
import java.util.List;

/**
Damage types are used in Broodwar to determine the amount of damage that will be done to a unit. This corresponds with UnitSizeType to determine the damage done to a unit. See also WeaponType, DamageTypes, UnitSizeType View on Liquipedia View on Starcraft Campendium (Official Website) View on Starcraft Wikia
*/
/**
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. Parameters id The id that corresponds to this type. It is typically an integer value that corresponds to an internal Broodwar type. If the given id is invalid, then it becomes Types::Unknown.
*/
public class DamageType {

public String toString() {
Expand Down
6 changes: 6 additions & 0 deletions api/bwapi/Error.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import java.util.Collection;
import java.util.List;

/**
The Error object is generally used to determine why certain functions in BWAPI have failed. For example, you may not have enough resources to construct a unit. See also Game::getLastError, Game::setLastError, Errors
*/
/**
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. Parameters id The id that corresponds to this type. It is typically an integer value that corresponds to an internal Broodwar type. If the given id is invalid, then it becomes Types::Unknown.
*/
public class Error {

public String toString() {
Expand Down
21 changes: 21 additions & 0 deletions api/bwapi/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,45 @@
import java.util.Collection;
import java.util.List;

/**
null
*/
/**
*/
public class Event {

/**
*/
public Position getPosition() {
return getPosition_native(pointer);
}

/**
*/
public String getText() {
return getText_native(pointer);
}

/**
*/
public Unit getUnit() {
return getUnit_native(pointer);
}

/**
*/
public Player getPlayer() {
return getPlayer_native(pointer);
}

/**
*/
public boolean isWinner() {
return isWinner_native(pointer);
}
Expand Down
6 changes: 6 additions & 0 deletions api/bwapi/ExplosionType.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
import java.util.Collection;
import java.util.List;

/**
A representation of a weapon's explosion type. This indicates how the weapon behaves, such as if it deals splash damage or causes an effect to occur. See also ExplosionTypes
*/
/**
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. Parameters id The id that corresponds to this type. It is typically an integer value that corresponds to an internal Broodwar type. If the given id is invalid, then it becomes Types::Unknown.
*/
public class ExplosionType {

public String toString() {
Expand Down
12 changes: 12 additions & 0 deletions api/bwapi/Force.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,28 @@
import java.util.Collection;
import java.util.List;

/**
The Force class is used to get information about each force in a match. Normally this is considered a team. Note It is not called a team because players on the same force do not necessarily need to be allied at the beginning of a match.
*/
public class Force {

/**
Retrieves the unique ID that represents this Force. Returns An integer containing the ID for the Force.
*/
public int getID() {
return getID_native(pointer);
}

/**
Retrieves the name of the Force. Returns A std::string object containing the name of the force. Example usage: BWAPI::Force myForce = BWAPI::Broodwar->self()->getForce(); if ( myForce->getName() == "Observers" ) BWAPI::Broodwar << "Looks like we're observing a match." << std::endl; Note Don't forget to use std::string::c_str() when passing this parameter to Game::sendText and other variadic functions.
*/
public String getName() {
return getName_native(pointer);
}

/**
Retrieves the set of players that belong to this Force. Returns A Playerset object containing the players that are part of this Force. Example usage: // Get the enemy force, but make sure we have an enemy BWAPI::Force myEnemyForce = BWAPI::Broodwar->enemy() ? BWAPI::Broodwar->enemy()->getForce() : nullptr; if ( myEnemyForce != nullptr ) { Broodwar << "The allies of my enemy are..." << std::endl; for ( auto i = myEnemyForce.begin(); i != myEnemyForce.end(); ++i ) Broodwar << " - " << i->getName() << std::endl; }
*/
public List<Player> getPlayers() {
return getPlayers_native(pointer);
}
Expand Down
6 changes: 6 additions & 0 deletions api/bwapi/Forceset.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
import java.util.Collection;
import java.util.List;

/**
A container that holds a group of Forces. See also BWAPI::Force
*/
public class Forceset {

/**
Retrieves the set of players that belong to this Force. Returns A Playerset object containing the players that are part of this Force. Example usage: // Get the enemy force, but make sure we have an enemy BWAPI::Force myEnemyForce = BWAPI::Broodwar->enemy() ? BWAPI::Broodwar->enemy()->getForce() : nullptr; if ( myEnemyForce != nullptr ) { Broodwar << "The allies of my enemy are..." << std::endl; for ( auto i = myEnemyForce.begin(); i != myEnemyForce.end(); ++i ) Broodwar << " - " << i->getName() << std::endl; }
*/
public List<Player> getPlayers() {
return getPlayers_native(pointer);
}
Expand Down
Loading

0 comments on commit 2ab7047

Please sign in to comment.