Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an empty statistic bundle implementation #196

Open
wants to merge 1 commit into
base: 1.18
Choose a base branch
from

Conversation

haykam821
Copy link
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
Copy link
Member

Gegy commented Jan 8, 2022

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
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