From 4267927352624c48655db1a7a623e0186d6fe44a Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Thu, 17 Aug 2023 09:37:17 -0400 Subject: [PATCH] create new constructors for VmcExtRcv --- VmcMessages/VmcExtRcv.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/VmcMessages/VmcExtRcv.cs b/VmcMessages/VmcExtRcv.cs index 5a86fae..de5fb03 100644 --- a/VmcMessages/VmcExtRcv.cs +++ b/VmcMessages/VmcExtRcv.cs @@ -67,5 +67,38 @@ namespace godotVmcSharp } ipAddress = (string)m.Data[2].Value; } + + public VmcExtRcv(int _enable, int _port) : base(new godotOscSharp.Address("/VMC/Ext/Rcv")) + { + if (_enable < 0 || _enable > 1) + { + GD.Print($"Invalid value for \"enable\" argument of {addr}. Expected 0 or 1, received {_enable}."); + return; + } + if (_port < 0 || _port > 65535) + { + GD.Print($"Invalid value for \"port\" argument of {addr}. Expected 0-65535, received {_port}."); + return; + } + enable = _enable; + port = _port; + } + + public VmcExtRcv(int _enable, int _port, string _ipAddress) : base(new godotOscSharp.Address("/VMC/Ext/Rcv")) + { + if (_enable < 0 || _enable > 1) + { + GD.Print($"Invalid value for \"enable\" argument of {addr}. Expected 0 or 1, received {_enable}."); + return; + } + if (_port < 0 || _port > 65535) + { + GD.Print($"Invalid value for \"port\" argument of {addr}. Expected 0-65535, received {_port}."); + return; + } + enable = _enable; + port = _port; + ipAddress = _ipAddress; + } } } \ No newline at end of file