Пример #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            Groups.Clear();
            Locations.Clear();
            Flags.Clear();

            OverwriteChance = chkOverwriteChance.Checked;
            EncounterChance = Decimal.ToInt32(numEncounterQuantity.Value);

            foreach (object o in lstGroups.SelectedItems)
            {
                EncounterZoneGroup group = new EncounterZoneGroup();
                group.Name     = o.ToString();
                group.Quantity = Decimal.ToInt32(numEncounterQuantity.Value);
                Groups.Add(group);
            }

            foreach (object o in lstLocations.SelectedItems)
            {
                EncounterZoneLocation location = new EncounterZoneLocation();
                location.Name = o.ToString();
                Locations.Add(location);
            }

            foreach (object o in lstFlags.SelectedItems)
            {
                string flag;
                flag = o.ToString();
                Flags.Add(flag);
            }

            Cancelled = false;
            this.Close();
        }
Пример #2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     foreach (object item in lstLocations.SelectedItems)
     {
         EncounterZoneLocation ezl = new EncounterZoneLocation();
         ezl.Name = item.ToString();
         Locations.Add(ezl);
     }
     this.Close();
 }
Пример #3
0
        private List <EncounterZoneLocation> ParseLocations(String[] Locations, string Pos)
        {
            List <EncounterZoneLocation> Locs = new List <EncounterZoneLocation>();

            if (Locations.Length > 1 || Locations[0] != "")
            {
                foreach (string i in Locations)
                {
                    if (i.Length < 8 || i.Substring(0, 8) != "LOCATION")
                    {
                        Message.Show("Invalid location " + i + " at " + Pos + ".", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    EncounterZoneLocation loc = new EncounterZoneLocation();
                    loc.Name = i;
                    Locs.Add(loc);
                }
            }
            return(Locs);
        }