world

class fireform.world.world

World used to control game events and ticks. Holds a list of entities.

add_entities(entities)

Add multiple entities to the world.

Parameters:
entities: iterable

An iterable that produces entity objects.

add_entity(entity)

Add a single entity to the world.

Parameters:
entity: fireform.entity.entity

The entity to add to the world.

add_system(system)

Add a system to the world

destroy_all_entities()

Kills all entities in the world. This thing is merciless.

handle_message(message)

Used internally.

handle_message_private(message, entities)

Used internally.

post_message(message)

Sends a message to all systems and entities in the world that are listening for it.

Parameters:
message: fireform.message.base

The message to send.

post_message_private(message, entities)

Sends a message to a few entities and anything that is observing those entities. Also sends the message to the systems.

Parameters:
message: fireform.message.base

The message to send.

refresh_entities()

Remove all dead entities from the entity list, and sort the living ones by ordering.

Any entities added or destroyed will invalidate the list. You can call this to clean it up (but it is somewhat expensive).