C# 클래스 Glare.Assets.AssetFormat

This describes a resource format.
To implement creating, CanCreate and Create need to be overloaded. To implement loading, CanLoad, LoadMatch, and Load need to be overloaded; LoadTypesMutable should be filled or provided in the constructor (if CanLoad is true and no types are provided in the constructor, the PrimaryType is automatically added). To implement saving, CanSave, Save, and SaveCheck need to be overloaded; SaveTypesMutable should be filled or provided in the constructor (if CanSave is true and no types are provided in the constructor, the PrimaryType is automatically added).
상속: PluginAsset
파일 보기 프로젝트 열기: Burton-Radons/Alexandria 1 사용 예제들

공개 메소드들

메소드 설명
AssetFormat ( PluginAsset pluginResource, Type primaryType, bool canLoad = false, IList loadTypes = null, bool canSave = false, IList saveTypes = null, bool canCreate = false, IList createTypes = null, string extension = null, IList extensions = null ) : System

Create ( AssetManager manager, Type resourceType ) : Asset

Create a new Asset of the PrimaryType.

Load ( AssetLoader loader ) : Asset

Load an Asset. This should have previously matched using LoadMatch.

LoadAsset ( AssetLoader loader, IEnumerable formats, ResolveLoadConflictCallback resolveConflict = null ) : Asset

Load an Asset.

LoadAssetAsync ( AssetLoader loader, IEnumerable formats, ResolveLoadConflictCallback resolveConflict = null, AssetLoaderProgressCallback progress = null, System.TimeSpan progressUpdateRate = null ) : Task

Load an Asset.

LoadMatch ( AssetLoader loader ) : LoadMatchStrength

Attempt to match this AssetFormat against the loader.

LoadMatchAsset ( LoadMatchStrength &matchStrength, AssetLoader loader, IEnumerable formats, ResolveLoadConflictCallback resolveConflict = null ) : AssetFormat

Find the best AssetFormat for loading an Asset.

MatchStrengthToString ( LoadMatchStrength value ) : string

Get a string describing a match strength, which handles values in between like "Perfect-2" or "Strong+3".

Save ( Asset asset, BinaryWriter writer, FileManager fileManager ) : void

Save the asset to the file.

SaveCheck ( Asset resource ) : SaveCheckResult

Check whether the Asset can be saved with this AssetFormat.

보호된 메소드들

메소드 설명
LoadMatchMagic ( AssetLoader loader, int magic, int minimumLength = 4 ) : LoadMatchStrength

Perform a quick match based on a magic Int32 value.

LoadMatchMagic ( AssetLoader loader, string magic, int minimumLength ) : LoadMatchStrength

Perform a quick match based on a magic string and a minimum length.

비공개 메소드들

메소드 설명
CreateConflictException ( AssetLoader loader, LoadMatchStrength matchStrength, IList formats ) : InvalidDataException
MatchStrengthToString ( LoadMatchStrength reference, LoadMatchStrength value ) : string

메소드 상세

AssetFormat() 공개 메소드

public AssetFormat ( PluginAsset pluginResource, Type primaryType, bool canLoad = false, IList loadTypes = null, bool canSave = false, IList saveTypes = null, bool canCreate = false, IList createTypes = null, string extension = null, IList extensions = null ) : System
pluginResource PluginAsset The context for the , used to find the .
primaryType System.Type The primary type that this operates with.
canLoad bool Whether this can load s; if true, then and must be implemented.
loadTypes IList Any additional types that could be loaded beyond the ; this can only be provided if is true.
canSave bool Whether this can save s; if true, then and must be implemented, and can be provided for additional types this can save beyond the .
saveTypes IList Any additional types that this can save beyond the ; this can only be provided if is true.
canCreate bool Whether this can create an . If so, must be implemented, and can be provided for additional types this can create beyond the .
createTypes IList Any additional types that this can create beyond the ; this can only be provided if is true.
extension string File extension that this format uses in the form of ".ext".
extensions IList File extensions that this format uses in the form of new string[] { ".ext", ".ext2" }
리턴 System

Create() 공개 메소드

Create a new Asset of the PrimaryType.
public Create ( AssetManager manager, Type resourceType ) : Asset
manager AssetManager
resourceType System.Type
리턴 Asset

Load() 공개 메소드

Load an Asset. This should have previously matched using LoadMatch.
public Load ( AssetLoader loader ) : Asset
loader AssetLoader
리턴 Asset

LoadAsset() 공개 정적인 메소드

Load an Asset.
public static LoadAsset ( AssetLoader loader, IEnumerable formats, ResolveLoadConflictCallback resolveConflict = null ) : Asset
loader AssetLoader
formats IEnumerable
resolveConflict ResolveLoadConflictCallback
리턴 Asset

LoadAssetAsync() 공개 정적인 메소드

Load an Asset.
public static LoadAssetAsync ( AssetLoader loader, IEnumerable formats, ResolveLoadConflictCallback resolveConflict = null, AssetLoaderProgressCallback progress = null, System.TimeSpan progressUpdateRate = null ) : Task
loader AssetLoader
formats IEnumerable
resolveConflict ResolveLoadConflictCallback
progress AssetLoaderProgressCallback
progressUpdateRate System.TimeSpan
리턴 Task

LoadMatch() 공개 메소드

Attempt to match this AssetFormat against the loader.
public LoadMatch ( AssetLoader loader ) : LoadMatchStrength
loader AssetLoader
리턴 LoadMatchStrength

LoadMatchAsset() 공개 정적인 메소드

Find the best AssetFormat for loading an Asset.
public static LoadMatchAsset ( LoadMatchStrength &matchStrength, AssetLoader loader, IEnumerable formats, ResolveLoadConflictCallback resolveConflict = null ) : AssetFormat
matchStrength LoadMatchStrength
loader AssetLoader
formats IEnumerable
resolveConflict ResolveLoadConflictCallback
리턴 AssetFormat

LoadMatchMagic() 보호된 메소드

Perform a quick match based on a magic Int32 value.
protected LoadMatchMagic ( AssetLoader loader, int magic, int minimumLength = 4 ) : LoadMatchStrength
loader AssetLoader
magic int
minimumLength int
리턴 LoadMatchStrength

LoadMatchMagic() 보호된 메소드

Perform a quick match based on a magic string and a minimum length.
protected LoadMatchMagic ( AssetLoader loader, string magic, int minimumLength ) : LoadMatchStrength
loader AssetLoader
magic string
minimumLength int
리턴 LoadMatchStrength

MatchStrengthToString() 공개 정적인 메소드

Get a string describing a match strength, which handles values in between like "Perfect-2" or "Strong+3".
public static MatchStrengthToString ( LoadMatchStrength value ) : string
value LoadMatchStrength
리턴 string

Save() 공개 메소드

Save the asset to the file.
public Save ( Asset asset, BinaryWriter writer, FileManager fileManager ) : void
asset Asset
writer System.IO.BinaryWriter
fileManager FileManager The that might be necessary to save additional files. This can be null if it can't be supported.
리턴 void

SaveCheck() 공개 메소드

Check whether the Asset can be saved with this AssetFormat.
public SaveCheck ( Asset resource ) : SaveCheckResult
resource Asset
리턴 SaveCheckResult