Add a getType method for the DiskDrive peripheral
ArsiTheFox opened this issue ยท 6 comments
I think adding a getType method for the DiskDrive would be a good addition so we can only allow certain devices through code like:
Disc
Disk
Computer
Turtle
Pocket
Maybe in the isDiskPresent method it could return the type of disk or make a method on its own
I assume that disc is for the vanilla and vanilla-like music discs personally, I would call those records in a getType method for less ambiguity.
I assume that disc is for the vanilla and vanilla-like music discs personally, I would call those records in a getType method for less ambiguity.
Yes definitely
Curious as to the use-case of "only allow certain devices"?
I don't have any objections, but I am worried that people are going to start relying on getType() == "record"
or something instead of disk.hasAudio
, and that's going to blow up once you have non-default IMedia
implementations.
Curious as to the use-case of "only allow certain devices"?
I don't have any objections, but I am worried that people are going to start relying on
getType() == "record"
or something instead ofdisk.hasAudio
, and that's going to blow up once you have non-defaultIMedia
implementations.
Well because there is no way to differentiate if a computer, pocket computer, or turtle is in the drive you can only check if the item has data
Well, I got that far :p. Just curious as to what you're actually trying to do here.
A good solution would be to just do getType() == "audio"
instead of record
and have it be that if disk.hasAudio
instead of if its record. Solves issue in future new audio media compatibility.
In fact that is exactly what #638 does under the hood it just calls all playable audio sources record