// Code generated by the FlatBuffers compiler. DO NOT EDIT.

package battle

import (
	flatbuffers "github.com/google/flatbuffers/go"
)

type BattleActionReport struct {
	_tab flatbuffers.Table
}

func GetRootAsBattleActionReport(buf []byte, offset flatbuffers.UOffsetT) *BattleActionReport {
	n := flatbuffers.GetUOffsetT(buf[offset:])
	x := &BattleActionReport{}
	x.Init(buf, n+offset)
	return x
}

func FinishBattleActionReportBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
	builder.Finish(offset)
}

func GetSizePrefixedRootAsBattleActionReport(buf []byte, offset flatbuffers.UOffsetT) *BattleActionReport {
	n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
	x := &BattleActionReport{}
	x.Init(buf, n+offset+flatbuffers.SizeUint32)
	return x
}

func FinishSizePrefixedBattleActionReportBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
	builder.FinishSizePrefixed(offset)
}

func (rcv *BattleActionReport) Init(buf []byte, i flatbuffers.UOffsetT) {
	rcv._tab.Bytes = buf
	rcv._tab.Pos = i
}

func (rcv *BattleActionReport) Table() flatbuffers.Table {
	return rcv._tab
}

func (rcv *BattleActionReport) Attacker() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *BattleActionReport) MutateAttacker(n int64) bool {
	return rcv._tab.MutateInt64Slot(4, n)
}

func (rcv *BattleActionReport) AttackerShipClass() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *BattleActionReport) MutateAttackerShipClass(n int64) bool {
	return rcv._tab.MutateInt64Slot(6, n)
}

func (rcv *BattleActionReport) Defender() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *BattleActionReport) MutateDefender(n int64) bool {
	return rcv._tab.MutateInt64Slot(8, n)
}

func (rcv *BattleActionReport) DefenderShipClass() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *BattleActionReport) MutateDefenderShipClass(n int64) bool {
	return rcv._tab.MutateInt64Slot(10, n)
}

func (rcv *BattleActionReport) Destroyed() bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
	if o != 0 {
		return rcv._tab.GetBool(o + rcv._tab.Pos)
	}
	return false
}

func (rcv *BattleActionReport) MutateDestroyed(n bool) bool {
	return rcv._tab.MutateBoolSlot(12, n)
}

func BattleActionReportStart(builder *flatbuffers.Builder) {
	builder.StartObject(5)
}
func BattleActionReportAddAttacker(builder *flatbuffers.Builder, attacker int64) {
	builder.PrependInt64Slot(0, attacker, 0)
}
func BattleActionReportAddAttackerShipClass(builder *flatbuffers.Builder, attackerShipClass int64) {
	builder.PrependInt64Slot(1, attackerShipClass, 0)
}
func BattleActionReportAddDefender(builder *flatbuffers.Builder, defender int64) {
	builder.PrependInt64Slot(2, defender, 0)
}
func BattleActionReportAddDefenderShipClass(builder *flatbuffers.Builder, defenderShipClass int64) {
	builder.PrependInt64Slot(3, defenderShipClass, 0)
}
func BattleActionReportAddDestroyed(builder *flatbuffers.Builder, destroyed bool) {
	builder.PrependBoolSlot(4, destroyed, false)
}
func BattleActionReportEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
