コード例 #1
0
        public ChargeableItem(ChargeableItemBuilder builder, ItemConfiguration config) : base(builder.Kind())
        {
            _builder      = builder;
            Configuration = config;
            _chargeModels = new Dictionary <int, ItemConfiguration>();
            ItemPower     = new Power(UpdateModel);

            if (HasToolComponent(Configuration.Components))
            {
                var component = Configuration.Components.Select <ChargeableComponent>().First();

                ItemPower       = Power.GetTilePowerFromBlob(component.GetBlob(), UpdateModel);
                DescriptionCode = component.DescriptionCode;
                var chargeModels = component.ChargeModels;
                var configs      = GameContext.ItemDatabase.GetConfigsByKind(_builder.Kind()).ToList();
                foreach (var model in chargeModels)
                {
                    if (configs.Any(x => x.Value.Code == model.Value))
                    {
                        _chargeModels.Add(model.Key, configs.First(x => x.Value.Code == model.Value).Value);
                    }
                }
            }
        }
コード例 #2
0
 public CableDrillItem(ChargeableItemBuilder builder, ItemConfiguration config) : base(builder, config)
 {
 }
コード例 #3
0
 public CapacitorItem(ChargeableItemBuilder builder, ItemConfiguration config) : base(builder, config)
 {
 }