Esempio n. 1
0
 public void AttemptedWireSlotting(WireBehaviour wire, PanelSystem panel)
 {
     if (panel.CurrentDamageState == DamageState.Malfunction)
     {
         if (panel.CanSlotWire(wire))
         {
             panel.SlotWire(wire);
         }
     }
 }
Esempio n. 2
0
    public void SlotWire(WireBehaviour wire)
    {
        var slot = GetFittingSlot(wire);

        slot.occupied = true;
        RegenerateSingleWireVisuals(slot);
        if (IsFullyRepaired())
        {
            ChangeDamageState(DamageState.Operational);
        }
        Destroy(wire.gameObject);
    }
Esempio n. 3
0
 private WireSlot GetFittingSlot(WireBehaviour wire) => wireSlots
 .Where(slot => !slot.occupied)
 .FirstOrDefault(slot => slot.wire == wire.wireType);
Esempio n. 4
0
    public bool CanSlotWire(WireBehaviour wire)
    {
        var fittingSlot = GetFittingSlot(wire);

        return(fittingSlot != null);
    }