Ejemplo n.º 1
0
        public ViewModelWindowMulchbox(
            IStaticWorldObject worldObjectManufacturer,
            ManufacturingState manufacturingState,
            ManufacturingConfig manufacturingConfig)
            : base(
                worldObjectManufacturer,
                manufacturingState,
                manufacturingConfig,
                null)
        {
            var protoMulchbox = (IProtoObjectMulchbox)worldObjectManufacturer.ProtoStaticWorldObject;

            this.OrganicCapacity = protoMulchbox.OrganicCapacity;

            this.privateState = protoMulchbox.GetMulchboxPrivateState(worldObjectManufacturer);
            this.privateState.ClientSubscribe(
                _ => _.OrganicAmount,
                _ => this.RefreshOrganicAmount(),
                this);

            manufacturingState.ClientSubscribe(
                _ => _.SelectedRecipe,
                _ => this.RefreshRecipe(),
                this);

            this.RefreshOrganicAmount();
            this.RefreshRecipe();
        }
Ejemplo n.º 2
0
        public ViewModelWindowMulchbox(
            IStaticWorldObject worldObjectManufacturer,
            ObjectMulchboxPrivateState privateState,
            ManufacturingConfig manufacturingConfig)
            : base(
                worldObjectManufacturer,
                privateState,
                manufacturingConfig)
        {
            this.protoMulchbox = (IProtoObjectMulchbox)worldObjectManufacturer.ProtoStaticWorldObject;
            this.privateState  = privateState;

            this.privateState.ClientSubscribe(
                _ => _.OrganicAmount,
                _ => this.NotifyPropertyChanged(nameof(this.OrganicAmount)),
                this);
        }