private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Interactive"))
     {
         IChargeable it = other.transform.GetComponent <IChargeable>();
         it?.Charging(Bread);
         Debug.Log("Charge");
     }
 }
Пример #2
0
 private void Recharge()
 {
     foreach (Item item in AttachedContainer.Container.Items)
     {
         IChargeable chargeable = item.GetComponent <IChargeable>();
         if (chargeable != null)
         {
             chargeable.AddCharge(chargeable.GetChargeRate());
         }
     }
 }
Пример #3
0
        private void ManufacturerInitializeComputersFromInput()
        {
            var manufacturerName = Console.ReadLine();

            ManufacturerFactory manufacturerCreator = new ManufacturerFactory();

            ComputersFactory manufacturer = manufacturerCreator.CreateManufacturer(manufacturerName);

            this.pc = manufacturer.CreatePc();
            this.laptop = manufacturer.CreateLaptop();
            this.server = manufacturer.CreateServer();
        }
Пример #4
0
        private void ManufacturerInitializeComputersFromInput()
        {
            var manufacturerName = Console.ReadLine();

            ManufacturerFactory manufacturerCreator = new ManufacturerFactory();

            ComputersFactory manufacturer = manufacturerCreator.CreateManufacturer(manufacturerName);

            this.pc     = manufacturer.CreatePc();
            this.laptop = manufacturer.CreateLaptop();
            this.server = manufacturer.CreateServer();
        }
Пример #5
0
 // Recharges the current cell that is placed on it
 private void Recharge()
 {
     foreach (Item item in containerDescriptor.attachedContainer.Container.Items)
     {
         IChargeable chargeable = item.GetComponent <IChargeable>();
         if (chargeable != null)
         {
             chargeable.AddCharge(chargeable.GetChargeRate());
             UpdateLights(chargeable.GetPowerPercentage());
         }
     }
 }
Пример #6
0
    private void Start()
    {
        Assert.IsNotNull(AttachedContainer);

        AttachedContainer.Container.ContentsChanged += (_, items, type) =>
        {
            // Power cell does not attach to match wires
            // wiresMeshRenderer.enabled = !AttachedContainer.Container.Empty;
            if (AttachedContainer.Container.Empty)
            {
                // Cell Charger is empty
                if (isServer)
                {
                    SyncLightState(BatteryLightState.NO_BATTERY);
                }
            }
            else
            {
                // Cell Charger now has a battery in it, so update the lights based on battery charge.
                // (this prevents the delay between putting a battery in and seeing the lights change)
                if (isServer)
                {
                    foreach (Item item in AttachedContainer.Container.Items)
                    {
                        IChargeable chargeable = item.GetComponent <IChargeable>();
                        if (chargeable != null)
                        {
                            UpdateLights(chargeable.GetPowerPercentage());
                        }
                    }
                }
            }
        };
        if (isServer)
        {
            StartCoroutine(StartCharge());
        }
    }
Пример #7
0
    private void RechargePowerCell(Item item)
    {
        IChargeable chargeable = item.GetComponent <IChargeable>();

        chargeable.AddCharge(chargeable.GetChargeRate());
    }
Пример #8
0
 public void BrancherPortable(IChargeable portable)
 {
     Console.WriteLine("branchement d'un portable");
     this._telephone = portable;
     this._telephone.Recharger(_volts);
 }