AutoTiles.AutoTilesBase.GetTileState C# (CSharp) Метод

GetTileState() приватный Метод

This method checks the state of a single tile. Obeying the tk2dTileMap standard the following value will be returned 0: empty cell 1: solid cell cells that are out of bounds can count as empty or solid, depending on the TreatBorderAsSolid property.
private GetTileState ( int x, int y, int l ) : int
x int
y int
l int
Результат int
        int GetTileState(int x, int y, int l)
        {
            // if the index is out of bounds
              if (x < 0 || y < 0 || x >= _mapDimensions.x || y >= _mapDimensions.y) {
            if (TreatBorderAsSolid) {
              return 1;
            } else {
              return 0;
            }

              } else {
            int tile = GetTileValueFromFramwork(x, y, l);

            if (tile == -1) {
              // this means we have hit an empty cell
              return 0;
            } else if (SpriteIdIsSpecialTile(tile)) {
              if (TreatSpecialAsSolid) {
            return 1;
              } else {
            return 0;
              }

            } else if (floorVariantIndices.Contains(tile)) {
              return 0;
            } else {
              return 1;
            }

              }
        }