public static RoomTemplate ParseXML(string templateName, XmlNode roomTemplateXML)
    {
        RoomTemplate roomTemplate = new RoomTemplate();

        roomTemplate.m_templateName      = templateName;
        roomTemplate.m_floor             = TileGridTemplate.ParseXML(roomTemplateXML.SelectSingleNode(".//Floor"));
        roomTemplate.m_walls             = TileGridTemplate.ParseXML(roomTemplateXML.SelectSingleNode(".//Walls"));
        roomTemplate.m_backgroundObjects = TileGridTemplate.ParseXML(roomTemplateXML.SelectSingleNode(".//BackgroundObjects"));
        roomTemplate.m_navMeshTemplate   =
            AsyncRPGSharedLib.Navigation.NavMesh.FromNavMeshXML(roomTemplateXML.SelectSingleNode(".//NavMesh"));
        roomTemplate.m_forgroundObjects = TileGridTemplate.ParseXML(roomTemplateXML.SelectSingleNode(".//ForegroundObjects"));

        return(roomTemplate);
    }
    public static RoomTemplate ParseCompressedRoomTemplate(CompressedRoomTemplate compressedRoomTemplate)
    {
        RoomTemplate roomTemplate = new RoomTemplate();

        XmlDocument roomTemplateXML = new XmlDocument();

        roomTemplateXML.LoadXml(compressedRoomTemplate.xml);

        roomTemplate.m_templateName      = compressedRoomTemplate.templateName;
        roomTemplate.m_floor             = TileGridTemplate.ParseXML(roomTemplateXML.SelectSingleNode(".//Floor"));
        roomTemplate.m_walls             = TileGridTemplate.ParseXML(roomTemplateXML.SelectSingleNode(".//Walls"));
        roomTemplate.m_backgroundObjects = TileGridTemplate.ParseXML(roomTemplateXML.SelectSingleNode(".//BackgroundObjects"));
        roomTemplate.m_navMeshTemplate   =
            AsyncRPGSharedLib.Navigation.NavMesh.FromCompressedNavMeshData(
                compressedRoomTemplate.compressedNavCells,
                compressedRoomTemplate.compressedVisibility);
        roomTemplate.m_forgroundObjects = TileGridTemplate.ParseXML(roomTemplateXML.SelectSingleNode(".//ForegroundObjects"));

        return(roomTemplate);
    }