GetUnitAttributes() публичный Метод

Returns the attributes for the specified unit.
public GetUnitAttributes ( int x, int y ) : BufferUnitAttributes
x int The X coordinate of the unit.
y int The Y coordinate of the unit.
Результат BufferUnitAttributes
Пример #1
0
 static int CountNeighbors(ConsoleBuffer buffer, int x, int y)
 {
     return (buffer.GetUnitAttributes(x - 1, y) != black ? 1 : 0) +
            (buffer.GetUnitAttributes(x + 1, y) != black ? 1 : 0) +
            (buffer.GetUnitAttributes(x - 1, y + 1) != black ? 1 : 0) +
            (buffer.GetUnitAttributes(x + 1, y + 1) != black ? 1 : 0) +
            (buffer.GetUnitAttributes(x - 1, y - 1) != black ? 1 : 0) +
            (buffer.GetUnitAttributes(x + 1, y - 1) != black ? 1 : 0) +
            (buffer.GetUnitAttributes(x, y + 1) != black ? 1 : 0) +
            (buffer.GetUnitAttributes(x, y - 1) != black ? 1 : 0);
 }