public string GetComment(string name) { string keyShort = ActionFactory <AuxActionRef> .GetKey(name); if (keyShort == null) { return("No Comment"); } return(ActionFactory <AuxActionRef> .GetLongDescr(keyShort)); }
public AuxActionRef GetAction(int indx) { string shortDescr = ActionFactory <AuxActionRef> .GetShortDescr(indx); string keyShort = ActionFactory <AuxActionRef> .GetKey(shortDescr); KeyValuePair <string, AuxActionRef>?actionPair = HasGenAction(keyShort); if (actionPair != null) { KeyValuePair <string, AuxActionRef> info = (KeyValuePair <string, AuxActionRef>)actionPair; return((AuxActionRef)info.Value); } return(null); }
public bool RemoveGenAction(string name) { string keyShort = ActionFactory <AuxActionRef> .GetKey(name); if (keyShort == null) { return(false); } KeyValuePair <string, AuxActionRef>?record = HasGenAction(keyShort); if (record == null) { return(false); } GenAuxActions.Remove((KeyValuePair <string, AuxActionRef>)record); return(true); }
public bool AddGenAction(string name) { string keyShort = ActionFactory <AuxActionRef> .GetKey(name); if (keyShort == null) { return(false); } KeyValuePair <string, AuxActionRef>?record = HasGenAction(keyShort); if (record != null) { return(false); } AuxActionRef action = ActionFactory <AuxActionRef> .Create(keyShort); record = new KeyValuePair <string, AuxActionRef>(keyShort, action); GenAuxActions.Add((KeyValuePair <string, AuxActionRef>)record); UsedActions.Add(name); return(true); }
public static void Register(string key) { ActionFactory <AuxActionRef> .Register(key, () => new AuxControlStopped(true), "Control Stopped", "Action used to manage a Stopped AITrain"); }
public static void Register(string key) { ActionFactory <AuxActionRef> .Register(key, () => new AuxControlStart(true), "Control Start", "Action used to manage the starting of AI Train"); }
public static void Register(string key) { ActionFactory <AuxActionRef> .Register(key, () => new AuxActionHorn(true), //null, -1f, true), "Horn at Level Crossing", "Generic Action used to sound AI Horn when it reach a Level cross"); }
public string GetLongDescr(int cnt) { return(ActionFactory <AuxActionRef> .GetLongDescr(cnt)); }
public int GetCountAvailableAction() { return(ActionFactory <AuxActionRef> .Count()); }