Struct bwapi::position::Position [−][src]
pub struct Position { /* fields omitted */ }Indicates a position that is 1×1 pixel in size. This is the most precise position type.
Methods
impl Position[src]
impl Positionpub fn new(x: isize, y: isize) -> Position[src]
pub fn new(x: isize, y: isize) -> Positionpub fn distance<'a>(&'a self, position: &'a Self) -> f64[src]
pub fn distance<'a>(&'a self, position: &'a Self) -> f64The distance between this point and position.
Trait Implementations
impl Eq for Position[src]
impl Eq for Positionimpl PartialEq for Position[src]
impl PartialEq for Positionfn eq(&self, other: &Position) -> bool[src]
fn eq(&self, other: &Position) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Position) -> bool[src]
fn ne(&self, other: &Position) -> boolThis method tests for !=.
impl Debug for Position[src]
impl Debug for Positionfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Point for Position[src]
impl Point for Positionfn x(&self) -> isize[src]
fn x(&self) -> isizefn y(&self) -> isize[src]
fn y(&self) -> isizefn scale() -> isize[src]
fn scale() -> isizeThe scale of a Position. Each position corresponds to a 1x1 pixel area.
fn length(&self) -> f64[src]
fn length(&self) -> f64The length of this point from (0,0)
impl From<Position> for Position[src]
impl From<Position> for Positionimpl From<Position> for Position[src]
impl From<Position> for Positionimpl From<WalkPosition> for Position[src]
impl From<WalkPosition> for Positionfn from(pos: WalkPosition) -> Position[src]
fn from(pos: WalkPosition) -> PositionPerforms the conversion.
impl From<Position> for WalkPosition[src]
impl From<Position> for WalkPositionfn from(pos: Position) -> WalkPosition[src]
fn from(pos: Position) -> WalkPositionPerforms the conversion.
impl From<TilePosition> for Position[src]
impl From<TilePosition> for Positionfn from(pos: TilePosition) -> Position[src]
fn from(pos: TilePosition) -> PositionPerforms the conversion.
impl From<Position> for TilePosition[src]
impl From<Position> for TilePositionfn from(pos: Position) -> TilePosition[src]
fn from(pos: Position) -> TilePositionPerforms the conversion.
impl Add<Position> for Position[src]
impl Add<Position> for PositionT op T
type Output = Position
The resulting type after applying the + operator.
fn add(self, other: Position) -> Position[src]
fn add(self, other: Position) -> PositionPerforms the + operation.
impl<'a> Add<Position> for &'a Position[src]
impl<'a> Add<Position> for &'a Position&T op T
type Output = Position
The resulting type after applying the + operator.
fn add(self, other: Position) -> Position[src]
fn add(self, other: Position) -> PositionPerforms the + operation.
impl<'a> Add<&'a Position> for Position[src]
impl<'a> Add<&'a Position> for PositionT op &T
type Output = Position
The resulting type after applying the + operator.
fn add(self, other: &'a Position) -> Position[src]
fn add(self, other: &'a Position) -> PositionPerforms the + operation.
impl<'a, 'b> Add<&'a Position> for &'b Position[src]
impl<'a, 'b> Add<&'a Position> for &'b Position&T op &T
type Output = Position
The resulting type after applying the + operator.
fn add(self, other: &'a Position) -> Position[src]
fn add(self, other: &'a Position) -> PositionPerforms the + operation.
impl Sub<Position> for Position[src]
impl Sub<Position> for PositionT op T
type Output = Position
The resulting type after applying the - operator.
fn sub(self, other: Position) -> Position[src]
fn sub(self, other: Position) -> PositionPerforms the - operation.
impl<'a> Sub<Position> for &'a Position[src]
impl<'a> Sub<Position> for &'a Position&T op T
type Output = Position
The resulting type after applying the - operator.
fn sub(self, other: Position) -> Position[src]
fn sub(self, other: Position) -> PositionPerforms the - operation.
impl<'a> Sub<&'a Position> for Position[src]
impl<'a> Sub<&'a Position> for PositionT op &T
type Output = Position
The resulting type after applying the - operator.
fn sub(self, other: &'a Position) -> Position[src]
fn sub(self, other: &'a Position) -> PositionPerforms the - operation.
impl<'a, 'b> Sub<&'a Position> for &'b Position[src]
impl<'a, 'b> Sub<&'a Position> for &'b Position&T op &T
type Output = Position
The resulting type after applying the - operator.
fn sub(self, other: &'a Position) -> Position[src]
fn sub(self, other: &'a Position) -> PositionPerforms the - operation.
impl Mul<isize> for Position[src]
impl Mul<isize> for PositionT op x
type Output = Position
The resulting type after applying the * operator.
fn mul(self, other: isize) -> Position[src]
fn mul(self, other: isize) -> PositionPerforms the * operation.
impl<'a> Mul<isize> for &'a Position[src]
impl<'a> Mul<isize> for &'a Position&T op x
type Output = Position
The resulting type after applying the * operator.
fn mul(self, other: isize) -> Position[src]
fn mul(self, other: isize) -> PositionPerforms the * operation.
impl<'a> Mul<&'a isize> for Position[src]
impl<'a> Mul<&'a isize> for PositionT op &x
type Output = Position
The resulting type after applying the * operator.
fn mul(self, other: &'a isize) -> Position[src]
fn mul(self, other: &'a isize) -> PositionPerforms the * operation.
impl<'a, 'b> Mul<&'a isize> for &'b Position[src]
impl<'a, 'b> Mul<&'a isize> for &'b Position&T op &x
type Output = Position
The resulting type after applying the * operator.
fn mul(self, other: &'a isize) -> Position[src]
fn mul(self, other: &'a isize) -> PositionPerforms the * operation.
impl Div<isize> for Position[src]
impl Div<isize> for PositionT op x
type Output = Position
The resulting type after applying the / operator.
fn div(self, other: isize) -> Position[src]
fn div(self, other: isize) -> PositionPerforms the / operation.
impl<'a> Div<isize> for &'a Position[src]
impl<'a> Div<isize> for &'a Position&T op x
type Output = Position
The resulting type after applying the / operator.
fn div(self, other: isize) -> Position[src]
fn div(self, other: isize) -> PositionPerforms the / operation.
impl<'a> Div<&'a isize> for Position[src]
impl<'a> Div<&'a isize> for PositionT op &x
type Output = Position
The resulting type after applying the / operator.
fn div(self, other: &'a isize) -> Position[src]
fn div(self, other: &'a isize) -> PositionPerforms the / operation.
impl<'a, 'b> Div<&'a isize> for &'b Position[src]
impl<'a, 'b> Div<&'a isize> for &'b Position&T op &x