Пример #1
0
		public IntRect(ArrayPoint offset, ArrayPoint dimensions)
		{
			if (dimensions.X < 0 || dimensions.Y < 0)
			{
				this.dimensions = ArrayPoint.Zero;
			}
			else
			{
				this.dimensions = dimensions;
			}

			this.offset = offset;
		}
Пример #2
0
    void FloodFill(int x, int y, string tag)
    {
        Debug.Log(x);
        Debug.Log(y);
        Debug.Log("Got this far");
        if ((x > -1 && x < boardDimension) && (y > -1 && y < boardDimension))
        {
            Debug.Log("Two Layers Deep");
            if (tag.Equals(board[x, y].tag) && CompareIndexes(x, y))
            {
                Debug.Log("How far does this go");
                ArrayPoint n = new ArrayPoint();
                n.xPos = x;
                n.yPos = y;
                destroyList.Add(n);

                FloodFill(x + 1, y, tag);
                FloodFill(x - 1, y, tag);
                FloodFill(x, y + 1, tag);
                FloodFill(x, y - 1, tag);
            }
        }
    }
Пример #3
0
    bool CompareArrayPoints(ArrayPoint x, ArrayPoint y)
    {
        if (x.xPos == y.xPos && x.yPos == y.yPos)
            return true;

        return false;
    }
Пример #4
0
 ArrayPoint FindIndex(GameObject obj)
 {
     ArrayPoint newPoint = new ArrayPoint();
     for (int i = 0; i < boardDimension; i++)
     {
         for (int j = 0; j < boardDimension; j++)
         {
             if (board[i, j].Equals(obj))
             {
                 newPoint.xPos = i;
                 newPoint.yPos = j;
                 return newPoint;
             }
         }
     }
     newPoint.xPos = 9001;
     return newPoint;
 }
Пример #5
0
		public IntRect IncDimensions(ArrayPoint increase)
		{
			return new IntRect(offset, dimensions + increase);
		}
Пример #6
0
		public IntRect Subtract(ArrayPoint newOffset)
		{
			return new IntRect(offset - newOffset, dimensions);
		}
Пример #7
0
		public IntRect Translate(ArrayPoint newOffset)
		{
			return new IntRect(offset + newOffset, dimensions);
		}
Пример #8
0
 public IntRect Subtract(ArrayPoint point)
 {
     return new IntRect(offset - point, dimensions);
 }
Пример #9
0
 public static PointyHexPoint GridPointFromArrayPoint(ArrayPoint point)
 {
     return(PointyHexGrid <TCell> .GridPointFromArrayPoint(point));
 }