public CoreSkeleton(string filename) { var doc = new XmlDocument(); doc.Load(filename); bones = doc.SelectElements("//BONE").Select( x => new CoreBone(x, this)).ToList(); }
public CoreAnimation(string filename, CoreSkeleton skeleton) { var doc = new XmlDocument(); doc.Load(filename); duration = float.Parse(doc.SelectSingleNode("/ANIMATION/@DURATION").Value); tracks = doc.SelectElements("//TRACK").Select( e => new CoreTrack(e, skeleton)).ToList(); }
public CoreMesh(string filename, CoreSkeleton skeleton) { var doc = new XmlDocument(); doc.Load(filename); vertices = doc.SelectElements("//VERTEX").Select( e => new Pair<Vertex, CoreBone>( new Vertex(e), skeleton.GetBone(int.Parse( e.SelectSingleNode("./INFLUENCE/@ID" ).Value )))).ToArray(); indices = doc.SelectAttributes("//FACE/@VERTEXID").SelectMany( e => e.Value.Split(' ').Select(x => ushort.Parse(x))).ToArray(); textureName = CoreMaterial.GetTextureFilename( Path.ChangeExtension(filename, ".xrf")); }
private static IDictionary<string, string> ReadJavaPropertiesXml([NotNull] FileSystemPath pathFile) { if(pathFile == null) throw new ArgumentNullException("pathFile"); var xmlDoc = new XmlDocument(); pathFile.ReadStream(xmlDoc.Load); return xmlDoc.SelectElements("//entry").ToDictionary(xmlEntry => xmlEntry.GetAttribute("key"), xmlEntry => xmlEntry.InnerText); }