// Original work Copyright (c) 2015, 2017, Igor Dimitrijevic
// Modified work Copyright (c) 2017-2018 OpenBW Team
//////////////////////////////////////////////////////////////////////////
//
// This file is part of the BWEM Library.
// BWEM is free software, licensed under the MIT/X11 License.
// A copy of the license is provided with the library in the LICENSE file.
// Copyright (c) 2015, 2017, Igor Dimitrijevic
//
//////////////////////////////////////////////////////////////////////////
package bwem;
import bwapi.Position;
import bwapi.TilePosition;
import bwapi.UnitType;
import bwem.util.BwemExt;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* After Areas and ChokePoints, Bases are the third kind of object BWEM automatically computes from
* Brood War's maps. A Base is essentially a suggested location (intended to be optimal) to put a
* resource depot. It also provides information on the resources available, and some statistics. A
* Base always belongs to some Area. An Area may contain zero, one or several Bases. Like Areas and
* ChokePoints, the number and the addresses of Base instances remain unchanged.
*/
public final class Base {
private final Area area;
private final List
* - Note: all players start at locations taken from {@link MapData#getStartingLocations()},
* which doesn't mean all the locations in {@link MapData#getStartingLocations()} are actually
* used.
*/
public boolean isStartingLocation() {
return this.isStartingLocation;
}
/**
* Returns the area in which this base is located.
*/
public Area getArea() {
return this.area;
}
/**
* Returns the position (top-left TilePosition) of the location for a resource depot.
* - Note: If {@link #isStartingLocation()} == true, it is guaranteed that the location
* corresponds exactly to one of {@link MapData#getStartingLocations()}.
*/
public TilePosition getLocation() {
return this.location;
}
/**
* Returns the center position of {@link #getLocation()}.
*/
public Position getCenter() {
return this.center;
}
/**
* Returns the available minerals.
* - These minerals are assigned to this base (it is guaranteed that no other base provides them).
*
* - Note: The size of the returned list may decrease, as some of the minerals may get destroyed.
*/
public List
* - These geysers are assigned to this Base (it is guaranteed that no other Base provides them).
*
* - Note: The size of the returned list will NOT decrease, as geysers never get destroyed.
*/
public List
* - These are special minerals. They are placed at or near the resource depot location,
* thus blocking the building of a resource depot from being close to the resources.
* - So, before trying to build a resource depot, these minerals must be gathered first.
* - Fortunately, these are guaranteed to have their initialAmount() <= 8.
* - As an example of blocking minerals, see the two islands in Andromeda.scx.
* - Note: if {@link #isStartingLocation()} == true, an empty list is returned.
* - Note: should not be confused with {@link ChokePoint#getBlockingNeutral()}
* and {@link Neutral#isBlocking()}:
* The last two refer to a Neutral blocking a ChokePoint, not a Base.
*/
public List