BaseTypes

BaseTypes

The BaseTypes class defines the base types used in Lance. These are the types which can be used to define an object's netscheme attributes, which can be serialized by lance.

Constructor

new BaseTypes()

Source:
Example
static get netScheme() {
      return {
            strength: { type: BaseTypes.TYPES.FLOAT32 },
            shield: { type: BaseTypes.TYPES.INT8 },
            name: { type: BaseTypes.TYPES.STRING },
            backpack: { type: BaseTypes.TYPES.CLASSINSTANCE },
            coins: {
                type: BaseTypes.TYPES.LIST,
                itemType: BaseTypes.TYPES.UINT8
            }
        };
    }

Members

(static) TYPES :object

Properties:
Name Type Description
FLOAT32 string

Seriablizable float

INT32 string

Seriablizable 32-bit integer

INT16 string

Seriablizable 16-bit integer

INT8 string

Seriablizable 8-bit integer

UINT8 string

Seriablizable unsigned 8-bit integer

STRING string

Seriablizable string

CLASSINSTANCE string

Seriablizable class. Make sure you register all the classes included in this way.

LIST string

Seriablizable list. In the netScheme definition, if an attribute is defined as a list, the itemType should also be defined.

Source: