# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

class MatchSettings(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsMatchSettings(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = MatchSettings()
        x.Init(buf, n + offset)
        return x

    # MatchSettings
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # MatchSettings
    def PlayerConfigurations(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .PlayerConfiguration import PlayerConfiguration
            obj = PlayerConfiguration()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MatchSettings
    def PlayerConfigurationsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # MatchSettings
    def GameMode(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # MatchSettings
    def GameMap(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # MatchSettings
    def SkipReplays(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
        return 0

    # MatchSettings
    def InstantStart(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
        return 0

    # MatchSettings
    def MutatorSettings(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .MutatorSettings import MutatorSettings
            obj = MutatorSettings()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MatchSettings
    def ExistingMatchBehavior(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # MatchSettings
    def EnableLockstep(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
        return 0

    # MatchSettings
    def EnableRendering(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
        return 0

    # MatchSettings
    def EnableStateSetting(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
        return 0

    # MatchSettings
    def AutoSaveReplay(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
        return 0

# /// The name of a upk file, like UtopiaStadium_P, which should be loaded.
# /// If specified, this overrides gameMap. On Steam version of Rocket League,
# /// this can be used to load custom map files, but on Epic version it only
# /// works on the Psyonix maps. Still useful because maintaining the gameMap
# /// enum as new Psyonix maps are added is annoying.
    # MatchSettings
    def GameMapUpk(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return bytes()

def MatchSettingsStart(builder): builder.StartObject(12)
def MatchSettingsAddPlayerConfigurations(builder, playerConfigurations): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(playerConfigurations), 0)
def MatchSettingsStartPlayerConfigurationsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def MatchSettingsAddGameMode(builder, gameMode): builder.PrependInt8Slot(1, gameMode, 0)
def MatchSettingsAddGameMap(builder, gameMap): builder.PrependInt8Slot(2, gameMap, 0)
def MatchSettingsAddSkipReplays(builder, skipReplays): builder.PrependBoolSlot(3, skipReplays, 0)
def MatchSettingsAddInstantStart(builder, instantStart): builder.PrependBoolSlot(4, instantStart, 0)
def MatchSettingsAddMutatorSettings(builder, mutatorSettings): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(mutatorSettings), 0)
def MatchSettingsAddExistingMatchBehavior(builder, existingMatchBehavior): builder.PrependInt8Slot(6, existingMatchBehavior, 0)
def MatchSettingsAddEnableLockstep(builder, enableLockstep): builder.PrependBoolSlot(7, enableLockstep, 0)
def MatchSettingsAddEnableRendering(builder, enableRendering): builder.PrependBoolSlot(8, enableRendering, 0)
def MatchSettingsAddEnableStateSetting(builder, enableStateSetting): builder.PrependBoolSlot(9, enableStateSetting, 0)
def MatchSettingsAddAutoSaveReplay(builder, autoSaveReplay): builder.PrependBoolSlot(10, autoSaveReplay, 0)
def MatchSettingsAddGameMapUpk(builder, gameMapUpk): builder.PrependUOffsetTRelativeSlot(11, flatbuffers.number_types.UOffsetTFlags.py_type(gameMapUpk), 0)
def MatchSettingsEnd(builder): return builder.EndObject()
