private static bool Matches(IJunctionState junctionState, AddressType addressType, int addressNr) { var @switchState = junctionState as ISwitchState; if (@switchState != null) { var addr = @switchState.Address; return((addr.Type == addressType) && (addr.ValueAsInt == addressNr)); } return(false); }
/// <summary> /// Gets advanced info for the given junction /// </summary> internal bool TryGetJunction(IJunctionState junctionState, bool requestControl, out Switch @switch) { if (!switchManager.TryGetJunction(junctionState, out @switch)) { return(false); } if (requestControl && [email protected]) { @switch.RequestControl(); } return(true); }
/// <summary> /// Gets advanced info for the given junction /// </summary> internal bool TryGetJunction(IJunctionState junctionState, out Switch @switch) { return(junctionIds.TryGetValue(junctionState, out @switch)); }
/// <summary> /// Does this route contains the given junction /// </summary> public bool Contains(IJunctionState junctionState) { return(crossingJunctions.Any(x => x.Contains(junctionState))); }
/// <summary> /// Does this route contains the given junction /// </summary> public override bool Contains(IJunctionState junctionState) { return(junction == junctionState); }
/// <summary> /// Does this route contains the given junction /// </summary> public abstract bool Contains(IJunctionState junctionState);
/// <summary> /// Add a junction to the list of junctions controlled by this command station. /// </summary> internal void AddJunction(IJunctionState junction) { junctions.Add(junction); AddInitializationObject(junction as IInitializeAtPowerOn); }