public static Tile ParseTile(XmlNode tileXmlNode, TileMap tileMap, int x, int y) { var gid = int.Parse(tileXmlNode.Attributes["gid"].Value); var texture = tileMap.GetTileSetByGid(gid).GetTilesTexture2D(gid); return new Tile(x, y, texture); }