World.fromMap constructor
Implementation
factory World.fromMap(Map<String, dynamic> map) {
return World(
name: map['name'],
worldSettings: WorldSettingsManager().getType(map['worldSettings']),
kingdoms: List<Kingdom>.from(
(map['kingdoms']).map<Kingdom>(
(x) => Kingdom.fromMap(x),
),
),
landscapes: List<Landscape>.from(
(map['landscapes']).map<Landscape>(
(x) => Landscape.fromMap(x),
),
),
opinions: (map['opinions'] as Map).map(
(key, value) => MapEntry(RaceManager().getType(key), value),
),
importantPeople: List<Npc>.from(
(map['importantPeople']).map<Npc>(
(x) => Npc.fromMap(x),
),
),
guilds: List<Guild>.from(
(map['guilds']).map<Guild>(
(x) => Guild.fromMap(x),
),
),
deities: List<Deity>.from(
(map['deities']).map<Deity>(
(x) => Deity.fromMap(x),
),
),
lesserDeities: List<Deity>.from(
(map['lesserDeities']).map<Deity>(
(x) => Deity.fromMap(x),
),
),
higherDeities: List<Deity>.from(
(map['higherDeities']).map<Deity>(
(x) => Deity.fromMap(x),
),
),
worldLore: WorldLore.fromMap(map['worldLore']),
holidays: List<Holiday>.from(
(map['holidays']).map<Holiday>(
(x) => Holiday.fromMap(x),
),
),
);
}