コード例 #1
0
        public void Remap(string basefolder)
        {
            var D = PartLibrary.CreatePassivesMapping();

            File.WriteAllLines(Path.Combine(basefolder, "genmapping.txt"), (from i in D select i.Key + " " + i.Value).ToList());
            var map = File.ReadAllLines(Path.Combine(basefolder, "bommapping.txt"));

            foreach (var l in map)
            {
                var A = l.Split(' ');
                if (A.Count() == 2)
                {
                    string from = A[0];
                    string to   = A[1];

                    RemapPair(from, to);
                }
            }
            foreach (var l in D)
            {
                RemapPair(l.Key, l.Value);
            }
        }
コード例 #2
0
        public void Remap(ProgressLog log, string basefolder)
        {
            log.PushActivity("Remap");

            var D = PartLibrary.CreatePassivesMapping();

            File.WriteAllLines(Path.Combine(basefolder, "genmapping.txt"), (from i in D select i.Key + " " + i.Value).ToList());
            var map = File.ReadAllLines(Path.Combine(basefolder, "bommapping.txt"));

            log.AddString("Loaded bommapping!");
            foreach (var l in map)
            {
                var A = l.Split(' ');
                if (A.Count() >= 2)
                {
                    string from = A[0];
                    string to   = A[1];

                    bool dooverride = false;
                    if (A.Count() > 2)
                    {
                        if (A[2] == "override")
                        {
                            dooverride = true;
                        }
                        ;
                    }
                    RemapPair(log, from, to, dooverride);
                    //Console.WriteLine("remapped {0} to {1}", from, to);
                }
            }
            foreach (var l in D)
            {
                RemapPair(log, l.Key, l.Value, false);
            }
            log.PopActivity();
        }