示例#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 bool RemoveProjMod(ProjMod mod)
 {
     foreach (ProjMod pm in mods)
     {
         if (pm.GetType() == mod.GetType())
         {
             mods.Remove(pm);
             return(true);
         }
     }
     return(false);
 }