Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created September 18, 2019 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/294b85f4e6965535dd585bb179fe620e to your computer and use it in GitHub Desktop.
Save IntegerMan/294b85f4e6965535dd585bb179fe620e to your computer and use it in GitHub Desktop.
internal static GameState GenerateCrewMembers(this GameState state, int count)
{
int nextId = state.NextCrewId;
var faker = new Faker<CrewMember>()
.RuleFor(c => c.Id, f => nextId++)
.RuleFor(c => c.FirstName, f => f.Person.FirstName)
.RuleFor(c => c.LastName, f => f.Person.LastName)
.RuleFor(c => c.Department, f => f.PickRandom<Department>())
.RuleFor(c => c.Rank, f => f.PickRandom<Rank>())
.RuleFor(c => c.DaysInRank, f => f.Random.Int(0, 500));
state.Add(faker.Generate(count));
return state;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment