Class ContentCollection
- Assembly
- MonoGame.Framework.Content.Pipeline.dll
Collection of rules on how the content should be handled.
The way this system works is by adding each call you make with include/exclude to a list of rules, then during the GetContentInfo(string, ref ContentInfo?) it will check if the filepath is valid for each one and return the last match it finds.
public class ContentCollection : IContentCollection
- Inheritance
-
ContentCollection
- Implements
- Inherited Members
Methods
Exclude(string)
Marks the file at excludePath to be excluded from the content handling.
public void Exclude(string excludePath)
Parameters
excludePathstringRelative path to the content file.
Exclude<T>(string)
Marks the files that match the excludePattern to be excluded from the content handling.
public void Exclude<T>(string excludePattern) where T : ContentRule, new()
Parameters
excludePatternstringA pattern to use for exclusion of content files.
Type Parameters
TA ContentRule to be used for matching the includePattern. Some built in options are:
WildcardRule - specifies that input pattern should be a wildcard.
RegexRule - specifies that input pattern should be a regex.
GetContentInfo(string, ref ContentInfo?)
Gets information about how the ocntent should be handled for the passed relative filepath.
public bool GetContentInfo(string filePath, ref ContentInfo? contentInfo)
Parameters
filePathstringRelative path to the content file.
contentInfoContentInfoContentInfo describing the desired content handling.
Returns
- bool
trueif the content should be handled,falseotherwise.
Include(string, IContentImporter?, IContentProcessor?)
Marks the file at inputPath to be built with specified settings.
public void Include(string inputPath, IContentImporter? contentImporter = null, IContentProcessor? contentProcessor = null)
Parameters
inputPathstringRelative path to the content file.
contentImporterIContentImporterAn IContentImporter to be used for the building, if its not specified, the system will use reflection to try to figure out an apropriate importer.
contentProcessorIContentProcessorAn IContentProcessor to be used for the building, if its not specified, the system will use reflection to try to figure out an apropriate processor.
Include(string, string, IContentImporter?, IContentProcessor?)
Marks the file at inputPath to be built with specified settings.
public void Include(string inputPath, string outputPath, IContentImporter? contentImporter = null, IContentProcessor? contentProcessor = null)
Parameters
inputPathstringRelative path to the content file.
outputPathstringRelative path for the output content, if its not specified, the inputPath will be used with .xnb extension.
contentImporterIContentImporterAn IContentImporter to be used for the building, if its not specified, the system will use reflection to try to figure out an apropriate importer.
contentProcessorIContentProcessorAn IContentProcessor to be used for the building, if its not specified, the system will use reflection to try to figure out an apropriate processor.
IncludeCopy(string, string?)
Marks the file at inputPath to be copied to the output directory.
public void IncludeCopy(string inputPath, string? outputPath)
Parameters
inputPathstringRelative path to the content file.
outputPathstringRelative path for the copy, if its not specified, the inputPath will be used.
IncludeCopy<T>(string, Func<string, string>?)
Marks the files that match the includePattern to be copied to the output directory.
public void IncludeCopy<T>(string includePattern, Func<string, string>? outputPath = null) where T : ContentRule, new()
Parameters
includePatternstringA pattern to use for building of content files.
outputPathFunc<string, string>Relative path for the output content, if its not specified, the relative filePath will be used with .xnb extension.
Type Parameters
TA ContentRule to be used for matching the includePattern. Some built in options are:
WildcardRule - specifies that input pattern should be a wildcard.
RegexRule - specifies that input pattern should be a regex.
Include<T>(string, IContentImporter?, IContentProcessor?)
Marks the files that match the includePattern to be built with the specified settings.
public void Include<T>(string includePattern, IContentImporter? contentImporter = null, IContentProcessor? contentProcessor = null) where T : ContentRule, new()
Parameters
includePatternstringA pattern to use for building of content files.
contentImporterIContentImporterAn IContentImporter to be used for the building, if its not specified, the system will use reflection to try to figure out an apropriate importer.
contentProcessorIContentProcessorAn IContentProcessor to be used for the building, if its not specified, the system will use reflection to try to figure out an apropriate processor.
Type Parameters
TA ContentRule to be used for matching the includePattern. Some built in options are:
WildcardRule - specifies that input pattern should be a wildcard.
RegexRule - specifies that input pattern should be a regex.
Include<T>(string, Func<string, string>, IContentImporter?, IContentProcessor?)
Marks the files that match the includePattern to be built with the specified settings.
public void Include<T>(string includePattern, Func<string, string> outputPath, IContentImporter? contentImporter = null, IContentProcessor? contentProcessor = null) where T : ContentRule, new()
Parameters
includePatternstringA pattern to use for building of content files.
outputPathFunc<string, string>A function that gives a relative output filepath for the specified relative content filepath.
contentImporterIContentImporterAn IContentImporter to be used for the building, if its not specified, the system will use reflection to try to figure out an apropriate importer.
contentProcessorIContentProcessorAn IContentProcessor to be used for the building, if its not specified, the system will use reflection to try to figure out an apropriate processor.
Type Parameters
TA ContentRule to be used for matching the includePattern. Some built in options are:
WildcardRule - specifies that input pattern should be a wildcard.
RegexRule - specifies that input pattern should be a regex.
SetContentRoot(string)
Sets the content root path that will be used when generating the output paths during include methods.
public void SetContentRoot(string contentRoot)
Parameters
contentRootstringRelative path that will get prefixed to the output paths.