//get material by providing a name public static PortalMaterial GetMaterialByName(string givenName) { return(AllMaterials.Where(pm => pm.Name == givenName).FirstOrDefault()); }
//select a random material of the given color public static PortalMaterial RandomMaterialWithColor(MaterialColor color) { return(RandomElement(AllMaterials.Where(pm => pm.Color == color || pm.Color == MaterialColor.Meta))); }