plasmid icon indicating copy to clipboard operation
plasmid copied to clipboard

Add an empty statistic bundle implementation

Open haykam821 opened this issue 4 years ago • 2 comments

Empty statistic bundles can be used to safely handle a game configuration that does not specify a bundle namespace without null-checking each time the statistics bundle is accessed. This can be accomplished through the added bundleOrEmpty method.

haykam821 avatar Jan 06 '22 22:01 haykam821

It seems odd to handle a lookup on null like this inside Plasmid code- does it not make more sense for the user to null-check? A null bundle namespace doesn't really "mean" anything to Plasmid.

Gegy avatar Jan 08 '22 10:01 Gegy

The idea behind this (discussed on Discord here) is to make it easier on the user-side code by avoiding having null-checks everywhere that the statistics are used, and move it to a single common place in plasmid code.

ashhhleyyy avatar Jan 08 '22 11:01 ashhhleyyy