import 'package:flutter_blue_plus/flutter_blue_plus.dart';

import '../../constants.dart';

class LasertagDevice {
  final String id;
  final String name;
  final int type;
  final bool isConnected;
  final BluetoothDevice btDevice;
  final bool isNameVerified;

  LasertagDevice({
    required this.id,
    required this.name,
    required this.type,
    required this.btDevice,
    this.isConnected = false,
    this.isNameVerified = false,
  });

  bool get isLeader => type == LasertagConfig.typeLeader;
  
  LasertagDevice copyWith({String? name, bool? isNameVerified}) {
    return LasertagDevice(
      id: id,
      type: type,
      btDevice: btDevice,
      name: name ?? this.name,
      isNameVerified: isNameVerified ?? this.isNameVerified,
      isConnected: isConnected,
    );
  }
}