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; } } }
static bool getShadow(RElement ele) { if (ele.HasAttribute(P.Shad)) return ele.Attributes[P.Shad].ToBoolean(); return true; }
static bool getInstance(RElement ele) { if (ele.HasAttribute(P.Obj.Ins)) return bool.Parse(ele.Attributes[P.Obj.Ins].Value); return false; }
static string getName(RElement ele) { return ele.HasAttribute("Name") ? ele.Attributes[P.Name].Value : getUniqueName(); }