public static LogicValuePayload GetLogicValue(ILogicable logicable, LogicType logicType) { var value = logicable.GetLogicValue(logicType); var writable = logicable.CanLogicWrite(logicType); return(new LogicValuePayload() { value = value, writable = writable }); }
void DumpTransmitter(ILogicable transmitter) { Debug.Log(String.Format("Dumping transmitter: {0}", transmitter.DisplayName)); foreach (LogicType logicType in Enum.GetValues(typeof(LogicType))) { if (transmitter.CanLogicRead(logicType)) { var value = transmitter.GetLogicValue(logicType); Debug.Log(String.Format("== {0}: {1}", logicType, value)); } } }
public JObject GetLogicValues(ILogicable logicable) { var logicValues = new Dictionary <string, double>(); foreach (LogicType logicType in Enum.GetValues(typeof(LogicType))) { if (logicable.CanLogicRead(logicType)) { var value = logicable.GetLogicValue(logicType); logicValues.Add(logicType.ToString(), value); } } return(JObject.FromObject(logicValues)); }
public static Dictionary <int, Dictionary <string, double> > GetSlotValues(ILogicable logicable) { var slots = new Dictionary <int, Dictionary <string, double> >(); for (var i = 0; i < logicable.TotalSlots; i++) { var logicValues = new Dictionary <string, double>(); foreach (LogicSlotType logicType in Enum.GetValues(typeof(LogicSlotType))) { if (logicable.CanLogicRead(logicType, i)) { var value = logicable.GetLogicValue(logicType, i); logicValues.Add(logicType.ToString(), value); } } slots.Add(i, logicValues); } return(slots); }