# SPDX-FileCopyrightText: 2022 Flipp Syder <76629141+vulppine@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Velcroboy <107660393+IamVelcroboy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Velcroboy <velcroboy333@hotmail.com>
# SPDX-FileCopyrightText: 2024 Winkarst <74284083+Winkarst-cpu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  abstract: true
  parent: [ BaseMachinePowered, ConstructibleMachine ]
  id: SurveillanceCameraRouterBase
  name: camera router
  description: A surveillance camera router. It routes. Perhaps.
  components:
    - type: DeviceNetwork
      deviceNetId: Wired
      receiveFrequencyId: SurveillanceCamera
      transmitFrequencyId: SurveillanceCamera
    - type: WiredNetworkConnection
    - type: DeviceNetworkRequiresPower
    - type: UserInterface
      interfaces:
        enum.SurveillanceCameraSetupUiKey.Router:
          type: SurveillanceCameraSetupBoundUi
    - type: Machine
      board: SurveillanceCameraRouterCircuitboard
    - type: Sprite
      sprite: Structures/Machines/server.rsi
      snapCardinals: true
      layers:
        - state: server-off
        - state: server-on
          visible: false
          map: ["enum.PowerDeviceVisualLayers.Powered"]
        - state: server_o
          map: ["enum.WiresVisualLayers.MaintenancePanel"]
    - type: GenericVisualizer
      visuals:
        enum.PowerDeviceVisuals.Powered:
          enum.PowerDeviceVisualLayers.Powered:
            True: { visible: true }
            False: { visible: false }
    - type: Appearance
    - type: AmbientOnPowered
    - type: AmbientSound
      volume: -9
      range: 5
      enabled: false
      sound:
        path: /Audio/Ambience/Objects/server_fans.ogg
    - type: WiresVisuals
    - type: WiresPanel

- type: entity
  parent: SurveillanceCameraRouterBase
  id: SurveillanceCameraRouterConstructed
  suffix: Constructed
  components:
    - type: SurveillanceCameraRouter
      setupAvailableNetworks:
        - SurveillanceCameraEngineering
        - SurveillanceCameraSecurity
        - SurveillanceCameraService
        - SurveillanceCameraSupply
        - SurveillanceCameraScience
        - SurveillanceCameraGeneral
        - SurveillanceCameraMedical
        - SurveillanceCameraCommand

- type: entity
  parent: SurveillanceCameraRouterBase
  id: SurveillanceCameraRouterEngineering
  name: engineering camera router
  suffix: Engineering
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraEngineering

- type: entity
  parent: SurveillanceCameraRouterBase
  id: SurveillanceCameraRouterSecurity
  name: security camera router
  suffix: Security
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraSecurity

- type: entity
  parent: SurveillanceCameraRouterBase
  id: SurveillanceCameraRouterScience
  name: science camera router
  suffix: Science
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraScience

- type: entity
  parent: SurveillanceCameraRouterBase
  id: SurveillanceCameraRouterSupply
  name: supply camera router
  suffix: Supply
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraSupply

- type: entity
  parent: SurveillanceCameraRouterBase
  id: SurveillanceCameraRouterCommand
  name: command camera router
  suffix: Command
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraCommand

- type: entity
  parent: SurveillanceCameraRouterBase
  id: SurveillanceCameraRouterService
  name: service camera router
  suffix: Service
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraService

- type: entity
  parent: SurveillanceCameraRouterBase
  id: SurveillanceCameraRouterMedical
  name: medical camera router
  suffix: Medical
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraMedical

- type: entity
  parent: SurveillanceCameraRouterBase
  id: SurveillanceCameraRouterGeneral
  name: general camera router
  suffix: General
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraGeneral

- type: entity
  abstract: true
  parent: [ BaseMachinePowered, ConstructibleMachine ]
  id: SurveillanceCameraWirelessRouterBase
  name: wireless camera router
  description: A wireless surveillance camera router. It routes. Perhaps.
  components:
    - type: DeviceNetwork
      deviceNetId: Wireless
      receiveFrequencyId: SurveillanceCamera
      transmitFrequencyId: SurveillanceCamera
    - type: WirelessNetworkConnection
      range: 200
    - type: DeviceNetworkRequiresPower
    - type: UserInterface
      interfaces:
        enum.SurveillanceCameraSetupUiKey.Router:
          type: SurveillanceCameraSetupBoundUi
    - type: Machine
      board: SurveillanceCameraWirelessRouterCircuitboard
    - type: Sprite
      sprite: Structures/Machines/server.rsi
      layers:
        - state: server-off
        - state: server-on
          visible: false
          map: ["enum.PowerDeviceVisualLayers.Powered"]
        - state: server_o
          map: ["enum.WiresVisualLayers.MaintenancePanel"]
    - type: GenericVisualizer
      visuals:
        enum.PowerDeviceVisuals.Powered:
          enum.PowerDeviceVisualLayers.Powered:
            True: { visible: true }
            False: { visible: false }
    - type: Appearance
    - type: AmbientOnPowered
    - type: AmbientSound
      volume: -9
      range: 5
      enabled: false
      sound:
        path: /Audio/Ambience/Objects/server_fans.ogg
    - type: WiresVisuals
    - type: WiresPanel

- type: entity
  parent: SurveillanceCameraWirelessRouterBase
  id: SurveillanceCameraWirelessRouterConstructed
  suffix: Constructed
  components:
    - type: SurveillanceCameraRouter
      setupAvailableNetworks:
        - SurveillanceCameraEntertainment

- type: entity
  parent: SurveillanceCameraWirelessRouterBase
  id: SurveillanceCameraWirelessRouterEntertainment
  name: entertainment camera router
  suffix: Entertainment
  components:
    - type: SurveillanceCameraRouter
      subnetFrequency: SurveillanceCameraEntertainment