A reference from a bin object to another bin file. The object has no data of its
own. It names one file, and the client loads that file when the owner of the loadable
needs it and unloads it when the owner is done.
Classes use it to keep data out of the bin that is always loaded: a spell links one
for its effects, a view controller links one for its UI scenes, and the classes
under BinFileContainer are themselves the loadable of
their own file.
Load and unload. The client has one table of loaded bin files, keyed by the hash
of the file path. Each entry has a use count.
- Load: if the file is in the table, the client adds one use. Otherwise it opens
the file, reads it and adds it to the table with one use. The objects of the file
can then be found by their path hashes, so links to them resolve.
- Unload: the client removes one use. When no use is left, it removes the file
from the table and destroys its objects.
- A loadable holds at most one use. A second load of a loadable that is loaded does
nothing, and a loadable that is destroyed while loaded unloads first.
- Two loadables that name the same file share one copy of it.
Child classes:
Examples: - The spell
Maps/ModeSpecificData/RUBY/Ruby_Singed_Q links the loadable Maps/ModeSpecificData/RUBY/Ruby_Singed_Q/Loadable. Its file holds the particle systems and the resource resolver of the spell.