/// <summary> /// Gets the preferred command station (state) for the given address type. /// </summary> private ICommandStationState GetPreferredCommandStationState(AddressType addressType) { ICommandStation entity = null; switch (addressType) { case AddressType.Dcc: entity = Entity.PreferredDccCommandStation; break; case AddressType.LocoNet: entity = Entity.PreferredLocoNetCommandStation; break; case AddressType.Motorola: entity = Entity.PreferredMotorolaCommandStation; break; case AddressType.Mfx: entity = Entity.PreferredMfxCommandStation; break; case AddressType.BinkyNet: entity = Entity.PreferredBinkyNetCommandStation; break; default: throw new ArgumentException("Unknown address type: " + addressType); } if ((entity == null) || (!commandStationStates.Contains(entity))) { return(null); } return(CommandStationStates[entity]); }
public override object Visit(ICommandStation entity, IRailway data) { data.CommandStations.Add(entity); return(null); }
public virtual TReturn Visit(ICommandStation entity, TData data) { return(default(TReturn)); }
public override object Visit(ICommandStation entity, IPackage data) { data.Remove(entity); return(null); }
public override IEntityState Visit(ICommandStation entity, IRailwayState data) { return(data.CommandStationStates[entity]); }