public override bool Equals(object obj) { if (obj is ASPosition) { ASPosition p = (ASPosition)obj; return(this == p); } return(false); }
public void PositionClicked(ASPosition position, int button) { if (gameState == GameState.NotPlaying) { return; } if (position.x < 0 || position.y < 0 || position.x >= width || position.y >= height) { return; } squares[position.x, position.y].Clicked(button); bombsLeft.text = "Bombs Left: " + (numBombs - markedSquares); checkWinCondition(); }
public int DistanceFrom(ASPosition p) { return(Mathf.Abs(this.x - p.x) + Mathf.Abs(this.y - p.y)); }
public static int Distance(Vector2 p1, Vector2 p2) { return(ASPosition.Distance((Vector3)p1, (Vector3)p2)); }
public static int Distance(Vector3 p1, Vector3 p2) { return(ASPosition.Distance(new ASPosition(p1), new ASPosition(p2))); }
public static int Distance(ASPosition p1, ASPosition p2) { return(Mathf.Abs(p1.x - p2.x) + Mathf.Abs(p1.y - p2.y)); }
public void Move(ASPosition p) { this.Move(p.x, p.y); }
public ASMutablePosition(ASPosition pos) : this(pos.x, pos.y) { }