// NOTE this is a generated file! do not edit!

package multiplayer_ads_bits_reward

import (
	"context"

	"github.com/golang/protobuf/proto"

	eventbus "code.justin.tv/eventbus/client"
)

const (
	CreateEventType = "MultiplayerAdsBitsRewardCreate"
)

type Create = MultiplayerAdsBitsRewardCreate

type MultiplayerAdsBitsRewardCreateHandler func(context.Context, *eventbus.Header, *MultiplayerAdsBitsRewardCreate) error

func (h MultiplayerAdsBitsRewardCreateHandler) Handler() eventbus.Handler {
	return func(ctx context.Context, message eventbus.RawMessage) error {
		dst := &MultiplayerAdsBitsRewardCreate{}
		err := proto.Unmarshal(message.Payload, dst)
		if err != nil {
			return err
		}
		return h(ctx, message.Header, dst)
	}
}

func RegisterMultiplayerAdsBitsRewardCreateHandler(mux *eventbus.Mux, f MultiplayerAdsBitsRewardCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f MultiplayerAdsBitsRewardCreateHandler) {
	RegisterMultiplayerAdsBitsRewardCreateHandler(mux, f)
}

func (*MultiplayerAdsBitsRewardCreate) EventBusName() string {
	return CreateEventType
}
