summaryrefslogtreecommitdiff
path: root/packets/packet.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-11-30 12:46:08 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-11-30 12:46:08 +0100
commitd560f77811d4fc6f29bf477356a6d2e58dda0be1 (patch)
tree3ac2c4267b5c88e40849416115977574e9f09a83 /packets/packet.gd
parent313afffce7a823c30acf4853b083f9ca5132e879 (diff)
next commit
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]