Class Party
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
Must be partial � the OneJS [EventfulProperty] source generator only processes partial classes. This allows useEventfulState(party, 'Gold') in TSX components for reactive currency display.
public class Party
- Inheritance
-
objectParty
Fields
Properties
- AchievementPoints
Reactive view of
_achievementPoints; raisesOnAchievementPointsChangedwhen the value actually changes.
- CursedCoins
Reactive view of
_cursedCoins; raisesOnCursedCoinsChangedwhen the value actually changes.
- Gems
Reactive view of
_gems; raisesOnGemsChangedwhen the value actually changes.
- Gold
Reactive view of
_gold; raisesOnGoldChangedwhen the value actually changes.
- GoldPickupRefusedVersion
Reactive view of
_goldPickupRefusedVersion; raisesOnGoldPickupRefusedVersionChangedwhen the value actually changes.
- InscribedNodesVersion
Reactive view of
_inscribedNodesVersion; raisesOnInscribedNodesVersionChangedwhen the value actually changes.
- SelectedHero
The hero the player currently controls, or null when there is none.
Answers null for a destroyed hero on purpose: Unity's fake-null does not survive the OneJS bridge, so a destroyed hero is truthy in JS and
hero.gameObjectthrows inside the UI. That throw was uncaught, so React 19 unmounted the whole tree and the session was left with no UI at all. Returning null makes the UI's own null checks -hero?.gameObject?.name- do their job.Every write goes through here, which is what makes OnSelectedHeroChanged the whole story:
Party.SelectHerois the only intended caller, but HeroNetworkBehaviour and the UI screens assign the property directly, and all of those paths have to announce themselves.
- Souls
Reactive view of
_souls; raisesOnSoulsChangedwhen the value actually changes.
Methods
Events
- OnSelectedHeroChanged
Raised when SelectedHero becomes a different hero (or none), so "the player switched hero" can be an event instead of a question the UI has to ask on a timer. Bind it with
useEventSync(party, 'SelectedHero', [party]), which subscribesadd_OnSelectedHeroChangedand re-reads the property - the same shape as the generatedOnGoldChangedon this class.Written by hand rather than with
[EventfulProperty]on the field: that generator emitsget => _selectedHero, and this property is deliberately not a plain field read (see below).