engine.id_parser documentation - wladekpal/The-Lazy-Snek GitHub Wiki

class EntityKind(enum.Enum)

Enum class representing all kinds of entities possible to appear on board in level representation file. Possible kinds are:

  • UNKNOWN - indicates that given paramether of some methods is invalid
  • BLOCK - block (flat or convex) that can be places on default engine.field.Field object
  • FIELD - custom field having different behaviour that default engine.field.Field object, on which any blocks can't be placed in level representation

get_entity_kind(id)

Returns EntityKind enum value which is kind of entity represented by given id in level representation. Especially, when given id doesn't exist, returns UNKNOWN

get_block_from_id(id)

Returns engine.blocks.Block object corresponding to given id in file representation. If given id doesn't represent any block, raises EntityDifferentingKindError.

get_field_from_id(id)

Returns field object corresponding to given id in file representation. If given id doesn't represent any field, raises EntityDifferentingKindError.