/// <summary> /// Initializes a new instance of the <see cref="VehicleSeat"/> class, specifying the unique instance identfier and kind. /// </summary> /// <param name="instanceId">The unique instance identifier.</param> /// <param name="kind">The kind of seat.</param> public VehicleSeat(ulong instanceId, VehicleSeatKind kind) : base(instanceId, null) { Kind = kind; }
/// <summary> /// Returns a value indicating whether a <see cref="VehicleSeat"/> of the specified kind is free. /// </summary> /// <param name="kind">The kind of the seat.</param> /// <returns><c>true</c> if a free seat was found; otherwise, <c>false</c>.</returns> public bool IsSeatFree(VehicleSeatKind kind) { return(_seats.Any(x => x.Kind.Equals(kind) && x.IsEmpty)); }