added cargo files

This commit is contained in:
2026-03-03 10:57:43 -05:00
parent 478a90e01b
commit 169df46bc2
813 changed files with 227273 additions and 9 deletions

View File

@@ -0,0 +1,32 @@
// Copyright 2020 Ben Hills and the project contributors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
enum SleepType {
none,
time,
episode,
}
final class Sleep {
final SleepType type;
final Duration duration;
late DateTime endTime;
Sleep({
required this.type,
this.duration = const Duration(milliseconds: 0),
}) {
endTime = DateTime.now().add(duration);
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is Sleep && runtimeType == other.runtimeType && type == other.type && duration == other.duration;
@override
int get hashCode => type.hashCode ^ duration.hashCode;
Duration get timeRemaining => endTime.difference(DateTime.now());
}