Ejemplo n.º 1
0
 public SetterTuple(string reference, EnumModType compareType, ParamVariableType valueType, int valueIndex)
 {
     ReferenceName = reference;
     ModType       = compareType;
     ValueType     = valueType;
     ValueIndex    = valueIndex;
 }
Ejemplo n.º 2
0
        public ModInfo(EnumModType type, string name, string modID, string version,
                       string description, IEnumerable <string> authors, IEnumerable <string> contributors, string website,
                       EnumAppSide side, bool requiredOnClient, bool requiredOnServer,
                       IEnumerable <ModDependency> dependencies)
        {
            Type    = type;
            Name    = name ?? throw new ArgumentNullException(nameof(name));
            ModID   = modID ?? throw new ArgumentNullException(nameof(modID));
            Version = version ?? "";

            Description  = description ?? "";
            Authors      = ReadOnlyCopy(authors);
            Contributors = ReadOnlyCopy(contributors);
            Website      = website ?? "";

            Side             = side;
            RequiredOnClient = requiredOnClient;
            RequiredOnServer = requiredOnServer;
            Dependencies     = ReadOnlyCopy(dependencies);

            // Null-safe helper method which copies the specified elements into a read-only list.
            IReadOnlyList <T> ReadOnlyCopy <T>(IEnumerable <T> elements)
            => (elements ?? Enumerable.Empty <T>()).ToList().AsReadOnly();
        }