- type: entity
  parent: GasPipeBase
  abstract: true
  id: GasTrinaryBase
  placement:
    mode: SnapgridCenter
  components:
    - type: AtmosDevice
    - type: SubFloorHide
      blockInteractions: false
      blockAmbience: false
    - type: NodeContainer
      nodes:
        inlet:
          !type:PipeNode
          nodeGroupID: Pipe
          pipeDirection: North
        filter:
          !type:PipeNode
          nodeGroupID: Pipe
          pipeDirection: West
        outlet:
          !type:PipeNode
          nodeGroupID: Pipe
          pipeDirection: South

- type: entity
  parent: GasTrinaryBase
  id: GasFilter
  name: gas filter
  description: Very useful for filtering gases.
  placement:
    mode: SnapgridCenter
  components:
    # TODO ATMOS Improve this sprite and appearance...
    - type: Sprite
      netsync: false
      sprite: Structures/Piping/Atmospherics/gasfilter.rsi
      layers:
        - sprite: Structures/Piping/Atmospherics/pipe.rsi
          state: pipeTJunction
          rotation: -90 # fuck you!!! who cares
          map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
        - state: gasFilter
          map: [ "enum.SubfloorLayers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
    - type: Appearance
      visuals:
        - type: PipeColorVisualizer
        - type: GasFilterVisualizer
          disabledState: gasFilter
          enabledState: gasFilterOn
    - type: UserInterface
      interfaces:
        - key: enum.GasFilterUiKey.Key
          type: GasFilterBoundUserInterface
    - type: GasFilter
    - type: Flippable
      mirrorEntity: GasFilterFlipped
    - type: Construction
      graph: GasTrinary
      node: filter
    - type: AmbientSound
      enabled: false
      volume: -9
      range: 5
      sound:
        path: /Audio/Ambience/Objects/gas_hiss.ogg

- type: entity
  parent: GasFilter
  id: GasFilterFlipped
  name: gas filter
  suffix: Flipped
  placement:
    mode: SnapgridCenter
  components:
  - type: Sprite
    netsync: false
    sprite: Structures/Piping/Atmospherics/gasfilter.rsi
    layers:
    - sprite: Structures/Piping/Atmospherics/pipe.rsi
      state: pipeTJunction
      rotation: -90
      map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
    - state: gasFilterF
      map: [ "enum.SubfloorLayers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
  - type: Flippable
    mirrorEntity: GasFilter
  - type: Appearance
    visuals:
    - type: PipeColorVisualizer
    - type: GasFilterVisualizer
      disabledState: gasFilterF
      enabledState: gasFilterFOn
  - type: NodeContainer
    nodes:
      inlet:
        !type:PipeNode
        nodeGroupID: Pipe
        pipeDirection: South
      filter:
        !type:PipeNode
        nodeGroupID: Pipe
        pipeDirection: West
      outlet:
        !type:PipeNode
        nodeGroupID: Pipe
        pipeDirection: North

- type: entity
  parent: GasTrinaryBase
  id: GasMixer
  name: gas mixer
  description: Very useful for mixing gases.
  placement:
    mode: SnapgridCenter
  components:
    - type: Sprite
      netsync: false
      sprite: Structures/Piping/Atmospherics/gasmixer.rsi
      layers:
        - sprite: Structures/Piping/Atmospherics/pipe.rsi
          state: pipeTJunction
          rotation: -90
          map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
        - state: gasMixer
          map: [ "enum.SubfloorLayers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
    - type: Appearance
      visuals:
        - type: PipeColorVisualizer
        - type: GasFilterVisualizer
          disabledState: gasMixer
          enabledState: gasMixerOn
    - type: UserInterface
      interfaces:
        - key: enum.GasMixerUiKey.Key
          type: GasMixerBoundUserInterface
    - type: GasMixer
      inletOne: inlet
      inletTwo: filter
    - type: Flippable
      mirrorEntity: GasMixerFlipped
    - type: Construction
      graph: GasTrinary
      node: mixer
    - type: AmbientSound
      enabled: false
      volume: -9
      range: 5
      sound:
        path: /Audio/Ambience/Objects/gas_hiss.ogg

- type: entity
  parent: GasMixer
  id: GasMixerFlipped
  name: gas mixer
  suffix: Flipped
  placement:
    mode: SnapgridCenter
  components:
  - type: Sprite
    netsync: false
    sprite: Structures/Piping/Atmospherics/gasmixer.rsi
    layers:
    - sprite: Structures/Piping/Atmospherics/pipe.rsi
      state: pipeTJunction
      rotation: -90
      map: [ "enum.PipeColorVisualizer+Layers.Pipe" ]
    - state: gasMixerF
      map: [ "enum.SubfloorLayers.FirstLayer", "enum.GasFilterVisualizer+Layers.Enabled" ]
  - type: Appearance
    visuals:
    - type: PipeColorVisualizer
    - type: GasFilterVisualizer
      disabledState: gasMixerF
      enabledState: gasMixerFOn
  - type: Flippable
    mirrorEntity: GasMixer
  - type: NodeContainer
    nodes:
      inlet:
        !type:PipeNode
        nodeGroupID: Pipe
        pipeDirection: South
      filter:
        !type:PipeNode
        nodeGroupID: Pipe
        pipeDirection: West
      outlet:
        !type:PipeNode
        nodeGroupID: Pipe
        pipeDirection: North
