Example #1
0
    public static SaveGroup GetSave(string saveNum)
    {
        //確認檔案
        CheckXML();

        XmlDocument xmlDoc = new XmlDocument();

        xmlDoc.Load(filepath);
        SaveGroup savegroup = new SaveGroup();

        bool        HasSave   = false;
        XmlNodeList save_root = xmlDoc.SelectSingleNode("GameSave").ChildNodes;

        //讀取所有存檔
        foreach (XmlElement save in save_root)
        {
            if (save.Name == "Save0" + saveNum)
            {
                HasSave   = true;
                savegroup = new SaveGroup(
                    save.SelectSingleNode("Level").InnerText,
                    save.SelectSingleNode("Exp").InnerText,
                    save.SelectSingleNode("PlayerTime").InnerText,
                    save.SelectSingleNode("SaveArea").InnerText,
                    save.SelectSingleNode("SavePoint").InnerText);
            }
        }
        if (HasSave)
        {
            return(savegroup);
        }
        else
        {
            return(null);
        }
    }
Example #2
0
 public BaseResult POST(SaveGroup request)
 {
     return(VillageWorkingGroupManage.SaveGroup(request));
 }