# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  abstract: true
  parent: BaseItem
  id: BaseAutomationFilter
  name: filter
  description: A filter that can be installed in factory machines.
  components:
  - type: Sprite
    sprite: _Goobstation/Objects/Misc/filter.rsi
    state: icon
  - type: Item
    size: Tiny
  - type: AutomationFilter
  - type: Construction
    graph: AutomationFilter
  - type: GuideHelp
    guides:
    - Automation

- type: entity
  abstract: true
  parent: BaseAutomationFilter
  id: BaseAutomationFilterToggled
  components:
  - type: ItemToggle
    soundActivate: /Audio/Machines/lightswitch.ogg
    soundDeactivate: /Audio/Machines/lightswitch.ogg
  - type: ToggleExamine

- type: entity
  parent: BaseAutomationFilter
  id: AutomationFilterLabel
  name: label filter
  description: A filter that can be installed in factory machines. This one scans labels of attached items.
  components:
  - type: LabelFilter
  - type: ActivatableUI
    key: enum.LabelFilterUiKey.Key
  - type: UserInterface
    interfaces:
      enum.LabelFilterUiKey.Key:
        type: LabelFilterBUI
  - type: Construction
    node: label

- type: entity
  parent: BaseAutomationFilter
  id: AutomationFilterName
  name: name filter
  description: A filter that can be installed in factory machines. This one uses complex AI vision technology to identify items.
  components:
  - type: NameFilter
  - type: ActivatableUI
    key: enum.NameFilterUiKey.Key
  - type: UserInterface
    interfaces:
      enum.NameFilterUiKey.Key:
        type: NameFilterBUI
  - type: Construction
    node: name

- type: entity
  parent: BaseAutomationFilter
  id: AutomationFilterStack
  name: stack filter
  description: A filter that can be installed in factory machines. This one weighs items to compare it to a stack size.
  components:
  - type: StackFilter
  - type: ActivatableUI
    key: enum.StackFilterUiKey.Key
  - type: UserInterface
    interfaces:
      enum.StackFilterUiKey.Key:
        type: StackFilterBUI
  - type: Construction
    node: stack

- type: entity
  parent: BaseAutomationFilter
  id: AutomationFilterPressure
  name: pressure filter
  description: A filter that can be installed in factory machines. This one has a barometer to check the pressure of gases.
  components:
  - type: PressureFilter
  - type: ActivatableUI
    key: enum.PressureFilterUiKey.Key
  - type: UserInterface
    interfaces:
      enum.PressureFilterUiKey.Key:
        type: PressureFilterBUI
  - type: Construction
    node: pressure

- type: entity
  parent: BaseAutomationFilter
  id: AutomationFilterCombined
  name: combined filter
  description: A filter that can be installed in factory machines. This one uses a logic gate to combine 2 installed item filters.
  components:
  - type: CombinedFilter
  - type: ItemSlots
    slots:
      combined_filter_a:
        name: Filter A
        whitelist:
          components:
          - AutomationFilter
      combined_filter_b:
        name: Filter B
        whitelist:
          components:
          - AutomationFilter
  - type: ContainerContainer
    containers:
      combined_filter_a: !type:ContainerSlot
      combined_filter_b: !type:ContainerSlot
  - type: Construction
    node: combined

- type: entity
  parent: BaseAutomationFilterToggled
  id: AutomationFilterAnchor
  name: anchor filter
  description: A filter that can be installed in factory machines. This one detects an anchorable object, and it being anchored or not.
  components:
  - type: AnchorFilter
  - type: ToggleExamine
    enabled: anchor-filter-examine-enabled
    disabled: anchor-filter-examine-disabled
  - type: Construction
    node: anchor

- type: entity
  parent: BaseAutomationFilter
  id: AutomationFilterMob
  name: mob filter
  description: A filter that can be installed in factory machines. This one detects living creatures and filters based on alive, critical or dead states.
  components:
  - type: MobFilter
  - type: ActivatableUI
    key: enum.MobFilterUiKey.Key
  - type: UserInterface
    interfaces:
      enum.MobFilterUiKey.Key:
        type: MobFilterBUI
  - type: Construction
    node: mob

- type: entity
  parent: BaseAutomationFilterToggled
  id: AutomationFilterCuff
  name: cuff filter
  description: A filter that can be installed in factory machines. This one detects whether people are restrained... who made this!?
  components:
  - type: CuffFilter
  - type: ToggleExamine
    enabled: cuff-filter-examine-enabled
    disabled: cuff-filter-examine-disabled
  - type: Construction
    node: cuff
