[−][src]Struct bwapi_wrapper::BWAPI_UnitInterface
Every Unit in the game is either accessible or inaccessible. To determine if an AI can access a particular unit, BWAPI checks to see if Flag::CompleteMapInformation is enabled. So there are two cases to consider - either the flag is enabled, or it is disabled:
If Flag::CompleteMapInformation is disabled, then a unit is accessible if and only if it is visible. @note Some properties of visible enemy units will not be made available to the AI (such as the contents of visible enemy dropships). If a unit is not visible, UnitInterface::exists will return false, regardless of whether or not the unit exists. This is because absolutely no state information on invisible enemy units is made available to the AI. To determine if an enemy unit has been destroyed, the AI must watch for AIModule::onUnitDestroy messages from BWAPI, which is only called for visible units which get destroyed.
If Flag::CompleteMapInformation is enabled, then all units that exist in the game are accessible, and UnitInterface::exists is accurate for all units. Similarly AIModule::onUnitDestroy messages are generated for all units that get destroyed, not just visible ones.
If a Unit is not accessible, then only the getInitial__ functions will be available to the AI. However for units that were owned by the player, getPlayer and getType will continue to work for units that have been destroyed.
@ingroup Interface
Fields
_base: BWAPI_Interface
Trait Implementations
impl Debug for BWAPI_UnitInterface
[src]
impl Default for BWAPI_UnitInterface
[src]
impl Eq for BWAPI_UnitInterface
[src]
impl Hash for BWAPI_UnitInterface
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<BWAPI_UnitInterface> for BWAPI_UnitInterface
[src]
fn eq(&self, other: &BWAPI_UnitInterface) -> bool
[src]
fn ne(&self, other: &BWAPI_UnitInterface) -> bool
[src]
impl StructuralEq for BWAPI_UnitInterface
[src]
impl StructuralPartialEq for BWAPI_UnitInterface
[src]
Auto Trait Implementations
impl RefUnwindSafe for BWAPI_UnitInterface
impl !Send for BWAPI_UnitInterface
impl !Sync for BWAPI_UnitInterface
impl Unpin for BWAPI_UnitInterface
impl UnwindSafe for BWAPI_UnitInterface
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,