예제 #1
0
 //get material by providing a name
 public static PortalMaterial GetMaterialByName(string givenName)
 {
     return(AllMaterials.Where(pm => pm.Name == givenName).FirstOrDefault());
 }
예제 #2
0
 //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)));
 }