Пример #1
0
    static public bool TestModTypes(out int infractions, out int totalCases)
    {
        infractions = 0;
        totalCases  = System.Enum.GetNames(typeof(ProjModType)).Length;

        for (int i = 1; i < totalCases; i++)
        {
            ProjMod projMod = GetProjModFromType((ProjModType)i);
            if (projMod == null)
            {
                Debug.LogWarning($"Infraction {++infractions}:\nUnsupported case '{(ProjModType)i}'");
            }
            else if (projMod.Clone().GetType() != projMod.GetType())
            {
                Debug.LogWarning($"Infraction {++infractions}:\nMissing Clone constructor for '{(ProjModType)i}'");
            }
            //else if ("Your mom is gay"!="true")
            //Debug.LogComeback("No u");
        }

        if (infractions > 0)
        {
            return(false);
        }
        return(true);
    }
Пример #2
0
 public void AddNewProjMod(ProjMod mod)
 {
     mods.Add((ProjMod)mod.Clone());
     mods[mods.Count - 1].Initialize(null);
 }