# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flat

import flatbuffers

# /// Notification that a player triggers some in-game event, such as:
# ///		Win, Loss, TimePlayed;
# ///		Shot, Assist, Center, Clear, PoolShot;
# ///		Goal, AerialGoal, BicycleGoal, BulletGoal, BackwardsGoal, LongGoal, OvertimeGoal, TurtleGoal;
# ///		AerialHit, BicycleHit, BulletHit, /*BackwardsHit,*/ JuggleHit, FirstTouch, BallHit;
# ///		Save, EpicSave, FreezeSave;
# ///		HatTrick, Savior, Playmaker, MVP;
# ///		FastestGoal, SlowestGoal, FurthestGoal, OwnGoal;
# ///		MostBallTouches, FewestBallTouches, MostBoostPickups, FewestBoostPickups, BoostPickups;
# ///		CarTouches, Demolition, Demolish;
# ///		LowFive, HighFive;
class PlayerStatEvent(object):
    __slots__ = ['_tab']

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

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

# /// index of the player associated with the event
    # PlayerStatEvent
    def PlayerIndex(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

# /// Event type
    # PlayerStatEvent
    def StatType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return bytes()

def PlayerStatEventStart(builder): builder.StartObject(2)
def PlayerStatEventAddPlayerIndex(builder, playerIndex): builder.PrependInt32Slot(0, playerIndex, 0)
def PlayerStatEventAddStatType(builder, statType): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(statType), 0)
def PlayerStatEventEnd(builder): return builder.EndObject()
