AStartTest.TileSystem.TileMap.SetTower C# (CSharp) Méthode

SetTower() public static méthode

public static SetTower ( Tower tower, Tile tile ) : bool
tower Tower
tile Tile
Résultat bool
        public static bool SetTower(Tower tower, Tile tile)
        {
            tile.SetBlockableObject(tower);
            if (IsTilePathsValid())
            {
                UpdateTilePaths();

                List<Tile> walkableNeighbors = GetWalkableNeighbors(tile);

                for (int i = 0; i < walkableNeighbors.Count; i++)
                {
                    walkableNeighbors[i].RegisterTowerListener(tower);
                }
                OnTowerCreated();
                return true;
            }

            RemoveTower(tile);
            return false;
        }