Files
flatbuffers/tests/MyGame/Example2/Monster.cs
mugisoba 7418d85872 [C#] support Object API (#5710)
* [C#] support Object API

* fix sign-compare

* fix indent

* add new line before for loop.

* using auto whenever possible

* reduce the amout of blank lines.

* wip: support vectors of union

* done: support unions of vectors

* set C# version to 4.0
* remove null propagation operator
* remove auto property initializer
* remove expression-bodied method
* remove pattern matching

* add Example2 to NetTest.sh

* separate JavaUsage.md and CsharpUsage.md from JavaCsharpUsage.md

* add C# Object based API notes.

* support vs2010.

* remove range based for loop.

* remove System.Linq

* fix indent

* CreateSharedString to CreateString

* check shared attribute

* snake case
2020-01-30 10:18:28 -08:00

51 lines
1.5 KiB
C#

// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace MyGame.Example2
{
using global::System;
using global::System.Collections.Generic;
using global::FlatBuffers;
public struct Monster : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_11_1(); }
public static Monster GetRootAsMonster(ByteBuffer _bb) { return GetRootAsMonster(_bb, new Monster()); }
public static Monster GetRootAsMonster(ByteBuffer _bb, Monster obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public Monster __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public static void StartMonster(FlatBufferBuilder builder) { builder.StartTable(0); }
public static Offset<MyGame.Example2.Monster> EndMonster(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<MyGame.Example2.Monster>(o);
}
public MonsterT UnPack() {
var _o = new MonsterT();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(MonsterT _o) {
}
public static Offset<MyGame.Example2.Monster> Pack(FlatBufferBuilder builder, MonsterT _o) {
if (_o == null) return default(Offset<MyGame.Example2.Monster>);
StartMonster(builder);
return EndMonster(builder);
}
};
public class MonsterT
{
public MonsterT() {
}
}
}