コード例 #1
0
        public override Task OnActivateAsync()
        {
            SlotAreas.Add(new CraftingSlotArea(3, this, GrainFactory));
            SlotAreas.Add(new InventorySlotArea(this, GrainFactory));
            SlotAreas.Add(new HotbarSlotArea(this, GrainFactory));

            return(base.OnActivateAsync());
        }
コード例 #2
0
        public Task SetEntity(IBlockEntity furnaceEntity)
        {
            SlotAreas.Clear();
            _properties.Clear();

            SlotAreas.Add(new FurnaceSlotArea(furnaceEntity, this, GrainFactory));
            SlotAreas.Add(new InventorySlotArea(this, GrainFactory));
            SlotAreas.Add(new HotbarSlotArea(this, GrainFactory));
            _furnaceEntity = furnaceEntity;
            return(Task.CompletedTask);
        }
コード例 #3
0
        public Task SetEntities(Immutable <IDependencyObject[]> entities)
        {
            SlotAreas.Clear();

            foreach (var entity in entities.Value)
            {
                SlotAreas.Add(new ChestSlotArea(entity, this, GrainFactory));
            }
            SlotAreas.Add(new InventorySlotArea(this, GrainFactory));
            SlotAreas.Add(new HotbarSlotArea(this, GrainFactory));

            if (entities.Value.Length < 2)
            {
                _title = new Chat("Chest");
            }
            else
            {
                _title = new Chat("Large chest");
            }
            return(Task.CompletedTask);
        }