diff options
author | Maor Itzkovitch <maor.tt@gmail.com> | 2015-08-07 09:05:08 +0300 |
---|---|---|
committer | Maor Itzkovitch <maor.tt@gmail.com> | 2015-08-07 09:05:08 +0300 |
commit | 7196c3684249c12571cd2e16ba8e5564c57484aa (patch) | |
tree | 3a0b94bf8f99cf18f9b8f528b39f9e31eef52c65 /tests/MyGame/Example | |
parent | 6be146d67ffd31b26751f32c1d3b96726a67c175 (diff) | |
download | flatbuffers-7196c3684249c12571cd2e16ba8e5564c57484aa.tar.gz flatbuffers-7196c3684249c12571cd2e16ba8e5564c57484aa.tar.bz2 flatbuffers-7196c3684249c12571cd2e16ba8e5564c57484aa.zip |
begin to correct C# bytebuffer behavior
Diffstat (limited to 'tests/MyGame/Example')
-rw-r--r-- | tests/MyGame/Example/Monster.cs | 4 | ||||
-rw-r--r-- | tests/MyGame/Example/Monster.java | 4 | ||||
-rw-r--r-- | tests/MyGame/Example/Stat.java | 2 | ||||
-rw-r--r-- | tests/MyGame/Example/Vec3.cs | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/MyGame/Example/Monster.cs b/tests/MyGame/Example/Monster.cs index 593210b3..e97ae4af 100644 --- a/tests/MyGame/Example/Monster.cs +++ b/tests/MyGame/Example/Monster.cs @@ -21,9 +21,9 @@ public sealed class Monster : Table { public byte GetInventory(int j) { int o = __offset(14); return o != 0 ? bb.Get(__vector(o) + j * 1) : (byte)0; } public int InventoryLength { get { int o = __offset(14); return o != 0 ? __vector_len(o) : 0; } } public Color Color { get { int o = __offset(16); return o != 0 ? (Color)bb.GetSbyte(o + bb_pos) : (Color)8; } } - public bool MutateColor(sbyte color) { int o = __offset(16); if (o != 0) { bb.PutSbyte(o + bb_pos, color); return true; } else { return false; } } + public bool MutateColor(Color color) { int o = __offset(16); if (o != 0) { bb.PutSbyte(o + bb_pos, (sbyte)color); return true; } else { return false; } } public Any TestType { get { int o = __offset(18); return o != 0 ? (Any)bb.Get(o + bb_pos) : (Any)0; } } - public bool MutateTestType(byte test_type) { int o = __offset(18); if (o != 0) { bb.Put(o + bb_pos, test_type); return true; } else { return false; } } + public bool MutateTestType(Any test_type) { int o = __offset(18); if (o != 0) { bb.Put(o + bb_pos, (byte)test_type); return true; } else { return false; } } public TTable GetTest<TTable>(TTable obj) where TTable : Table { int o = __offset(20); return o != 0 ? __union(obj, o) : null; } public Test GetTest4(int j) { return GetTest4(new Test(), j); } public Test GetTest4(Test obj, int j) { int o = __offset(22); return o != 0 ? obj.__init(__vector(o) + j * 4, bb) : null; } diff --git a/tests/MyGame/Example/Monster.java b/tests/MyGame/Example/Monster.java index 0183a001..ad64e786 100644 --- a/tests/MyGame/Example/Monster.java +++ b/tests/MyGame/Example/Monster.java @@ -53,7 +53,7 @@ public final class Monster extends Table { public int testhashs32Fnv1() { int o = __offset(36); return o != 0 ? bb.getInt(o + bb_pos) : 0; } public boolean mutateTesthashs32Fnv1(int testhashs32_fnv1) { int o = __offset(36); if (o != 0) { bb.putInt(o + bb_pos, testhashs32_fnv1); return true; } else { return false; } } public long testhashu32Fnv1() { int o = __offset(38); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 0; } - public boolean mutateTesthashu32Fnv1(int testhashu32_fnv1) { int o = __offset(38); if (o != 0) { bb.putInt(o + bb_pos, testhashu32_fnv1); return true; } else { return false; } } + public boolean mutateTesthashu32Fnv1(long testhashu32_fnv1) { int o = __offset(38); if (o != 0) { bb.putInt(o + bb_pos, (int)testhashu32_fnv1); return true; } else { return false; } } public long testhashs64Fnv1() { int o = __offset(40); return o != 0 ? bb.getLong(o + bb_pos) : 0; } public boolean mutateTesthashs64Fnv1(long testhashs64_fnv1) { int o = __offset(40); if (o != 0) { bb.putLong(o + bb_pos, testhashs64_fnv1); return true; } else { return false; } } public long testhashu64Fnv1() { int o = __offset(42); return o != 0 ? bb.getLong(o + bb_pos) : 0; } @@ -61,7 +61,7 @@ public final class Monster extends Table { public int testhashs32Fnv1a() { int o = __offset(44); return o != 0 ? bb.getInt(o + bb_pos) : 0; } public boolean mutateTesthashs32Fnv1a(int testhashs32_fnv1a) { int o = __offset(44); if (o != 0) { bb.putInt(o + bb_pos, testhashs32_fnv1a); return true; } else { return false; } } public long testhashu32Fnv1a() { int o = __offset(46); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 0; } - public boolean mutateTesthashu32Fnv1a(int testhashu32_fnv1a) { int o = __offset(46); if (o != 0) { bb.putInt(o + bb_pos, testhashu32_fnv1a); return true; } else { return false; } } + public boolean mutateTesthashu32Fnv1a(long testhashu32_fnv1a) { int o = __offset(46); if (o != 0) { bb.putInt(o + bb_pos, (int)testhashu32_fnv1a); return true; } else { return false; } } public long testhashs64Fnv1a() { int o = __offset(48); return o != 0 ? bb.getLong(o + bb_pos) : 0; } public boolean mutateTesthashs64Fnv1a(long testhashs64_fnv1a) { int o = __offset(48); if (o != 0) { bb.putLong(o + bb_pos, testhashs64_fnv1a); return true; } else { return false; } } public long testhashu64Fnv1a() { int o = __offset(50); return o != 0 ? bb.getLong(o + bb_pos) : 0; } diff --git a/tests/MyGame/Example/Stat.java b/tests/MyGame/Example/Stat.java index 23cc42a3..673729e1 100644 --- a/tests/MyGame/Example/Stat.java +++ b/tests/MyGame/Example/Stat.java @@ -17,7 +17,7 @@ public final class Stat extends Table { public long val() { int o = __offset(6); return o != 0 ? bb.getLong(o + bb_pos) : 0; } public boolean mutateVal(long val) { int o = __offset(6); if (o != 0) { bb.putLong(o + bb_pos, val); return true; } else { return false; } } public int count() { int o = __offset(8); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; } - public boolean mutateCount(short count) { int o = __offset(8); if (o != 0) { bb.putShort(o + bb_pos, count); return true; } else { return false; } } + public boolean mutateCount(int count) { int o = __offset(8); if (o != 0) { bb.putShort(o + bb_pos, (short)count); return true; } else { return false; } } public static int createStat(FlatBufferBuilder builder, int id, diff --git a/tests/MyGame/Example/Vec3.cs b/tests/MyGame/Example/Vec3.cs index 3582c0d0..55c466d4 100644 --- a/tests/MyGame/Example/Vec3.cs +++ b/tests/MyGame/Example/Vec3.cs @@ -17,7 +17,7 @@ public sealed class Vec3 : Struct { public double Test1 { get { return bb.GetDouble(bb_pos + 16); } } public void MutateTest1(double test1) { bb.PutDouble(bb_pos + 16, test1); } public Color Test2 { get { return (Color)bb.GetSbyte(bb_pos + 24); } } - public void MutateTest2(sbyte test2) { bb.PutSbyte(bb_pos + 24, test2); } + public void MutateTest2(Color test2) { bb.PutSbyte(bb_pos + 24, (sbyte)test2); } public Test Test3 { get { return GetTest3(new Test()); } } public Test GetTest3(Test obj) { return obj.__init(bb_pos + 26, bb); } |