Autoload() public method

public Autoload ( string &name, string &texture, string>.IDictionary extraTextures ) : bool
name string
texture string
extraTextures string>.IDictionary
return bool
Ejemplo n.º 1
0
        private void AutoloadMountData(Type type)
        {
            ModMountData mount = (ModMountData)Activator.CreateInstance(type);

            mount.mod = this;
            string name          = type.Name;
            string texture       = (type.Namespace + "." + type.Name).Replace('.', '/');
            var    extraTextures = new Dictionary <MountTextureType, string>();

            foreach (MountTextureType textureType in Enum.GetValues(typeof(MountTextureType)))
            {
                extraTextures[textureType] = texture + "_" + textureType.ToString();
            }
            if (mount.Autoload(ref name, ref texture, extraTextures))
            {
                AddMount(name, mount, texture, extraTextures);
            }
        }