randpg 0.6.0
randpg: ^0.6.0 copied to clipboard
A package for generating random rpg entities. This package allows generating many random entities for rpg fantasy games, from names and npcs to entire worlds! Many of the features in this package can [...]
example/example.md
Examples #
Table of Contents #
- Generating names
- Generating npcs
- Generating locations\buildings
- Generating settlements
- Generating landscapes
- Generating deities
- Generating worlds
Generating names #
Generating a male halfling name as an example:
final Gender gender = Gender.male;
final Race race = Halfling();
final nameGenerator = race.getNameGenerator(gender);
// if you want to seed the generator:
nameGenerator.seed(1234);
print(nameGenerator.generate()); // expected output: "Cormin Shadowheart"
output might be different since dart random seed is different on different machines
Generating npcs #
Generating an elf npc as an example:
final Race race = Elf();
final npcGenerator = NpcGenerator(race);
print(npcGenerator.generate());
Generating locations\buildings #
Generating a tavern whose owner is a dwarf as an example:
final LocationType locationType = Tavern();
final Race ownerRace = Dwarf();
final locationGenerator = LocationGenerator(locationType, ownerRace);
print(locationGenerator.generate());
Generating settlements #
Generating a town of mostly orcs as an example:
final SettlementType settlementType = Town();
final Race dominantRace = Orc();
final settlementGenerator = SettlementGenerator(settlementType, dominantRace);
print(settlementGenerator.generate());
Generating landscapes #
Generating a swamp as an example:
final LandscapeType landscapeType = Swamp();
final landscapeGenerator = LandscapeGenerator(landscapeType);
print(landscapeGenerator.generate());
Generating deities #
Generating a lawful good god/goddess as an example:
final Alignment alignment = Alignment(
ethical: EthicalAlignment.lawful,
moral: MoralAlignment.good,
);
final DeityType deityType = God();
final deityGenerator = DeityGenerator(deityType, alignment);
print(deityGenerator.generate());
Generating worlds #
See worlds example