New source found from dndbeyond.com
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { serviceDataActions } from '../actions';
|
||||
import { CampaignAccessors, CampaignUtils } from '../engine/Campaign';
|
||||
import { PartyInventorySharingStateEnum } from '../engine/Campaign/constants';
|
||||
import { serviceDataSelectors } from '../selectors';
|
||||
import { MessageManager } from './MessageManager';
|
||||
export class PartyManager extends MessageManager {
|
||||
@@ -28,11 +27,6 @@ export class PartyManager extends MessageManager {
|
||||
};
|
||||
};
|
||||
// Accessors
|
||||
this.getSharingState = () => {
|
||||
var _a;
|
||||
const partyInfo = serviceDataSelectors.getPartyInfo(this.state);
|
||||
return (_a = (partyInfo && CampaignAccessors.getSharingState(partyInfo))) !== null && _a !== void 0 ? _a : PartyInventorySharingStateEnum.OFF; // if we get null return off
|
||||
};
|
||||
this.getPartyId = () => {
|
||||
const partyInfo = serviceDataSelectors.getPartyInfo(this.state);
|
||||
return partyInfo ? CampaignAccessors.getId(partyInfo) : null;
|
||||
@@ -44,11 +38,6 @@ export class PartyManager extends MessageManager {
|
||||
}
|
||||
return '';
|
||||
};
|
||||
// Validators
|
||||
this.isSharingTurnedOn = () => this.getSharingState() === PartyInventorySharingStateEnum.ON;
|
||||
this.isSharingTurnedOff = () => this.getSharingState() === PartyInventorySharingStateEnum.OFF;
|
||||
this.isSharingTurnedDeleteOnly = () => this.getSharingState() === PartyInventorySharingStateEnum.DELETE_ONLY;
|
||||
this.isSharingTurnedOnOrDeleteOnly = () => CampaignUtils.isSharingStateActive(this.getSharingState());
|
||||
this.addSubscriptions({
|
||||
[this.EVENT_TYPES.ITEM_SHARED_FULFILLED]: this.updateSharedInventory,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user