Skip to content

Instantly share code, notes, and snippets.

@ayende
Last active July 9, 2019 05:32
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 ayende/29fb684474adab243b7bfd0f6798ce07 to your computer and use it in GitHub Desktop.
Save ayende/29fb684474adab243b7bfd0f6798ce07 to your computer and use it in GitHub Desktop.
var priorityOrder = new [] {
DinosaurSelection.Triceratops,
DinosaurSelection.Centrosaurus,
DinosaurSelection.Styracosaurus
};
IDinosaur dino = null;
var errors = new List<Exception>();
foreach(var dinoToGet in priorityOrder)
{
try
{
dino = await Jurassic.Define($"{username}.Battle.Mount")
.WithColor(Colors.Orage)
.WithMinimumCarryingCapacity(2, Measurements.Tons)
.WithMaxCost(256, Measruments.KgFoodPerDay)
.WithAgeRange(3,9)
.WithGender(Genders.Any)
.SpawnAsync();
}
catch(Exception e)
{
errors.Add(e);
}
}
if(dino == null)
throw new AggregationException("Cannot create battle mount", errors);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment