Offset <CharacterModelFlat> AddCharacterToFlat(FlatBufferBuilder fbb, CharacterModel model)
    {
        StringOffset           nameOffset   = fbb.CreateString(model.name);
        StringOffset           learnedSkill = fbb.CreateString(JoinAllStrings(model.learnActive));
        StringOffset           activeSkill  = fbb.CreateString(JoinAllStrings(model.actives));
        Offset <AttributeFlat> attrib       = GetAttribute(fbb, model.attribute);

        CharacterModelFlat.StartCharacterModelFlat(fbb);
        CharacterModelFlat.AddName(fbb, nameOffset);
        CharacterModelFlat.AddLevel(fbb, model.level);
        CharacterModelFlat.AddExp(fbb, model.exp);
        CharacterModelFlat.AddLearnActive(fbb, learnedSkill);
        CharacterModelFlat.AddLearnActive(fbb, activeSkill);
        CharacterModelFlat.AddAtt(fbb, attrib);
        return(CharacterModelFlat.EndCharacterModelFlat(fbb));
    }
예제 #2
0
 public static Offset <CharacterModelFlat> CreateCharacterModelFlat(FlatBufferBuilder builder,
                                                                    StringOffset nameOffset = default(StringOffset),
                                                                    int level    = 0,
                                                                    int exp      = 0,
                                                                    bool levelUp = false,
                                                                    StringOffset learnActiveOffset   = default(StringOffset),
                                                                    StringOffset activesOffset       = default(StringOffset),
                                                                    StringOffset traitsOffset        = default(StringOffset),
                                                                    Offset <AttributeFlat> attOffset = default(Offset <AttributeFlat>))
 {
     builder.StartObject(8);
     CharacterModelFlat.AddAtt(builder, attOffset);
     CharacterModelFlat.AddTraits(builder, traitsOffset);
     CharacterModelFlat.AddActives(builder, activesOffset);
     CharacterModelFlat.AddLearnActive(builder, learnActiveOffset);
     CharacterModelFlat.AddExp(builder, exp);
     CharacterModelFlat.AddLevel(builder, level);
     CharacterModelFlat.AddName(builder, nameOffset);
     CharacterModelFlat.AddLevelUp(builder, levelUp);
     return(CharacterModelFlat.EndCharacterModelFlat(builder));
 }