EscapeGame constructor

EscapeGame({
  1. Inventory? inventory,
  2. Iterable<Room>? rooms,
  3. String? firstRoomId,
  4. Countdown? countdown,
})

Creates a new EscapeGame instance.

Implementation

EscapeGame({
  Inventory? inventory,
  Iterable<Room>? rooms,
  String? firstRoomId,
  this.countdown,
})  : assert(rooms != null && rooms.isNotEmpty),
      rooms = HashSet.from(rooms!),
      inventory = inventory ?? Inventory(),
      _currentRoom = firstRoomId ?? rooms.first.id {
  this.inventory.addListener(notifyListeners);
}