using System.Collections.Generic;
public static void Main()
var goals = new List<Goal>();
goals.Add(new Goal(){ID=1, Level=1, Active = true});
goals.Add(new Goal(){ID=2, Level=1, Active = false});
goals.Add(new Goal(){ID=3, Level=2, Active = true});
goals.Add(new Goal(){ID=4, Level=2, Active = true});
goals.Add(new Goal(){ID=5, Level=2, Active = false});
goals.Add(new Goal(){ID=6, Level=2, Active = false});
goals.Add(new Goal(){ID=7, Level=2, Active = false});
goals.Add(new Goal(){ID=8, Level=2, Active = false});
goals.Add(new Goal(){ID=9, Level=2, Active = false});
goals.Add(new Goal(){ID=10, Level=2, Active = true});
goals.Add(new Goal(){ID=11, Level=2, Active = true});
goals.Add(new Goal(){ID=12, Level=2, Active = true});
goals.Add(new Goal(){ID=13, Level=2, Active = true});
goals.Add(new Goal(){ID=13, Level=2, Active = true});
goals.Add(new Goal(){ID=14, Level=2, Active = true});
goals.Add(new Goal(){ID=15, Level=2, Active = true});
Random rnd = new Random();
var tmp = goals.Select( g=> new {goal = g, weight = rnd.NextDouble()})
.OrderByDescending(t=>t.goal.Active)
Console.WriteLine("ID={0:00}, Level={1}, Active={2}", g.ID, g.Level, g.Active);