mirror of
https://github.com/DungeonPaper/dungeon_world_data.git
synced 2026-05-17 18:08:01 +00:00
18 lines
522 B
Dart
18 lines
522 B
Dart
import 'package:dungeon_world_data/dungeon_world_data.dart';
|
|
|
|
/// This mixin ensures a key and a display name for an entity.
|
|
mixin KeyMixin {
|
|
/// This entity's unique key
|
|
abstract final String key;
|
|
|
|
/// This entity's display name, as the user would see it
|
|
String get displayName;
|
|
|
|
/// Get a reference to this entity, which can be used to look it up in a repository.
|
|
EntityReference get reference => EntityReference(
|
|
key: key,
|
|
name: displayName,
|
|
type: runtimeType.toString(),
|
|
);
|
|
}
|