Example #1
0
 static Material getMaterial(RElement ele, Dictionary<string, Texture> texts)
 {
     if (ele.HasAttribute(P.Mat))
     {
         throw new Exception(); //Create exception for non-matching values or spelling mistakes.
     }
     else
     {
         if (ele.HasElement(ele.Name + "." + P.Mat))
         {
             if (ele.GetElement(ele.Name + "." + P.Mat).Elements.Count > 0)
             {
                 return ele.GetElement(ele.Name + "." + P.Mat).Elements[0].CreateMaterialFromElement(texts);
             }
             else
             {
                 throw new Exception(); //Create exception for elements not found.
             }
         }
         else
         {
             return null;
         }
     }
 }
Example #2
0
 static bool getShadow(RElement ele)
 {
     if (ele.HasAttribute(P.Shad))
         return ele.Attributes[P.Shad].ToBoolean();
     return true;
 }
Example #3
0
 static bool getInstance(RElement ele)
 {
     if (ele.HasAttribute(P.Obj.Ins))
         return bool.Parse(ele.Attributes[P.Obj.Ins].Value);
     return false;
 }
Example #4
0
 static string getName(RElement ele)
 {
     return ele.HasAttribute("Name") ? ele.Attributes[P.Name].Value : getUniqueName();
 }