Skip to content

Add an empty statistic bundle implementation#196

Open
haykam821 wants to merge 1 commit into
NucleoidMC:1.18from
haykam821:empty-statistic-bundle
Open

Add an empty statistic bundle implementation#196
haykam821 wants to merge 1 commit into
NucleoidMC:1.18from
haykam821:empty-statistic-bundle

Conversation

@haykam821

Copy link
Copy Markdown
Contributor

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 haykam821 added the feature New feature or request label Jan 6, 2022
@haykam821 haykam821 requested a review from Gegy January 6, 2022 22:53
@Gegy

Gegy commented Jan 8, 2022

Copy link
Copy Markdown
Member

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.

@ashhhleyyy

Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants