示例#1
0
 protected virtual void CalculateNeighbours(ISpace space)
 {
     for (int x = X - 1; x <= X + 1; x++)
     {
         for (int y = Y - 1; y <= Y + 1; y++)
         {
             for (int z = Z - 1; z <= Z + 1; z++)
             {
                 if (x != X || y != Y || z != Z)
                 {
                     neighbours.Add(space.GetSpacePart(x, y, z));
                 }
             }
         }
     }
 }
示例#2
0
 protected override void CalculateNeighbours(ISpace space)
 {
     for (int x = X - 1; x <= X + 1; x++)
     {
         for (int y = Y - 1; y <= Y + 1; y++)
         {
             for (int z = Z - 1; z <= Z + 1; z++)
             {
                 for (int w = W - 1; w <= W + 1; w++)
                 {
                     if (x != X || y != Y || z != Z || w != W)
                     {
                         neighbours.Add(space.GetSpacePart(x, y, z, w));
                     }
                 }
             }
         }
     }
 }