Created
September 18, 2019 04:41
-
-
Save IntegerMan/294b85f4e6965535dd585bb179fe620e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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