protocol rework Sets -> Map

This commit is contained in:
loucass003 committed 2022-04-14 09:15:01 +02:00
1 parent f961318035
commit 9fc5d41e1b
30 files changed
+3886 -3729

No files matched your search

+19
View File
@@ -35,6 +35,9 @@ import io.eiren.util.collections.FastList;
import io.eiren.yaml.YamlException;
import io.eiren.yaml.YamlFile;
import io.eiren.yaml.YamlNode;
import slimevr_protocol.datatypes.DeviceId;
import slimevr_protocol.datatypes.TrackerId;
import slimevr_protocol.datatypes.TrackerIdT;
public class VRServer extends Thread {
@@ -313,6 +316,22 @@ public class VRServer extends Thread {
return new FastList<>(trackers);
}
public Tracker getTrackerById(TrackerIdT id) {
for (Tracker tracker : trackers) {
if (tracker.getTrackerNum() != id.getTrackerNum())
continue;
if (tracker.getDevice() == null && id.getDeviceId() != null)
continue;
if (tracker.getDevice() != null && id.getDeviceId() == null)
continue;
if (tracker.getDevice().getId() != id.getDeviceId().getId())
continue;
return tracker;
}
return null;
}
public BVHRecorder getBvhRecorder() {
return this.bvhRecorder;
}