Base type safety in C#. Clear FlatBufferBuilder in C#.

This commit is contained in:
RevenantX
2015-07-29 00:33:45 +03:00
parent 6e192fa408
commit 588564d74f
12 changed files with 188 additions and 53 deletions

View File

@@ -11,12 +11,12 @@ public sealed class Test : Struct {
public short A { get { return bb.GetShort(bb_pos + 0); } }
public sbyte B { get { return bb.GetSbyte(bb_pos + 2); } }
public static int CreateTest(FlatBufferBuilder builder, short A, sbyte B) {
public static Offset<Test> CreateTest(FlatBufferBuilder builder, short A, sbyte B) {
builder.Prep(2, 4);
builder.Pad(1);
builder.PutSbyte(B);
builder.PutShort(A);
return builder.Offset;
return new Offset<Test>(builder.Offset);
}
};