import 'package:flutter/material.dart';
import 'package:equatable/equatable.dart';

class InspectionTopologyState extends Equatable {
  final String deviceName;
  final String deviceModel;
  final List<TopologyNode> topologyNodes;
  final int deviceCount;
  final int connectionCount;
  final TopologyNode? selectedNode;

  const InspectionTopologyState({
    required this.deviceName,
    required this.deviceModel,
    required this.topologyNodes,
    this.deviceCount = 10,
    this.connectionCount = 11,
    this.selectedNode,
  });

  InspectionTopologyState copyWith({
    String? deviceName,
    String? deviceModel,
    List<TopologyNode>? topologyNodes,
    int? deviceCount,
    int? connectionCount,
    TopologyNode? selectedNode,
  }) {
    return InspectionTopologyState(
      deviceName: deviceName ?? this.deviceName,
      deviceModel: deviceModel ?? this.deviceModel,
      topologyNodes: topologyNodes ?? this.topologyNodes,
      deviceCount: deviceCount ?? this.deviceCount,
      connectionCount: connectionCount ?? this.connectionCount,
      selectedNode: selectedNode,
    );
  }

  @override
  List<Object?> get props => [deviceName, deviceModel, topologyNodes, deviceCount, connectionCount, selectedNode];
}

class TopologyNode extends Equatable {
  final String id;
  final String name;
  final String status;
  final List<TopologyNode> children;
  final double x;
  final double y;

  const TopologyNode({
    required this.id,
    required this.name,
    required this.status,
    required this.children,
    required this.x,
    required this.y,
  });

  @override
  List<Object?> get props => [id, name, status, children, x, y];
}
