mirror of
https://github.com/DungeonPaper/dungeon_world_data.git
synced 2026-05-17 18:08:01 +00:00
32 lines
631 B
Dart
32 lines
631 B
Dart
import 'dw_entity.dart';
|
|
|
|
class Alignment extends DWEntity {
|
|
/// Alignment name
|
|
String name;
|
|
|
|
/// Alignment description
|
|
String description;
|
|
|
|
Alignment({
|
|
String? key,
|
|
required this.name,
|
|
required this.description,
|
|
}) : super(key: key ?? DWEntity.generateKey(name));
|
|
|
|
factory Alignment.fromJSON(Map map) => Alignment(
|
|
key: map['key'],
|
|
name: map['name'],
|
|
description: map['description'],
|
|
);
|
|
|
|
@override
|
|
Map toJSON() => {
|
|
'key': key,
|
|
'name': name,
|
|
'description': description,
|
|
};
|
|
|
|
@override
|
|
Alignment copy() => Alignment.fromJSON(toJSON());
|
|
}
|