copyWith method
Npc
copyWith({
- String? name,
- int? age,
- Gender? gender,
- Race? race,
- String? occupation,
- PhysicalDescription? physicalDescription,
- Personality? personality,
- String? goal,
- List<
Companion> ? companions,
Implementation
Npc copyWith({
String? name,
int? age,
Gender? gender,
Race? race,
String? occupation,
PhysicalDescription? physicalDescription,
Personality? personality,
String? goal,
List<Companion>? companions,
}) {
return Npc(
name: name ?? this.name,
age: age ?? this.age,
gender: gender ?? this.gender,
race: race ?? this.race,
occupation: occupation ?? this.occupation,
physicalDescription: physicalDescription ?? this.physicalDescription,
personality: personality ?? this.personality,
goal: goal ?? this.goal,
companions: companions ?? this.companions,
);
}