56 lines
1.8 KiB
Dart
56 lines
1.8 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'warband_roster.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
HenchmenGroup _$HenchmenGroupFromJson(Map json) {
|
|
$checkKeys(json, requiredKeys: const ['group', 'stats']);
|
|
return HenchmenGroup(
|
|
HenchmenGroup._henchmenHeaderFromJson(json['group'] as String),
|
|
Unit._statsFromJson(json['stats'] as String),
|
|
Unit._splitListFromJson(json['weapons'] as String),
|
|
Unit._splitListFromJson(json['armour'] as String),
|
|
);
|
|
}
|
|
|
|
Hero _$HeroFromJson(Map json) {
|
|
$checkKeys(json, requiredKeys: const ['hero', 'stats']);
|
|
return Hero(
|
|
Unit._statsFromJson(json['stats'] as String),
|
|
Unit._splitListFromJson(json['skilllists'] as String),
|
|
Unit._splitListFromJson(json['weapons'] as String),
|
|
Unit._splitListFromJson(json['armour'] as String),
|
|
Unit._splitListFromJson(json['rules'] as String),
|
|
json['warbandaddition'] as int ?? 0,
|
|
Hero._heroHeaderFromJson(json['hero'] as String),
|
|
);
|
|
}
|
|
|
|
WarbandRoster _$WarbandRosterFromJson(Map json) {
|
|
$checkKeys(json, requiredKeys: const [
|
|
'warband',
|
|
'objective',
|
|
'alignment',
|
|
'heros',
|
|
'henchmen'
|
|
]);
|
|
return WarbandRoster(
|
|
WarbandRoster._warbandNameAndRace(json['warband'] as String),
|
|
json['campaign'] as int ?? 0,
|
|
json['objective'] as String,
|
|
json['alignment'] as String,
|
|
json['gc'] as int ?? 0,
|
|
json['shards'] as int ?? 0,
|
|
json['equipment'] as String ?? '',
|
|
json['achievments'] as String ?? '',
|
|
(json['heros'] as List)
|
|
?.map((e) => e == null ? null : Hero.fromJson(e))
|
|
?.toList(),
|
|
(json['henchmen'] as List)
|
|
?.map((e) => e == null ? null : HenchmenGroup.fromJson(e))
|
|
?.toList(),
|
|
)..active = json['active'] as bool ?? true;
|
|
}
|