summaryrefslogtreecommitdiff
path: root/tests/monster_test_generated.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/monster_test_generated.ts')
-rw-r--r--tests/monster_test_generated.ts47
1 files changed, 45 insertions, 2 deletions
diff --git a/tests/monster_test_generated.ts b/tests/monster_test_generated.ts
index 5f51589c..617300aa 100644
--- a/tests/monster_test_generated.ts
+++ b/tests/monster_test_generated.ts
@@ -25,6 +25,17 @@ export enum Color{
* @enum {number}
*/
export namespace MyGame.Example{
+export enum Race{
+ None= -1,
+ Human= 0,
+ Dwarf= 1,
+ Elf= 2
+}};
+
+/**
+ * @enum {number}
+ */
+export namespace MyGame.Example{
export enum Any{
NONE= 0,
Monster= 1,
@@ -1795,10 +1806,33 @@ vectorOfEnumsArray():Uint8Array|null {
};
/**
+ * @returns MyGame.Example.Race
+ */
+signedEnum():MyGame.Example.Race {
+ var offset = this.bb!.__offset(this.bb_pos, 100);
+ return offset ? /** */ (this.bb!.readInt8(this.bb_pos + offset)) : MyGame.Example.Race.None;
+};
+
+/**
+ * @param MyGame.Example.Race value
+ * @returns boolean
+ */
+mutate_signed_enum(value:MyGame.Example.Race):boolean {
+ var offset = this.bb!.__offset(this.bb_pos, 100);
+
+ if (offset === 0) {
+ return false;
+ }
+
+ this.bb!.writeInt8(this.bb_pos + offset, value);
+ return true;
+};
+
+/**
* @param flatbuffers.Builder builder
*/
static startMonster(builder:flatbuffers.Builder) {
- builder.startObject(48);
+ builder.startObject(49);
};
/**
@@ -2518,6 +2552,14 @@ static startVectorOfEnumsVector(builder:flatbuffers.Builder, numElems:number) {
/**
* @param flatbuffers.Builder builder
+ * @param MyGame.Example.Race signedEnum
+ */
+static addSignedEnum(builder:flatbuffers.Builder, signedEnum:MyGame.Example.Race) {
+ builder.addFieldInt8(48, signedEnum, MyGame.Example.Race.None);
+};
+
+/**
+ * @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endMonster(builder:flatbuffers.Builder):flatbuffers.Offset {
@@ -2542,7 +2584,7 @@ static finishSizePrefixedMonsterBuffer(builder:flatbuffers.Builder, offset:flatb
builder.finish(offset, 'MONS', true);
};
-static createMonster(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset, mana:number, hp:number, nameOffset:flatbuffers.Offset, inventoryOffset:flatbuffers.Offset, color:MyGame.Example.Color, testType:MyGame.Example.Any, testOffset:flatbuffers.Offset, test4Offset:flatbuffers.Offset, testarrayofstringOffset:flatbuffers.Offset, testarrayoftablesOffset:flatbuffers.Offset, enemyOffset:flatbuffers.Offset, testnestedflatbufferOffset:flatbuffers.Offset, testemptyOffset:flatbuffers.Offset, testbool:boolean, testhashs32Fnv1:number, testhashu32Fnv1:number, testhashs64Fnv1:flatbuffers.Long, testhashu64Fnv1:flatbuffers.Long, testhashs32Fnv1a:number, testhashu32Fnv1a:number, testhashs64Fnv1a:flatbuffers.Long, testhashu64Fnv1a:flatbuffers.Long, testarrayofboolsOffset:flatbuffers.Offset, testf:number, testf2:number, testf3:number, testarrayofstring2Offset:flatbuffers.Offset, testarrayofsortedstructOffset:flatbuffers.Offset, flexOffset:flatbuffers.Offset, test5Offset:flatbuffers.Offset, vectorOfLongsOffset:flatbuffers.Offset, vectorOfDoublesOffset:flatbuffers.Offset, parentNamespaceTestOffset:flatbuffers.Offset, vectorOfReferrablesOffset:flatbuffers.Offset, singleWeakReference:flatbuffers.Long, vectorOfWeakReferencesOffset:flatbuffers.Offset, vectorOfStrongReferrablesOffset:flatbuffers.Offset, coOwningReference:flatbuffers.Long, vectorOfCoOwningReferencesOffset:flatbuffers.Offset, nonOwningReference:flatbuffers.Long, vectorOfNonOwningReferencesOffset:flatbuffers.Offset, anyUniqueType:MyGame.Example.AnyUniqueAliases, anyUniqueOffset:flatbuffers.Offset, anyAmbiguousType:MyGame.Example.AnyAmbiguousAliases, anyAmbiguousOffset:flatbuffers.Offset, vectorOfEnumsOffset:flatbuffers.Offset):flatbuffers.Offset {
+static createMonster(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset, mana:number, hp:number, nameOffset:flatbuffers.Offset, inventoryOffset:flatbuffers.Offset, color:MyGame.Example.Color, testType:MyGame.Example.Any, testOffset:flatbuffers.Offset, test4Offset:flatbuffers.Offset, testarrayofstringOffset:flatbuffers.Offset, testarrayoftablesOffset:flatbuffers.Offset, enemyOffset:flatbuffers.Offset, testnestedflatbufferOffset:flatbuffers.Offset, testemptyOffset:flatbuffers.Offset, testbool:boolean, testhashs32Fnv1:number, testhashu32Fnv1:number, testhashs64Fnv1:flatbuffers.Long, testhashu64Fnv1:flatbuffers.Long, testhashs32Fnv1a:number, testhashu32Fnv1a:number, testhashs64Fnv1a:flatbuffers.Long, testhashu64Fnv1a:flatbuffers.Long, testarrayofboolsOffset:flatbuffers.Offset, testf:number, testf2:number, testf3:number, testarrayofstring2Offset:flatbuffers.Offset, testarrayofsortedstructOffset:flatbuffers.Offset, flexOffset:flatbuffers.Offset, test5Offset:flatbuffers.Offset, vectorOfLongsOffset:flatbuffers.Offset, vectorOfDoublesOffset:flatbuffers.Offset, parentNamespaceTestOffset:flatbuffers.Offset, vectorOfReferrablesOffset:flatbuffers.Offset, singleWeakReference:flatbuffers.Long, vectorOfWeakReferencesOffset:flatbuffers.Offset, vectorOfStrongReferrablesOffset:flatbuffers.Offset, coOwningReference:flatbuffers.Long, vectorOfCoOwningReferencesOffset:flatbuffers.Offset, nonOwningReference:flatbuffers.Long, vectorOfNonOwningReferencesOffset:flatbuffers.Offset, anyUniqueType:MyGame.Example.AnyUniqueAliases, anyUniqueOffset:flatbuffers.Offset, anyAmbiguousType:MyGame.Example.AnyAmbiguousAliases, anyAmbiguousOffset:flatbuffers.Offset, vectorOfEnumsOffset:flatbuffers.Offset, signedEnum:MyGame.Example.Race):flatbuffers.Offset {
Monster.startMonster(builder);
Monster.addPos(builder, posOffset);
Monster.addMana(builder, mana);
@@ -2591,6 +2633,7 @@ static createMonster(builder:flatbuffers.Builder, posOffset:flatbuffers.Offset,
Monster.addAnyAmbiguousType(builder, anyAmbiguousType);
Monster.addAnyAmbiguous(builder, anyAmbiguousOffset);
Monster.addVectorOfEnums(builder, vectorOfEnumsOffset);
+ Monster.addSignedEnum(builder, signedEnum);
return Monster.endMonster(builder);
}
}