summaryrefslogtreecommitdiff
path: root/packets/packet.gd
diff options
context:
space:
mode:
Diffstat (limited to 'packets/packet.gd')
-rw-r--r--packets/packet.gd10
1 files changed, 6 insertions, 4 deletions
diff --git a/packets/packet.gd b/packets/packet.gd
index 33db0b1..b1e72ed 100644
--- a/packets/packet.gd
+++ b/packets/packet.gd
@@ -1,14 +1,16 @@
class_name Packet
-#static var header: int = 0
+# set to 0 if variable length
+#const BYTE_LENGTH := 0
-var byte_length: int = 0
+var byte_length: int = 0:
+ get = get_byte_length
-## Override if packet has variable length
+## Override if packet has variable length.
func get_byte_length() -> int:
- return byte_length
+ return self.BYTE_LENGTH
## Get header to prepend to the packet. [br]