Gorgon
Show / Hide Table of Contents

Class GorgonSpriteCodecPlugIn

A plug in for allowing users to supply their own 3rd party sprite codecs.

Inheritance
object
GorgonPlugIn
GorgonSpriteCodecPlugIn
Implements
IGorgonNamedObject
Inherited Members
GorgonPlugIn.Name
GorgonPlugIn.Assembly
GorgonPlugIn.PlugInPath
GorgonPlugIn.Description
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.IO
Assembly: Gorgon.IO.Gorgon2D.dll
Syntax
public abstract class GorgonSpriteCodecPlugIn : GorgonPlugIn, IGorgonNamedObject

Constructors

| Edit this page View Source

GorgonSpriteCodecPlugIn(string)

Initializes a new instance of the GorgonSpriteCodecPlugIn class.

Declaration
protected GorgonSpriteCodecPlugIn(string description)
Parameters
Type Name Description
string description

Optional description of the plugin.

Remarks

Objects that implement this base class should pass in a hard coded description on the base constructor.

Properties

| Edit this page View Source

Codecs

Property to return the names of the available codecs for this plug in.

Declaration
public abstract IReadOnlyList<GorgonSpriteCodecDescription> Codecs { get; }
Property Value
Type Description
IReadOnlyList<GorgonSpriteCodecDescription>
Remarks

This returns a IReadOnlyDictionary<TKey, TValue> containing the name of the plug in as its key, and an optional friendly description as its value.

Methods

| Edit this page View Source

CreateCodec(string, Gorgon2D)

Function to create a new image codec object.

Declaration
public IGorgonSpriteCodec CreateCodec(string codec, Gorgon2D renderer)
Parameters
Type Name Description
string codec

The name of the codec to look up within the plug in.

Gorgon2D renderer

The renderer used to retrieve sprite textures.

Returns
Type Description
IGorgonSpriteCodec

A new instance of a IGorgonSpriteCodec.

Remarks

If the codec is not found within the plug in, then an exception will be thrown. To determine whether the plug in has the desired codec, check the Codecs property on the plug in to locate the plug in name.

Exceptions
Type Condition
ArgumentNullException

Thrown when the codec, or the renderer parameter is null.

ArgumentEmptyException

Thrown when the codec parameter is empty.

KeyNotFoundException

Thrown when the codec was not found in this plug in.

| Edit this page View Source

OnCreateCodec(string, Gorgon2D)

Function to create a new IGorgonSpriteCodec.

Declaration
protected abstract IGorgonSpriteCodec OnCreateCodec(string codec, Gorgon2D renderer)
Parameters
Type Name Description
string codec

The codec to retrieve from the plug in.

Gorgon2D renderer

The renderer used to retrieve sprite textures.

Returns
Type Description
IGorgonSpriteCodec

A new IGorgonSpriteCodec object.

Remarks

Implementors must implement this method to return the codec from the plug in assembly.

Implements

IGorgonNamedObject

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author