rvandoosselaer / Blocks

A block (voxel) engine for jMonkeyEngine
BSD 3-Clause "New" or "Revised" License
41 stars 14 forks source link

Return immutable collections in the registries #34

Closed rvandoosselaer closed 4 years ago

rvandoosselaer commented 4 years ago

The registries (BlockRegistry, TypeRegistry, ShapeRegistry) have methods to return the full registry: BlockRegistry#getAll(), TypeRegistry#getAll(), ShapeRegistry#getAll().

For now they just return the keyset of the backing map. This should be changed so a read-only view of the keyset is returned to avoid (unwanted) tampering with the set.