Esempio n. 1
0
        private bool _IsAtmosPassableAt(Vector3Int origin, Vector3Int to, bool isServer)         //TODO needs Object Passable
        {
            if (ObjectLayer.IsAtmosPassableAt(origin, to, isServer) == false)
            {
                return(false);
            }


            TileLocation TileLcation = null;

            foreach (var layer in LayersValues)
            {
                lock (PresentTiles)
                {
                    PresentTiles[layer].TryGetValue(to, out TileLcation);
                }

                if (TileLcation?.Tile == null)
                {
                    continue;
                }
                if ((TileLcation.Tile as BasicTile).IsAtmosPassable() == false)
                {
                    return(false);
                }
            }

            return(true);
            // for (var i = 0; i < LayersValues.Length; i++)
            // {
            // if (!LayersValues[i].IsAtmosPassableAt(origin, to, isServer))
            // {
            // return false;
            // }
            // }

            // return true;
        }