C# Класс CSJ2K.j2k.ModuleSpec

This generic class is used to handle values to be used by a module for each tile and component. It uses attribute to determine which value to use. It should be extended by each module needing this feature. This class might be used for values that are only tile specific or component specific but not both.

The attributes to use are defined by a hierarchy. The hierarchy is:

  • Tile and component specific attribute
  • Tile specific default attribute
  • Component main default attribute
  • Main default attribute

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
compDef System.Object[]
def System.Object
nComp int
nTiles int
specType int
specValType byte[][]
tileCompVal System.Object>.System.Collections.Generic.Dictionary
tileDef System.Object[]

Открытые методы

Метод Описание
Clone ( ) : Object
ModuleSpec ( int nt, int nc, byte type ) : System

Constructs a 'ModuleSpec' object, initializing all the components and tiles to the 'SPEC_DEF' spec val type, for the specified number of components and tiles.

getCompDef ( int c ) : Object

Gets default value of the specified component. If no specification have been entered for this component, returns default value.

getDefault ( ) : Object

Gets default value for this module.

getSpecValType ( int t, int c ) : byte

Return the spec type of the given tile-component.

getTileCompVal ( int t, int c ) : Object

Gets value of specified tile-component. This method calls getSpec but has a public access.

getTileDef ( int t ) : Object

Gets default value of the specified tile. If no specification has been entered, it returns the default value.

isCompSpecified ( int c ) : bool

Whether or not specifications have been entered for the given component.

isTileCompSpecified ( int t, int c ) : bool

Whether or not a tile-component specification has been defined

isTileSpecified ( int t ) : bool

Whether or not specifications have been entered for the given tile.

parseIdx ( System word, int maxIdx ) : bool[]

This method is responsible of parsing tile indexes set and component indexes set for an option. Such an argument must follow the following policy:
t<indexes set> or c<indexes set> where tile or component indexes are separated by commas or a dashes.

Example:

  • t0,3,4 means tiles with indexes 0, 3 and 4.
  • t2-4 means tiles with indexes 2,3 and 4.
    It returns a boolean array skteching which tile or component are concerned by the next parameters.

  • rotate90 ( Coord anT ) : void

    Rotate the ModuleSpec instance by 90 degrees (this modifies only tile and tile-component specifications).

    setCompDef ( int c, System value_Renamed ) : void

    Sets default value for specified component and specValType tag if allowed by its priority.

    setDefault ( System value_Renamed ) : void

    Sets default value for this module

    setTileCompVal ( int t, int c, System value_Renamed ) : void

    Sets value for specified tile-component.

    setTileDef ( int t, System value_Renamed ) : void

    Sets default value for specified tile and specValType tag if allowed by its priority.

    Защищенные методы

    Метод Описание
    getSpec ( int t, int c ) : Object

    Gets value of specified tile-component without knowing if a specific tile-component value has been previously entered. It first check if a tile-component specific value has been entered, then if a tile specific value exist, then if a component specific value exist. If not the default value is returned.

    Описание методов

    Clone() публичный Метод

    public Clone ( ) : Object
    Результат System.Object

    ModuleSpec() публичный Метод

    Constructs a 'ModuleSpec' object, initializing all the components and tiles to the 'SPEC_DEF' spec val type, for the specified number of components and tiles.
    public ModuleSpec ( int nt, int nc, byte type ) : System
    nt int The number of tiles /// ///
    nc int The number of components /// ///
    type byte the type of the specification module i.e. tile specific, /// component specific or both. /// ///
    Результат System

    getCompDef() публичный Метод

    Gets default value of the specified component. If no specification have been entered for this component, returns default value.
    public getCompDef ( int c ) : Object
    c int Component index /// ///
    Результат System.Object

    getDefault() публичный Метод

    Gets default value for this module.
    public getDefault ( ) : Object
    Результат System.Object

    getSpec() защищенный Метод

    Gets value of specified tile-component without knowing if a specific tile-component value has been previously entered. It first check if a tile-component specific value has been entered, then if a tile specific value exist, then if a component specific value exist. If not the default value is returned.
    protected getSpec ( int t, int c ) : Object
    t int Tile index /// ///
    c int Component index /// ///
    Результат System.Object

    getSpecValType() публичный Метод

    Return the spec type of the given tile-component.
    public getSpecValType ( int t, int c ) : byte
    t int Tile index /// ///
    c int Component index /// ///
    Результат byte

    getTileCompVal() публичный Метод

    Gets value of specified tile-component. This method calls getSpec but has a public access.
    public getTileCompVal ( int t, int c ) : Object
    t int Tile index /// ///
    c int Component index /// ///
    Результат System.Object

    getTileDef() публичный Метод

    Gets default value of the specified tile. If no specification has been entered, it returns the default value.
    public getTileDef ( int t ) : Object
    t int Tile index /// ///
    Результат System.Object

    isCompSpecified() публичный Метод

    Whether or not specifications have been entered for the given component.
    public isCompSpecified ( int c ) : bool
    c int Index of the component /// ///
    Результат bool

    isTileCompSpecified() публичный Метод

    Whether or not a tile-component specification has been defined
    public isTileCompSpecified ( int t, int c ) : bool
    t int Tile index /// ///
    c int Component index /// ///
    Результат bool

    isTileSpecified() публичный Метод

    Whether or not specifications have been entered for the given tile.
    public isTileSpecified ( int t ) : bool
    t int Index of the tile /// ///
    Результат bool

    parseIdx() публичный статический Метод

    This method is responsible of parsing tile indexes set and component indexes set for an option. Such an argument must follow the following policy:
    t<indexes set> or c<indexes set> where tile or component indexes are separated by commas or a dashes.

    Example:

  • t0,3,4 means tiles with indexes 0, 3 and 4.
  • t2-4 means tiles with indexes 2,3 and 4.
    It returns a boolean array skteching which tile or component are concerned by the next parameters.
  • public static parseIdx ( System word, int maxIdx ) : bool[]
    word System The word to parse. /// ///
    maxIdx int Maximum authorized index /// ///
    Результат bool[]

    rotate90() публичный Метод

    Rotate the ModuleSpec instance by 90 degrees (this modifies only tile and tile-component specifications).
    public rotate90 ( Coord anT ) : void
    anT Coord
    Результат void

    setCompDef() публичный Метод

    Sets default value for specified component and specValType tag if allowed by its priority.
    public setCompDef ( int c, System value_Renamed ) : void
    c int Component index /// ///
    value_Renamed System
    Результат void

    setDefault() публичный Метод

    Sets default value for this module
    public setDefault ( System value_Renamed ) : void
    value_Renamed System
    Результат void

    setTileCompVal() публичный Метод

    Sets value for specified tile-component.
    public setTileCompVal ( int t, int c, System value_Renamed ) : void
    t int Tie index /// ///
    c int Component index /// ///
    value_Renamed System
    Результат void

    setTileDef() публичный Метод

    Sets default value for specified tile and specValType tag if allowed by its priority.
    public setTileDef ( int t, System value_Renamed ) : void
    t int
    value_Renamed System
    Результат void

    Описание свойств

    compDef защищенное свойство

    The default value for each component. Null if no component specific value is defined
    protected Object[],System compDef
    Результат System.Object[]

    def защищенное свойство

    Default value for each tile-component
    protected Object,System def
    Результат System.Object

    nComp защищенное свойство

    The number of components
    protected int nComp
    Результат int

    nTiles защищенное свойство

    The number of tiles
    protected int nTiles
    Результат int

    specType защищенное свойство

    The type of the specification module
    protected int specType
    Результат int

    specValType защищенное свойство

    The spec type for each tile-component. The first index is the tile index, the second is the component index.
    protected byte[][] specValType
    Результат byte[][]

    tileCompVal защищенное свойство

    The specific value for each tile-component. Value of tile 16 component 3 is accessible through the hash value "t16c3". Null if no tile-component specific value is defined
    protected System.Collections.Generic.Dictionary tileCompVal
    Результат System.Object>.System.Collections.Generic.Dictionary

    tileDef защищенное свойство

    The default value for each tile. Null if no tile specific value is defined
    protected Object[],System tileDef
    Результат System.Object[]