aboutsummaryrefslogtreecommitdiff
path: root/comp2511/blackout/CloudStorageDevice.java
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-13 18:00:17 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-13 18:00:17 +1100
commit98cef5e9a772602d42acfcf233838c760424db9a (patch)
tree5277fa1d7cc0a69a0f166fcbf10fd320f345f049 /comp2511/blackout/CloudStorageDevice.java
initial commit
Diffstat (limited to 'comp2511/blackout/CloudStorageDevice.java')
-rw-r--r--comp2511/blackout/CloudStorageDevice.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/comp2511/blackout/CloudStorageDevice.java b/comp2511/blackout/CloudStorageDevice.java
new file mode 100644
index 0000000..04e1c41
--- /dev/null
+++ b/comp2511/blackout/CloudStorageDevice.java
@@ -0,0 +1,22 @@
+package unsw.blackout;
+
+import unsw.utils.Angle;
+
+// "This device acts like a desktop"
+// There is a small POTENTIAL issue where our satellites check the type of the device, and if our
+// device is supposed to act like a desktop, then the satellites should also be able to communicate
+// with our CloudStorageDevice if Desktops are compatible. This is unspecified!
+public class CloudStorageDevice extends DesktopDevice {
+ public CloudStorageDevice(String deviceID, Angle position) {
+ super(deviceID, position);
+ }
+
+ @ Override
+ final protected int getNumBytesInFiles() {
+ int count = 0;
+ for (File file : getReceivedFiles()) {
+ count += file.getContents().length();
+ }
+ return count;
+ }
+} \ No newline at end of file