public static void AddValue(FlatBufferBuilder builder, short value) { builder.AddShort(1, value, 0); }
public static void AddMana(FlatBufferBuilder builder, short mana) { builder.AddShort(1, mana, 150); }
/// <summary> /// Serializes a value as inline /// </summary> private int SerializeInlineValue(object obj, TypeModel typeModel) { switch (typeModel.BaseType) { case BaseType.Bool: { _builder.AddBool((bool)obj); break; } case BaseType.Char: { _builder.AddSbyte((sbyte)obj); break; } case BaseType.UChar: { _builder.AddByte((byte)obj); break; } case BaseType.Short: { _builder.AddShort((short)obj); break; } case BaseType.UShort: { _builder.AddUshort((ushort)obj); break; } case BaseType.Int: { _builder.AddInt((int)obj); break; } case BaseType.UInt: { _builder.AddUint((uint)obj); break; } case BaseType.Long: { _builder.AddLong((long)obj); break; } case BaseType.ULong: { _builder.AddUlong((ulong)obj); break; } case BaseType.Float: { _builder.AddFloat((float)obj); break; } case BaseType.Double: { _builder.AddDouble((double)obj); break; } case BaseType.Struct: { return(SerializeStruct(obj, typeModel)); } default: { throw new InvalidOperationException(); } } return(_builder.Offset); }
public static void AddHp(FlatBufferBuilder builder, short hp) { builder.AddShort(2, hp, 100); }