GridCell.DefineAdjacents C# (CSharp) Méthode

DefineAdjacents() public méthode

Define the adjacents of the GridCell.
public DefineAdjacents ( int i, int j ) : void
i int The index of the Row such that 0=< i < NumberOfRows .
j int The index of the Column such that 0=< j < NumberOfColumns .
Résultat void
		public void DefineAdjacents (int i, int j)
		{
				if (adjacents == null) {
						adjacents = new List<int> ();
				}

				AddAdjacent (new Vector2 (i, j + 1));//Right Adjacent
				AddAdjacent (new Vector2 (i, j - 1));//Left Adjacent
				AddAdjacent (new Vector2 (i - 1, j));//Upper Adjacent
				AddAdjacent (new Vector2 (i + 1, j));//Lower Adjacent
		}