コード例 #1
0
 public frmEditSpecialEncounter(SpecialEncounter Encounter, List<Location> Locations)
 {
     this.Locations = Locations;
     InitializeComponent();
     if (Encounter == null)
         return;
     txtName.Text = Encounter.Name;
 }
コード例 #2
0
 public frmEditSpecialEncounter(SpecialEncounter Encounter, List <Location> Locations)
 {
     this.Locations = Locations;
     InitializeComponent();
     if (Encounter == null)
     {
         return;
     }
     txtName.Text = Encounter.Name;
 }
コード例 #3
0
        public void LoadSpecialEncounters()
        {
            List <String> Lines = new List <string>(File.ReadAllLines(@"./specialencounters.fowm"));

            for (int i = 0; i < Lines.Count; i++)
            {
                string[] SepChunks = { "|||" };
                string[] SepConRes = { "||" };
                string[] Parts     = Lines[i].Split(SepChunks, StringSplitOptions.None);
                if (Parts.Length != 3)
                {
                    Message.Show("Failed to parse special encounters, on line " + (i + 1), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                string[] Properties = Parts[0].Split('|');

                Location Loc = null;
                foreach (Location LLoc in Locations)
                {
                    if (LLoc.Pid == Int32.Parse(Properties[2]))
                    {
                        Loc = LLoc;
                    }
                }

                SpecialEncounter se = new SpecialEncounter(Properties[0], Properties[1], Loc, 100 / Int32.Parse(Properties[3]));

                if (Parts[1].Length > 0)
                {
                    string[] Conditions = Parts[1].Split(SepConRes, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string Condition in Conditions)
                    {
                        string[] CondProperties = Condition.Split(',');
                        se.AddCondition((ConditionType)Int32.Parse(CondProperties[0]), CondProperties[1], CondProperties[2], Int32.Parse(CondProperties[3]));
                    }
                }

                if (Parts[2].Length > 0)
                {
                    string[] Results = Parts[2].Split(SepConRes, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string Result in Results)
                    {
                        string[] ResultProperties = Result.Split(',');
                        se.AddResult((ConditionType)Int32.Parse(ResultProperties[0]), ResultProperties[1], ResultProperties[2], Int32.Parse(ResultProperties[3]));
                    }
                }

                this.SpecialEncounters.Add(se);
            }
        }
コード例 #4
0
        public void LoadSpecialEncounters()
        {
            List<String> Lines = new List<string>(File.ReadAllLines(@"./specialencounters.fowm"));
            for (int i=0;i<Lines.Count;i++)
            {
                string[] SepChunks = { "|||" };
                string[] SepConRes = { "||" };
                string[] Parts = Lines[i].Split(SepChunks, StringSplitOptions.None);
                if (Parts.Length != 3)
                {
                    Message.Show("Failed to parse special encounters, on line " + (i + 1), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                string[] Properties = Parts[0].Split('|');

                Location Loc=null;
                foreach(Location LLoc in Locations)
                    if(LLoc.Pid==Int32.Parse(Properties[2]))
                        Loc=LLoc;

                SpecialEncounter se = new SpecialEncounter(Properties[0], Properties[1], Loc,100/Int32.Parse(Properties[3]));

                if (Parts[1].Length > 0)
                {
                    string[] Conditions = Parts[1].Split(SepConRes, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string Condition in Conditions)
                    {
                        string[] CondProperties = Condition.Split(',');
                        se.AddCondition((ConditionType)Int32.Parse(CondProperties[0]), CondProperties[1], CondProperties[2], Int32.Parse(CondProperties[3]));
                    }
                }

                if (Parts[2].Length > 0)
                {
                    string[] Results = Parts[2].Split(SepConRes, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string Result in Results)
                    {
                        string[] ResultProperties = Result.Split(',');
                        se.AddResult((ConditionType)Int32.Parse(ResultProperties[0]), ResultProperties[1], ResultProperties[2], Int32.Parse(ResultProperties[3]));
                    }
                }

                this.SpecialEncounters.Add(se);
            }
        }
コード例 #5
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     Encounter = new SpecialEncounter(txtName.Text, txtDescription.Text, this.Loc, (100 / (int)numChance.Value));
     Save      = true;
     this.Close();
 }
コード例 #6
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     Encounter = new SpecialEncounter(txtName.Text, txtDescription.Text, this.Loc, (100/(int)numChance.Value));
     Save = true;
     this.Close();
 }