Example #1
0
    public override void UpdateAt(Vector3Int localPosition)
    {
        MetaDataNode node = metaDataLayer.Get(localPosition);

        MetaUtils.RemoveFromNeighbors(node);
        externalNodes.TryRemove(node, out MetaDataNode nothing);

        node.IsClosedAirlock = false;

        // If the node is atmos passable (i.e. space or room), we need to setup its neighbors again, otherwise it's occupied and does need a neighbor check
        if (metaTileMap.IsAtmosPassableAt(localPosition, true))
        {
            node.ClearNeighbors();
            node.Type = metaTileMap.IsSpaceAt(localPosition, true) ? NodeType.Space : NodeType.Room;
            SetupNeighbors(node);
            MetaUtils.AddToNeighbors(node);
        }
        else
        {
            node.Type = NodeType.Occupied;
            if (matrix.GetFirst <RegisterDoor>(localPosition, true))
            {
                node.IsClosedAirlock = true;
            }
        }
    }
    public override void UpdateAt(Vector3Int position)
    {
        MetaDataNode node = metaDataLayer.Get(position);

        MetaUtils.RemoveFromNeighbors(node);
        externalNodes.TryRemove(node, out MetaDataNode nothing);

        if (metaTileMap.IsAtmosPassableAt(position, true))
        {
            node.ClearNeighbors();

            node.Type = metaTileMap.IsSpaceAt(position, true) ? NodeType.Space : NodeType.Room;
            SetupNeighbors(node);
            MetaUtils.AddToNeighbors(node);
            node.IsClosedAirlock = false;
        }
        else
        {
            node.Type = NodeType.Occupied;
            if (matrix.GetFirst <RegisterDoor>(position, true))
            {
                node.IsClosedAirlock = true;
            }
        }
    }
Example #3
0
    public override void UpdateAt(Vector3Int localPosition)
    {
        MetaDataNode node = metaDataLayer.Get(localPosition);

        MetaUtils.RemoveFromNeighbors(node);
        externalNodes.TryRemove(node, out MetaDataNode nothing);

        node.IsIsolatedNode = false;

        // If the node is atmos passable (i.e. space or room), we need to setup its neighbors again, otherwise it's occupied and does need a neighbor check
        if (metaTileMap.IsAtmosPassableAt(localPosition, true))
        {
            node.ClearNeighbors();
            node.Type = metaTileMap.IsSpaceAt(localPosition, true) ? NodeType.Space : NodeType.Room;

            if (node.Type == NodeType.Space)
            {
                node.ThermalConductivity = AtmosDefines.SPACE_THERMAL_CONDUCTIVITY;
                node.HeatCapacity        = AtmosDefines.SPACE_HEAT_CAPACITY;
            }
        }
        else
        {
            node.Type = NodeType.Occupied;
            if (matrix.GetFirst <RegisterDoor>(localPosition, true))
            {
                node.IsIsolatedNode = true;

                //TODO hard coded these values, might be better to put them in register door?
                node.ThermalConductivity = 0.001f;
                node.HeatCapacity        = 10000f;
            }
        }

        if (node.IsIsolatedNode == false && node.Type != NodeType.Space &&
            matrix.MetaTileMap.GetTile(localPosition, true) is BasicTile tile && tile != null)
        {
            node.HeatCapacity        = tile.HeatCapacity;
            node.ThermalConductivity = tile.ThermalConductivity;
        }

        SetupNeighbors(node);



        if (MatrixManager.AtPoint(node.Position.ToWorld(node.PositionMatrix).RoundToInt(),
                                  CustomNetworkManager.IsServer) == node.PositionMatrix.MatrixInfo)
        {
            MetaUtils.AddToNeighbors(node);
        }
    }
Example #4
0
    public override void UpdateAt(Vector3Int position)
    {
        MetaDataNode node = metaDataLayer.Get(position);

        MetaUtils.RemoveFromNeighbors(node);

        if (metaTileMap.IsAtmosPassableAt(position))
        {
            node.ClearNeighbors();

            node.Type = metaTileMap.IsSpaceAt(position) ? NodeType.Space : NodeType.Room;
            SetupNeighbors(node);
            MetaUtils.AddToNeighbors(node);
        }
        else
        {
            node.Type = NodeType.Occupied;
        }
    }