コード例 #1
0
        override public void FirstVaccine(PatchTable patchTable)
        {
            PatchTable      = patchTable;
            VaccineAsString = VaccineAsString.GetInstance(patchTable.MaxPatchLength, Name);

            PointsInPatchTable = 0.0;
            foreach (Patch aPatch in patchTable.SortedPatchCollection)
            {
                PointsInPatchTable += aPatch.Weight;
                UnusedPatches.AddNew(aPatch);
            }

            Patch patchBest = patchTable.SortedPatchCollection[0];

            MakePatchAComponent(patchBest);
        }
コード例 #2
0
        internal static VaccineAsString GetInstanceFromNice(string name, string nice)
        {
            string[] components = nice.Split(',');
            int      max        = 0;

            foreach (string component in components)
            {
                max = Math.Max(max, component.Length);
            }

            VaccineAsString aVaccineAsString = VaccineAsString.GetInstance(max, name);

            foreach (string component in components)
            {
                aVaccineAsString.AddComponent(component);
            }
            return(aVaccineAsString);
        }