made peripherals a static class

This commit is contained in:
2023-07-27 20:38:23 +02:00
parent a93ee1cddf
commit 9deea0ee98
14 changed files with 42 additions and 52 deletions

View File

@@ -32,7 +32,7 @@ class Net {
@:allow(kernel.Init)
private function new() {
this.interfaces = [for (e in Peripheral.instance.getAllModems()) e ]; // TODO: is this the way to do it?
this.interfaces = [for (e in Peripheral.getAllModems()) e ]; // TODO: is this the way to do it?
this.interfaces.push(Loopback.instance);
for (interf in interfaces){
@@ -280,7 +280,7 @@ class Net {
data: null,
};
for (modem in Peripheral.instance.getAllModems()) {
for (modem in Peripheral.getAllModems()) {
if (!modem.isWireless()) continue;
modem.send(Net.BRODCAST_PORT, Net.instance.networkID, pack);
}