aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordpeter99 <dpeter99@gmail.com>2018-04-01 21:28:19 +0200
committerJustin Berger <j.david.berger@gmail.com>2018-04-02 00:11:42 -0600
commit4fc4476108f0ad49a4dce99ff2506c3da9b3994a (patch)
tree73b5c669e704ad3d1a5985e710f06f998d1ec4f5
parent7770495e7f14fe5094b31df5f5976c34fd68a0da (diff)
downloadlibsurvive-4fc4476108f0ad49a4dce99ff2506c3da9b3994a.tar.gz
libsurvive-4fc4476108f0ad49a4dce99ff2506c3da9b3994a.tar.bz2
Fixed the parameters
-rw-r--r--bindings/cs/libsurvive.net/LibSurViveAPI.cs40
1 files changed, 29 insertions, 11 deletions
diff --git a/bindings/cs/libsurvive.net/LibSurViveAPI.cs b/bindings/cs/libsurvive.net/LibSurViveAPI.cs
index aa2fdae..922a055 100644
--- a/bindings/cs/libsurvive.net/LibSurViveAPI.cs
+++ b/bindings/cs/libsurvive.net/LibSurViveAPI.cs
@@ -309,24 +309,42 @@ public class LibSurViveAPI
public class SurviveObject
{
- public SurvivePose pose { get; private set; }
+ private SurvivePose _pose;
+ public SurvivePose Pose
+ {
+ get
+ {
+ var ptr1 = cfunctions.Survive_object_pose(ptr);
+ return (SurvivePose)Marshal.PtrToStructure(ptr1, typeof(SurvivePose));
+ }
+ }
- public int charge { get; private set; }
- public bool charging { get; private set; }
+ private int _charge;
+ public int Charge
+ {
+ get
+ {
+ return cfunctions.Survive_object_charge(ptr);
+ }
+ }
+ public bool Charging
+ {
+ get
+ {
+ return cfunctions.Survive_object_charging(ptr);
+ }
+ }
+ IntPtr ptr;
+ private bool _charging;
- public SurviveObject(IntPtr ptr)
+ public SurviveObject(IntPtr obj_ptr)
{
- if (ptr == IntPtr.Zero)
+ if (obj_ptr == IntPtr.Zero)
{
throw new Exception("Can't create SurviveObject with 0 pointer");
}
- var ptr1 = cfunctions.Survive_object_pose(ptr);
- pose = (SurvivePose)Marshal.PtrToStructure(ptr1, typeof(SurvivePose));
-
- //pose =
- charge = cfunctions.Survive_object_charge(ptr);
- charging = cfunctions.Survive_object_charging(ptr);
+ ptr = obj_ptr;
}
}