public void addSensor(Sensor sensor) { if (CurrentSensor == MAX_SENSORS - 1) { throw new System.ArgumentException("Sensors at full capacity"); } _sensors[CurrentSensor] = sensor; CurrentSensor++; }
public void setSensor(int index, Sensor sensor) { if (CurrentSensor == MAX_SENSORS - 1) { throw new System.ArgumentException("Sensors at full capacity"); } if (index > CurrentSensor) { throw new System.ArgumentException("No Sensor in that index"); } for (int i = 0; i < MAX_SENSORS; i++) { if (i == index) { _sensors[i] = sensor; } } }
public Node(string id, string type, Sensor[] sensors) { NodeID = id; NodeType = type; _sensors = sensors; }