Exemple #1
0
    public override bool Equals(object obj)
    {
        if (obj is ASPosition)
        {
            ASPosition p = (ASPosition)obj;
            return(this == p);
        }

        return(false);
    }
Exemple #2
0
    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();
    }
Exemple #3
0
 public int DistanceFrom(ASPosition p)
 {
     return(Mathf.Abs(this.x - p.x) + Mathf.Abs(this.y - p.y));
 }
Exemple #4
0
 public static int Distance(Vector2 p1, Vector2 p2)
 {
     return(ASPosition.Distance((Vector3)p1, (Vector3)p2));
 }
Exemple #5
0
 public static int Distance(Vector3 p1, Vector3 p2)
 {
     return(ASPosition.Distance(new ASPosition(p1), new ASPosition(p2)));
 }
Exemple #6
0
 public static int Distance(ASPosition p1, ASPosition p2)
 {
     return(Mathf.Abs(p1.x - p2.x) + Mathf.Abs(p1.y - p2.y));
 }
Exemple #7
0
 public void Move(ASPosition p)
 {
     this.Move(p.x, p.y);
 }
Exemple #8
0
 public ASMutablePosition(ASPosition pos) : this(pos.x, pos.y)
 {
 }