mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-23 14:20:01 +00:00
Vector of unions support for java and c# (#4735)
* Eclipse ignore * TypeScript support * Prefixing enums * Test results * Merged JS and TS generators * Fixed AppVeyor build problems * Fixed more AppVeyor build problems * Fixed more AppVeyor build problems * Changed TS flag to options struct * Storing options by value * Removed unneeded const * Re-export support for unions * Uint support * Casting bools to numbers for mutation * TS shell tests * Reverted generates js test file to original version * Backing up js tests and properly generating test data * Not importing flatbuffers for TS test generation * Not overwriting generated js for tests * AppVeyor test fixes * Generating the most strict TS code possible * Not returning null when creating vectors * Not returning null from struct contructors * Vector of unions for ts/js * Sanity check for languages * Indentation fix + output test files * Vectors of unions for php * Fixes to union vector handling + tests * Fix for strictPropertyInitialization * Fix for new aligned operator new for gcc >= 7.1 * Not generating imports/ns prefixes with --gen-all * TypeScript docs * Missing imports of enums * Missing TS links * Enabled vector of unions for java, since it seems to work * Added jitpack config * Added obj to vector of unions getter * Removed unneeded accessor * Bumped jdk version in pom.xml * Vector of unions support for c#
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
5d42c8352e
commit
f11ffedb2b
33
tests/union_vector/Attacker.cs
Normal file
33
tests/union_vector/Attacker.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
// <auto-generated>
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
// </auto-generated>
|
||||
|
||||
using global::System;
|
||||
using global::FlatBuffers;
|
||||
|
||||
public struct Attacker : IFlatbufferObject
|
||||
{
|
||||
private Table __p;
|
||||
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||||
public static Attacker GetRootAsAttacker(ByteBuffer _bb) { return GetRootAsAttacker(_bb, new Attacker()); }
|
||||
public static Attacker GetRootAsAttacker(ByteBuffer _bb, Attacker obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||||
public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
|
||||
public Attacker __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||||
|
||||
public int SwordAttackDamage { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
|
||||
|
||||
public static Offset<Attacker> CreateAttacker(FlatBufferBuilder builder,
|
||||
int sword_attack_damage = 0) {
|
||||
builder.StartObject(1);
|
||||
Attacker.AddSwordAttackDamage(builder, sword_attack_damage);
|
||||
return Attacker.EndAttacker(builder);
|
||||
}
|
||||
|
||||
public static void StartAttacker(FlatBufferBuilder builder) { builder.StartObject(1); }
|
||||
public static void AddSwordAttackDamage(FlatBufferBuilder builder, int swordAttackDamage) { builder.AddInt(0, swordAttackDamage, 0); }
|
||||
public static Offset<Attacker> EndAttacker(FlatBufferBuilder builder) {
|
||||
int o = builder.EndObject();
|
||||
return new Offset<Attacker>(o);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user