137 lines
4.7 KiB
Dart
137 lines
4.7 KiB
Dart
// lib/models/character.dart
|
|
|
|
import 'attributes.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
/// Representa um personagem jogável.
|
|
enum CharacterType {
|
|
estudante,
|
|
empreendedor,
|
|
profissional,
|
|
artista,
|
|
jornalista,
|
|
professor,
|
|
chefeDeFamilia,
|
|
}
|
|
|
|
class Character {
|
|
final CharacterType type;
|
|
final String name;
|
|
final String story;
|
|
final String description;
|
|
final IconData icon;
|
|
Attributes attributes;
|
|
final String scenario;
|
|
|
|
Character({
|
|
required this.type,
|
|
required this.name,
|
|
required this.story,
|
|
required this.attributes,
|
|
required this.description,
|
|
required this.icon,
|
|
required this.scenario,
|
|
});
|
|
|
|
/// Construtor de fábrica para criar instâncias predefinidas.
|
|
factory Character.predefined(CharacterType type) {
|
|
switch (type) {
|
|
case CharacterType.estudante:
|
|
return Character(
|
|
type: type,
|
|
name: 'Estudante',
|
|
scenario: 'Luanda',
|
|
description: 'Uma estudante dedicada que vive em Luanda.',
|
|
icon: Icons.school,
|
|
story: 'Começando a jornada em Luanda, ela enfrenta desafios de mensalidades e transporte. Consegue equilibrar os estudos e as finanças?',
|
|
attributes: Attributes(money: 50000.0, happiness: 0.7, health: 0.8, education: 0.2),
|
|
);
|
|
case CharacterType.empreendedor:
|
|
return Character(
|
|
type: type,
|
|
name: 'Jovem Empreendedor',
|
|
scenario: 'Benguela',
|
|
description: 'Um visionário em Benguela com uma ideia de negócio, mas com capital limitado.',
|
|
icon: Icons.business_center,
|
|
story: 'Um visionário em Benguela com uma ideia de negócio, mas com capital limitado. Ousadia e gestão de risco são a chave.',
|
|
attributes: Attributes(money: 20000.0, happiness: 0.6, professionalExperience: 0.1),
|
|
);
|
|
case CharacterType.profissional:
|
|
return Character(
|
|
type: type,
|
|
name: 'Profissional em Ascensão',
|
|
scenario: 'Huambo',
|
|
description: 'Um profissional ambicioso que trabalha no Huambo.',
|
|
icon: Icons.work,
|
|
story: 'Trabalhando no Huambo, ele busca oportunidades para avançar na carreira e investir. O futuro está nas suas decisões.',
|
|
attributes: Attributes(money: 100000.0, happiness: 0.5, professionalExperience: 0.5),
|
|
);
|
|
case CharacterType.artista:
|
|
return Character(
|
|
type: type,
|
|
name: 'Artista Criativo',
|
|
scenario: 'Luanda',
|
|
description: 'Um artista talentoso que vive em Luanda.',
|
|
icon: Icons.palette,
|
|
story: 'Um artista em Luanda que busca transformar a sua paixão em uma fonte de renda. O sucesso depende de encontrar o equilíbrio entre a arte e o lado comercial.',
|
|
attributes: Attributes(money: 15000.0, happiness: 0.9, health: 0.7, education: 0.3, professionalExperience: 0.1),
|
|
);
|
|
case CharacterType.jornalista:
|
|
return Character(
|
|
type: type,
|
|
name: 'Jornalista Investigativo',
|
|
scenario: 'Huambo',
|
|
description: 'Um jornalista dedicado que atua no Huambo.',
|
|
icon: Icons.mic,
|
|
story: 'Ele atua no Huambo, onde reportar a verdade o coloca em situações arriscadas, mas também abre portas. Sua jornada é sobre influência e integridade.',
|
|
attributes: Attributes(money: 30000.0, happiness: 0.6, health: 0.8, education: 0.6, professionalExperience: 0.4),
|
|
);
|
|
|
|
case CharacterType.professor:
|
|
return Character(
|
|
type: type,
|
|
name: 'Professor',
|
|
scenario: 'Huambo',
|
|
description: 'Mentor de futuras gerações em Huambo.',
|
|
story: 'Dedicado à educação e ao desenvolvimento em Huambo.',
|
|
icon: Icons.local_library,
|
|
attributes: Attributes(
|
|
money: 30000.0,
|
|
happiness: 0.8,
|
|
health: 0.8,
|
|
education: 0.9,
|
|
professionalExperience: 0.5,
|
|
),
|
|
);
|
|
case CharacterType.chefeDeFamilia:
|
|
return Character(
|
|
type: type,
|
|
name: 'Chefe de Família',
|
|
scenario: 'Luanda',
|
|
description: 'Provedor e pilar da família em Luanda.',
|
|
story: 'Garantindo o bem-estar e o sustento familiar em Luanda.',
|
|
icon: Icons.family_restroom,
|
|
attributes: Attributes(
|
|
money: 20000.0,
|
|
happiness: 0.6,
|
|
health: 0.7,
|
|
education: 0.5,
|
|
professionalExperience: 0.6,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
//Object get scenario => null;
|
|
|
|
/// Converte a instância para um mapa.
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'type': type.toString().split('.').last,
|
|
'name': name,
|
|
'story': story,
|
|
'attributes': attributes.toMap(),
|
|
'scenario': scenario,
|
|
};
|
|
}
|
|
} |