public void Work(SettlersOfValgard game, Settler settler) { var table = Terrain.GatherTable; if (table == null || table.Count == 0) { //empty table VConsole.WriteWarning(settler + VConsole.Text(" is working on a barren ") + Terrain + VConsole.Text(" terrain!")); return; } var total = table.Aggregate(0, (prev, next) => next.Item2 + prev); var random = Noise.GetRecursiveNoise(game.Seed, game.Settlement.Day, settler.Id) % total; }