Exemple #1
0
        private void txtWarps_TextChanged(object sender, EventArgs e)
        {
            List <Warp> warps   = new List <Warp>();
            int         i       = 0;
            bool        changed = false;

            foreach (string line in txtWarps.Lines)
            {
                Warp newWarp = Warp.FromString(line);
                if (newWarp != null)
                {
                    warps.Add(newWarp);
                    if (i >= warpArray.Length ||
                        warps[i].sourceID != newWarp.sourceID || warps[i].destinationLevel != newWarp.destinationID || warps[i].destinationArea != newWarp.destinationArea || warps[i].destinationID != newWarp.destinationID)
                    {
                        changed = true;
                    }
                    i++;
                }
            }
            if (changed)
            {
                warpArray = warps.ToArray();
                if (WarpsChanged != null)
                {
                    WarpsChanged();
                }
            }
        }