コード例 #1
0
ファイル: Properties.cs プロジェクト: firejackal/IOLib
        } // SetValue

        public void AppendFromData(XINI.EntryItem parentEntry, XINI.AppendModes appendMode)
        {
            if (parentEntry == null)
            {
                return;
            }

            if (appendMode == XINI.AppendModes.Read)
            {
                if (parentEntry.Children.Count > 0)
                {
                    foreach (XINI.EntryItem childEntry in parentEntry.Children)
                    {
                        PropertyItem newItem = new PropertyItem();
                        newItem.AppendFromData(childEntry, appendMode);
                        base.Add(newItem);
                    } //childEntry
                }
            }
            else if (appendMode == XINI.AppendModes.Save)
            {
                if (base.Count > 0)
                {
                    for (int index = 0; index < base.Count; index++)
                    {
                        XINI.EntryItem childEntry = parentEntry.AppendChildEntry("Property", appendMode);
                        base[index].AppendFromData(childEntry, appendMode);
                    } // index
                }
            }
        } // AppendFromData
コード例 #2
0
ファイル: Text Table (XINI).cs プロジェクト: firejackal/IOLib
        }         //Move function

        public override void AppendFromData(XINI.EntryItem parentEntry, XINI.AppendModes appendMode)
        {
            if (parentEntry == null)
            {
                return;
            }
            if (appendMode == XINI.AppendModes.Read)
            {
                if (parentEntry.Children.Count > 0)
                {
                    foreach (XINI.EntryItem childEntry in parentEntry.Children)
                    {
                        this.Add(childEntry.Name, childEntry.Value);
                    }                     //for childEntry
                }
            }
            else if (appendMode == XINI.AppendModes.Save)
            {
                if (base.Count > 0)
                {
                    for (int index = 0; index < base.Count; index++)
                    {
                        parentEntry.AddChild(base[index].Name, base[index].Value);
                    }                     //for index
                }
            }
        } //AppendFromData function
コード例 #3
0
            } //SaveToFile

            public void AppendData(XINI.EntryItem parentEntry, XINI.AppendModes appendMode, string patternFile)
            {
                parentEntry.AppendChildEntryValue("Seed", ref this.Seed, appendMode, 0, 0);
                parentEntry.AppendChildEntryValue("Subset ID", ref this.SubsetID, appendMode, "", "");
                parentEntry.AppendChildEntryValue("Ignore Boundries", ref this.IgnoreBoundries, appendMode, false, false);
                parentEntry.AppendChildEntryValue("Include Rooms", ref this.IncludeRooms, appendMode, true, true);
                parentEntry.AppendChildEntryValue("Random Rooms Percentage", ref this.RandomRoomsPercentage, appendMode, 0.1F);

                if (appendMode == XINI.AppendModes.Read)
                {
                    this.Pattern = null;
                    if (System.IO.File.Exists(patternFile))
                    {
                        this.Pattern = new System.Drawing.Bitmap(patternFile);
                    }
                }
                else if (appendMode == XINI.AppendModes.Save)
                {
                    if (System.IO.File.Exists(patternFile))
                    {
                        System.IO.File.Delete(patternFile);
                    }
                    if (this.Pattern != null)
                    {
                        this.Pattern.Save(patternFile);
                    }
                }
            } //AppendData
コード例 #4
0
            } //SaveToFile

            public void AppendData(XINI.EntryItem parentEntry, XINI.AppendModes appendMode, string patternFile)
            {
                parentEntry.AppendChildEntryValue("Seed", ref this.Seed, appendMode, 0, 0);
                parentEntry.AppendChildEntryValue("Subset ID", ref this.SubsetID, appendMode, "", "");
                parentEntry.AppendChildEntryValue("Ignore Boundries", ref this.IgnoreBoundries, appendMode, false, false);
                parentEntry.AppendChildEntryValue("Include Rooms", ref this.IncludeRooms, appendMode, true, true);
                parentEntry.AppendChildEntryValue("Include Passages", ref this.IncludePassages, appendMode, true, true);
                parentEntry.AppendChildEntryEnumValue <UnconnectedTilesActions>("Unconnected Tiles Action", ref this.UnconnectedTilesAction, appendMode, UnconnectedTilesActions.ConnectAll.ToString());

                if (appendMode == XINI.AppendModes.Read)
                {
                    this.Pattern = null;
                    if (System.IO.File.Exists(patternFile))
                    {
                        this.Pattern = new Bitmap(patternFile);
                    }
                }
                else if (appendMode == XINI.AppendModes.Save)
                {
                    if (System.IO.File.Exists(patternFile))
                    {
                        System.IO.File.Delete(patternFile);
                    }
                    if (this.Pattern != null)
                    {
                        this.Pattern.Save(patternFile);
                    }
                }
            } //AppendData
コード例 #5
0
            } //LoadFromFile

            public bool SaveToFile(string fileName)
            {
                XINI cXINI = new XINI();

                cXINI.Name    = "Options";
                cXINI.Version = "1";

                XINI.EntryItem parentEntry = cXINI.Root.AppendChildEntry("Options", XINI.AppendModes.Save);
                this.AppendData(parentEntry, XINI.AppendModes.Save, fileName + ".pattern");

                return(cXINI.SaveToFile(fileName));
            } //SaveToFile
コード例 #6
0
ファイル: Properties.cs プロジェクト: firejackal/IOLib
 public override void AppendFromData(XINI.EntryItem parentEntry, XINI.AppendModes appendMode)
 {
     if (appendMode == XINI.AppendModes.Read)
     {
         this.Name  = parentEntry.Name;
         this.Value = parentEntry.Value;
     }
     else if (appendMode == XINI.AppendModes.Save)
     {
         parentEntry.Name  = this.Name;
         parentEntry.Value = this.Value;
     }
 } // AppendFromData
コード例 #7
0
            public bool LoadFromFile(string fileName)
            {
                XINI cXINI = new XINI();

                if (!cXINI.LoadFromFile(fileName))
                {
                    return(false);
                }

                XINI.EntryItem parentEntry = cXINI.Root.AppendChildEntry("Options", XINI.AppendModes.Read);
                this.AppendData(parentEntry, XINI.AppendModes.Read, fileName + ".pattern");

                return(true);
            } //LoadFromFile
コード例 #8
0
ファイル: Text Table (XINI).cs プロジェクト: firejackal/IOLib
        }     //GetValue function

        public override void AppendFromData(XINI.EntryItem parentEntry, XINI.AppendModes appendMode)
        {
            this.mLines.AppendFromData(parentEntry, appendMode);
        } //AppendFromData function
コード例 #9
0
ファイル: Text Table (XINI).cs プロジェクト: firejackal/IOLib
        } //Constructor

        public override void AppendFromData(XINI.EntryItem parentEntry, XINI.AppendModes appendMode)
        {
            parentEntry.AppendChildEntryValue("Name", ref this.Name, appendMode);
            parentEntry.AppendChildEntryValue("Value", ref this.Value, appendMode);
        }         //AppendFromData function