You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the fixed dice are stored with a singleton pattern, namely the class itself (see code below). If fixed dice are used with multiple game objects at the same time there is a risk that a fixed dice for one game is consumed by another game. That behavior will not crash the execution and but can lead to very subtle bugs.
I propose we move information about the stored fixed rolls to the game object itself. I'm happy to write the PR if you agree.
classBBDie(Die, Immutable):
value: BBDieResultFixedRolls= []
@staticmethoddeffix(value):
iftype(value) ==BBDieResult:
BBDie.FixedRolls.append(value)
else:
raiseValueError("Fixed result of BBDie must be a BBDieResult")
The text was updated successfully, but these errors were encountered:
Currently the fixed dice are stored with a singleton pattern, namely the class itself (see code below). If fixed dice are used with multiple game objects at the same time there is a risk that a fixed dice for one game is consumed by another game. That behavior will not crash the execution and but can lead to very subtle bugs.
I propose we move information about the stored fixed rolls to the game object itself. I'm happy to write the PR if you agree.
The text was updated successfully, but these errors were encountered: