2019-06-25 00:53:45 +02:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
2019-07-16 23:37:18 +02:00
|
|
|
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-08-11 23:52:30 +02:00
|
|
|
Unit._splitListFromJson(json['rules'] as String),
|
2019-08-11 23:37:12 +02:00
|
|
|
json['large'] as bool ?? false,
|
2019-08-11 23:52:30 +02:00
|
|
|
json['slowWitted'] as bool ?? false,
|
|
|
|
json['mount'] as bool ?? false,
|
|
|
|
json['attackanimal'] 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> _$HenchmenGroupToJson(HenchmenGroup instance) =>
|
|
|
|
<String, dynamic>{
|
|
|
|
'group': HenchmenGroup._henchmengroupHeaderToJson(instance.header),
|
2019-08-11 23:37:12 +02:00
|
|
|
'large': instance.large,
|
2019-08-11 23:52:30 +02:00
|
|
|
'slowWitted': instance.slowWitted,
|
|
|
|
'mount': instance.mount,
|
|
|
|
'attackanimal': instance.attackAnimal,
|
2019-08-08 20:15:06 +02:00
|
|
|
'stats': Unit._statsToJson(instance.stats),
|
|
|
|
'weapons': Unit._joinListToJson(instance.weapons),
|
|
|
|
'armour': Unit._joinListToJson(instance.armour),
|
2019-08-11 23:52:30 +02:00
|
|
|
'rules': Unit._joinListToJson(instance.rules),
|
2019-08-08 20:15:06 +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-11 23:52:30 +02:00
|
|
|
Unit._splitListFromJson(json['injuries'] as String),
|
2019-08-01 00:05:42 +02:00
|
|
|
json['warbandaddition'] as int ?? 0,
|
2019-08-11 23:37:12 +02:00
|
|
|
json['large'] as bool ?? false,
|
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-08-11 23:52:30 +02:00
|
|
|
json['dramatispersonae'] as bool ?? false,
|
|
|
|
json['slowWitted'] 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),
|
2019-08-11 23:52:30 +02:00
|
|
|
'injuries': Unit._joinListToJson(instance.injuries),
|
2019-08-08 20:15:06 +02:00
|
|
|
'warbandaddition': instance.warbandaddition,
|
2019-08-11 23:37:12 +02:00
|
|
|
'large': instance.large,
|
2019-08-11 23:52:30 +02:00
|
|
|
'slowWitted': instance.slowWitted,
|
2019-08-08 20:15:06 +02:00
|
|
|
'hiredsword': instance.hiredSword,
|
2019-08-11 23:52:30 +02:00
|
|
|
'dramatispersonae': instance.dramatisPersonae,
|
2019-08-08 20:15:06 +02:00
|
|
|
};
|
|
|
|
|
2019-07-16 23:37:18 +02:00
|
|
|
WarbandRoster _$WarbandRosterFromJson(Map json) {
|
2019-08-01 00:05:42 +02:00
|
|
|
$checkKeys(json, requiredKeys: const [
|
|
|
|
'warband',
|
|
|
|
'objective',
|
|
|
|
'alignment',
|
|
|
|
'heros',
|
|
|
|
'henchmen'
|
|
|
|
]);
|
2019-07-16 23:37:18 +02:00
|
|
|
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,
|
|
|
|
};
|