/* * Copyright (c) 2021 RCSB PDB and contributors, licensed under MIT, See LICENSE file for more info. * @author Joan Segura Mora */ import {RcsbFvStateInterface, RcsbFvStateType} from "./RcsbFvStateInterface"; import {RcsbFvSelectorManager} from "./RcsbFvSelectorManager"; import {AssemblyModelSate} from "./AssemblyModelSate"; import {Subject, Subscription} from "rxjs"; import {DataContainer} from "../Utils/DataContainer"; import {OperatorInfo} from "../RcsbFvStructure/StructureViewerInterface"; export class RcsbFvStateManager implements RcsbFvStateInterface { readonly assemblyModelSate: AssemblyModelSate = new AssemblyModelSate(); readonly selectionState: RcsbFvSelectorManager = new RcsbFvSelectorManager(); readonly pfvContext: DataContainer<{entryId:string;asymId?:string;operator?:OperatorInfo;}> = new DataContainer<{entryId: string; asymId?: string; operator?: OperatorInfo}>(); readonly subject: Subject> = new Subject(); next(state: RcsbFvStateType): void { this.subject.next(state); } subscribe(o: (state: RcsbFvStateType) => void): Subscription { return this.subject.subscribe(o); } unsubscribe(): void { this.subject.unsubscribe(); } }