Exemple #1
0
 private void Connector_WireCut(object sender, WireCutEventArgs e)
 {
     if (!this.shouldCut[e.WireIndex])
     {
         this.Log("Wire {0} on panel {1} was incorrectly cut.", e.WireIndex % 3 + 1, e.WireIndex / 3 + 1);
         this.Connector.KMBombModule.HandleStrike();
     }
 }
Exemple #2
0
    private void Connector_WireCut(object sender, WireCutEventArgs e)
    {
        var space     = this.Connector.WireSpaces[e.WireIndex];
        var wireIndex = this.activeSpaceIndices.IndexOf(e.WireIndex) + 1;

        if (this.shouldCut[e.WireIndex])
        {
            this.Log("Wire {0} was cut. That was correct.", wireIndex);
            if (Enumerable.Range(0, 6).All(i => !this.shouldCut[i] || this.Connector.WireSpaces[i].Cut))
            {
                this.Connector.KMBombModule.HandlePass();
            }
        }
        else
        {
            this.Log("Wire {0} was cut. That was incorrect: {1} (symbol) {2} {3} (light) is false",
                     wireIndex, space.HasSymbol, this.GetOperation(space.Colours), space.LightOn);
            this.Connector.KMBombModule.HandleStrike();
            // Yes, you can still strike after disarming the module. Complicated Wires also does this.
        }
    }
 private void Connector_WireCut(object sender, WireCutEventArgs e)
 {
     for (int i = 0; i < this.orderToCut.Length; ++i)
     {
         if (this.orderToCut[i] == e.WireIndex)
         {
             break;
         }
         else
         {
             // Make sure all wires that come before this one in the correct order are cut.
             if (!this.Connector.Wires[this.orderToCut[i]].Cut)
             {
                 this.Log("Wire {0} was cut when the next wire should have been wire {1}.", e.WireIndex + 1, this.orderToCut[i] + 1);
                 this.Connector.KMBombModule.HandleStrike();
                 break;
             }
         }
     }
     if (this.Connector.Wires.All(w => w.Cut))
     {
         this.Disarm();
     }
 }