Fix C# vector of enum code generation

Fixes a bug where the logic to determine when to use a C# enum flags
both enums and vectors of enums.  This causes the C# generator to
generate code that doesn't compile for tables that contain vectors of
enums.

The fix also consolidates type generation functions a bit and adds
some additional casting functions for clarity.
This commit is contained in:
Donnell
2015-11-13 23:39:46 -05:00
committed by belldon
parent a7b5f92f51
commit 644bcbde91
7 changed files with 150 additions and 127 deletions

View File

@@ -17,12 +17,12 @@ public sealed class Stat : Table {
public bool MutateCount(ushort count) { int o = __offset(8); if (o != 0) { bb.PutUshort(o + bb_pos, count); return true; } else { return false; } }
public static Offset<Stat> CreateStat(FlatBufferBuilder builder,
StringOffset id = default(StringOffset),
StringOffset idOffset = default(StringOffset),
long val = 0,
ushort count = 0) {
builder.StartObject(3);
Stat.AddVal(builder, val);
Stat.AddId(builder, id);
Stat.AddId(builder, idOffset);
Stat.AddCount(builder, count);
return Stat.EndStat(builder);
}