From 98cef5e9a772602d42acfcf233838c760424db9a Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Thu, 13 Feb 2025 18:00:17 +1100 Subject: initial commit --- comp2511/blackout/CloudStorageDevice.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 comp2511/blackout/CloudStorageDevice.java (limited to 'comp2511/blackout/CloudStorageDevice.java') 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 -- cgit v1.2.3