toolheim/mobile-app/lib/data/warband_roster.g.dart

57 lines
1.8 KiB
Dart
Raw Normal View History

2019-06-25 00:53:45 +02:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'warband_roster.dart';
2019-06-25 00:53:45 +02:00
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
HenchmenGroup _$HenchmenGroupFromJson(Map json) {
2019-08-01 00:05:42 +02:00
$checkKeys(json, requiredKeys: const ['group', 'stats']);
2019-06-25 00:53:45 +02:00
return HenchmenGroup(
2019-07-25 16:44:51 +02:00
HenchmenGroup._henchmenHeaderFromJson(json['group'] as String),
Unit._statsFromJson(json['stats'] as String),
Unit._splitListFromJson(json['weapons'] as String),
2019-08-01 00:05:42 +02:00
Unit._splitListFromJson(json['armour'] as String),
2019-07-25 16:44:51 +02:00
);
2019-06-25 00:53:45 +02:00
}
Hero _$HeroFromJson(Map json) {
2019-08-01 00:05:42 +02:00
$checkKeys(json, requiredKeys: const ['hero', 'stats']);
2019-06-25 00:53:45 +02:00
return Hero(
2019-07-25 16:44:51 +02:00
Unit._statsFromJson(json['stats'] as String),
Unit._splitListFromJson(json['skilllists'] as String),
Unit._splitListFromJson(json['weapons'] as String),
2019-08-01 00:05:42 +02:00
Unit._splitListFromJson(json['armour'] as String),
2019-07-25 16:44:51 +02:00
Unit._splitListFromJson(json['rules'] as String),
2019-08-01 00:05:42 +02:00
json['warbandaddition'] as int ?? 0,
2019-07-25 16:44:51 +02:00
Hero._heroHeaderFromJson(json['hero'] as String),
);
2019-06-25 00:53:45 +02:00
}
WarbandRoster _$WarbandRosterFromJson(Map json) {
2019-08-01 00:05:42 +02:00
$checkKeys(json, requiredKeys: const [
'warband',
'objective',
'alignment',
'heros',
'henchmen'
]);
return WarbandRoster(
2019-07-25 16:44:51 +02:00
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;
2019-06-25 00:53:45 +02:00
}