コード例 #1
0
        public static void Save()
        {
            XmlDocument doc = new XmlDocument();

            XmlElement root = doc.CreateElement("TreasureHuntSave");

            root.SetAttribute("version", SaveVersion.ToString());

            // Locations
            XmlElement locationData = doc.CreateElement("LocationData");

            locationData.SetAttribute("noteIndex", NoteIndex.ToString());
            locationData.SetAttribute("chestIndex", ChestIndex.ToString());
            root.AppendChild(locationData);

            // Flags
            XmlNode flagData = doc.CreateElement("Flags");

            flagData.InnerText = Flags.ToString();

            // Save
            root.AppendChild(flagData);
            doc.AppendChild(root);

            Directory.CreateDirectory(SaveDirectory);
            doc.Save(SaveFile);
        }
コード例 #2
0
    public static Color GetColorByNote(NoteIndex note)
    {
        switch (note)
        {
        case NoteIndex.A:
            return(Settings.instance.A);

        case NoteIndex.Asharp:
            return(Settings.instance.Asharp);

        case NoteIndex.B:
            return(Settings.instance.B);

        case NoteIndex.C:
            return(Settings.instance.C);

        case NoteIndex.Csharp:
            return(Settings.instance.Csharp);

        case NoteIndex.D:
            return(Settings.instance.D);

        case NoteIndex.Dsharp:
            return(Settings.instance.Dsharp);

        case NoteIndex.E:
            return(Settings.instance.E);

        case NoteIndex.F:
            return(Settings.instance.F);

        case NoteIndex.Fsharp:
            return(Settings.instance.Fsharp);

        case NoteIndex.G:
            return(Settings.instance.G);

        case NoteIndex.Gsharp:
            return(Settings.instance.Gsharp);
        }

        return(Color.white);
    }