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

100 lines
3.6 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
}
2019-08-08 20:15:06 +02:00
Map<String, dynamic> _$HenchmenGroupToJson(HenchmenGroup instance) =>
<String, dynamic>{
'group': HenchmenGroup._henchmengroupHeaderToJson(instance.header),
'stats': Unit._statsToJson(instance.stats),
'weapons': Unit._joinListToJson(instance.weapons),
'armour': Unit._joinListToJson(instance.armour),
};
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-08-07 14:55:33 +02:00
json['hiredsword'] as bool ?? false,
2019-07-25 16:44:51 +02:00
);
2019-06-25 00:53:45 +02:00
}
2019-08-08 20:15:06 +02:00
Map<String, dynamic> _$HeroToJson(Hero instance) => <String, dynamic>{
'hero': Hero._heroHeaderToJson(instance.header),
'stats': Unit._statsToJson(instance.stats),
'skilllists': Unit._joinListToJson(instance.skilllists),
'weapons': Unit._joinListToJson(instance.weapons),
'armour': Unit._joinListToJson(instance.armour),
'rules': Unit._joinListToJson(instance.rules),
'warbandaddition': instance.warbandaddition,
'hiredsword': instance.hiredSword,
};
WarbandRoster _$WarbandRosterFromJson(Map json) {
2019-08-01 00:05:42 +02:00
$checkKeys(json, requiredKeys: const [
'warband',
'objective',
'alignment',
'heros',
'henchmen'
]);
return WarbandRoster(
2019-08-08 20:15:06 +02:00
WarbandRoster._warbandNameAndRaceFromJson(json['warband'] as String),
2019-07-25 16:44:51 +02:00
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(),
2019-08-08 20:15:06 +02:00
json['playerName'] as String ?? 'Lonely Recluse',
json['filePath'] as String,
json['version'] == null ? null : Version.fromJson(json['version']),
json['unseen'] as bool ?? true,
2019-07-25 16:44:51 +02:00
)..active = json['active'] as bool ?? true;
2019-06-25 00:53:45 +02:00
}
2019-08-08 20:15:06 +02:00
Map<String, dynamic> _$WarbandRosterToJson(WarbandRoster instance) =>
<String, dynamic>{
'warband': WarbandRoster._warbandNameAndRaceToJson(instance.nameAndRace),
'active': instance.active,
'campaign': instance.campaignPoints,
'objective': instance.objective,
'alignment': instance.alignment,
'achievments': instance.achievments,
'gc': instance.gc,
'shards': instance.shards,
'equipment': instance.equipment,
'heros': instance.heros,
'henchmen': instance.henchmenGroups,
'playerName': instance.playerName,
'filePath': instance.filePath,
'version': instance.version,
'unseen': instance.unseen,
};