Physical Architecture

Entities
Entities are physical objects.

An entity is always located in a container, except for the root entity.

Containers
Some entities may have containers.

A container can contain entities.

There are some subtypes of Container, that handle contained items differently:

SpaceContainer
The SpaceContainer defines a three dimensional space, and keeps track of the positions of the contained entities inside that space.

It can simulate physics and collisions of the contained entities.

The space may have portals, that lead to other containers or an outside container.

Entities may also have portals, that lead to containers in them.

ListContainer
A list container is used when the spatial location and movement of contained entities is not important, for example for inventories, storages, or item-processing machines.

A ListContainer can keep the contained entities in a FIFO (first in first out) or LIFO (last in first out) sequence (or possibly sorted according to some other criteria), and provides addEntity and getNextEntity methods. The ListContainer may have some maximum capacity in terms of volume and mass, and may have some maximum lenght, volume or mass restrictions for individual items, and may also have custom filters for what kind of items it accepts.

Environments
A Container provides an Environment for each of the Entities it contains.

The Environment provides the Entity with current environmental conditions, such as consistency of the surrounding fluid or matter, and its temperature, flow, and density/pressure (the environment is sampled and averaged for a sphere that is approximating the size of the entity). This enables simulation of things like buoyancy and drifting with the wind.

The Environment also allows the Entity to access other nearby entities.