KMBombInfoExtensions - Qkrisi/ktanemodkit GitHub Wiki

KMBombInfoExtensions

Namespace: KModkit

public static class KMBombInfoExtensions

Provides extensions for KMBombInfo.


public static string WidgetQueryTwofactor;

The query key of the Two Factor widget


public static string WidgetTwofactorKey;

The key in the dictionary returned by Two Factor indicating the current code.


public static bool IsIndicatorPresent(this KMBombInfo bombInfo, Indicator indicatorLabel)
public static bool IsIndicatorPresent(this KMBombInfo bombInfo, string indicatorLabel)

Returns true if an indicator with the specified label is present on the bomb, otherwise false.


public static bool IsIndicatorColored(this KMBombInfo bombInfo, Indicator indicatorLabel, string indicatorColor)
public static bool IsIndicatorColored(this KMBombInfo bombInfo, string indicatorLabel, string indicatorColor)

Returns true if the indicator with the specified label is colored as the specified color, otherwise false.


public static bool IsIndicatorColorPresent(this KMBombInfo bombInfo, string indicatorColor)

Returns true if any indicator with the specified color is present, otherwise false.


public static bool IsIndicatorOn(this KMBombInfo bombInfo, Indicator indicatorLabel)
public static bool IsIndicatorOn(this KMBombInfo bombInfo, string indicatorLabel)

Returns true if there's an lit indicator on the bomb with the specified label, otherwise false.


public static bool IsIndicatorOff(this KMBombInfo bombInfo, Indicator indicatorLabel)
public static bool IsIndicatorOff(this KMBombInfo bombInfo, string indicatorLabel)

Returns true if there's an unlit indicator on the bomb with the specified label, otherwise false.


public static IEnumerable<string> GetIndicators(this KMBombInfo bombInfo)

Returns the labels of all indicators on the bomb.


public static IEnumerable<string> GetOnIndicators(this KMBombInfo bombInfo)

Returns the labels of all lit indicators on the bomb.


public static IEnumerable<string> GetOffIndicators(this KMBombInfo bombInfo)

Returns the labels of all unlit indicators on the bomb.


public static IEnumerable<string> GetColoredIndicators(this KMBombInfo bombInfo, Indicator label)

Returns the colors of all colored indicators with the specified label.


public static IEnumerable<string> GetColoredIndicators(this KMBombInfo bombInfo, IndicatorColor color)

Returns the labels of all colored indicators with the specified color.


public static IEnumerable<string> GetColoredIndicators(this KMBombInfo bombInfo, string color = null, string label = null)

Returns:

The labels of all colored indicators with the specified color if color isn't null.

Otherwise, the colors of all colored indicators with the specified label if label isn'6 null.

Otherwise, an empty list.


public static int GetBatteryCount(this KMBombInfo bombInfo)
public static int GetBatteryCount(this KMBombInfo bombInfo, Battery batteryType)
public static int GetBatteryCount(this KMBombInfo bombInfo, int batteryType)

Returns the number of batteries on the bomb with the specified battery type (or all).


public static int GetBatteryHolderCount(this KMBombInfo bombInfo)
public static int GetBatteryHolderCount(this KMBombInfo bombInfo, Battery batteryType)
public static int GetBatteryHolderCount(this KMBombInfo bombInfo, int batteryType)

Returns the number of battery holders on the bomb holding the specified battery type (or all).


public static int GetPortCount(this KMBombInfo bombInfo)
public static int GetPortCount(this KMBombInfo bombInfo, Port portType)
public static int GetPortCount(this KMBombInfo bombInfo, string portType)

Returns the number of ports on the bomb with the specified port type (or all).


public static int GetPortPlateCount(this KMBombInfo bombInfo)

Returns the number of port plates on the bomb.


public static IEnumerable<string> GetPorts(this KMBombInfo bombInfo)

Returns the name of the ports on the bomb.


public static IEnumerable<string[]> GetPortPlates(this KMBombInfo bombInfo)

Returns a list of arrays, where each array represents a port plate, and each array has the name of the ports on the plate represented by itself.


public static bool IsPortPresent(this KMBombInfo bombInfo, Port portType)
public static bool IsPortPresent(this KMBombInfo bombInfo, string portType)

Returns true if the specified port type is present on the bomb, otherwise false.


public static int CountUniquePorts(this KMBombInfo bombInfo)

Returns the number of unique ports on the bomb.


public static bool IsDuplicatePortPresent(this KMBombInfo bombInfo)
public static bool IsDuplicatePortPresent(this KMBombInfo bombInfo, Port port)
public static bool IsDuplicatePortPresent(this KMBombInfo bombInfo, string port)

Returns true if there are any duplicate ports on the bomb (of the specified port type, if specified), otherwise false.


public static int CountDuplicatePorts(this KMBombInfo bombInfo)

Returns the number of duplicate ports on the bomb.


public static string GetSerialNumber(this KMBombInfo bombInfo)

Returns the serial number of the bomb.


public static IEnumerable<char> GetSerialNumberLetters(this KMBombInfo bombInfo)

Returns the letter characters in the serial number.


public static IEnumerable<int> GetSerialNumberNumbers(this KMBombInfo bombInfo)

Returns the digits in the serial number.


public static bool IsTwoFactorPresent(this KMBombInfo bombInfo)

Returns true, if a Two Factor is present on the bomb, otherwise false.


public static int GetTwoFactorCounts(this KMBombInfo bombInfo)

Returns the number of Two Factors on the bomb.


public static IEnumerable<int> GetTwoFactorCodes(this KMBombInfo bombInfo)

Returns the current codes on all Two Factors on the bomb.

Enumerations

These types are outside of the KMBombInfoExtensions class, but are used by it.


public enum Battery

Represents the battery widget.

Values: Unknown (0), Empty (0), D (1), AA (2), AAx3 (3), AAx4 (4)


public enum Port

Represents a port on the bomb.

Values: DVI, Parallel, PS2, RJ45, Serial, StereoRCA, ComponentVideo, CompositeVideo, USB, HDMI, VGA, AC, PCMIA


public enum Indicator

Holds indicator labels.

Vaules: SND, CLR, CAR, IND, FRQ, SIG, NSA, MSA, TRN, BOB, FRK, NLL


public enum IndicatorColor

Holds indicator colors.

Values: Black, White, Blue, Gray, Green, Magenta, Orange, Purple, Ṙed, Yellow

⚠️ **GitHub.com Fallback** ⚠️