package executor

import (
	"fmt"

	log "github.com/33cn/chain33/common/log/log15"
	"github.com/33cn/chain33/plugin/dapp/${CLASSNAME}/ptypes"
	drivers "github.com/33cn/chain33/system/dapp"
	"github.com/33cn/chain33/types"
)

var (
	ptylog = log.New("module", "execs.${CLASSNAME}")
)

var driverName = ptypes.${CLASSNAME}X

func init() {
	ety := types.LoadExecutorType(driverName)
	ety.InitFuncList(types.ListMethod(&${CLASSNAME}{}))
}

func Init(name string) {
	drivers.Register(GetName(), newGame, 0)
}

type ${CLASSNAME} struct {
	drivers.DriverBase
}

func new${CLASSNAME}() drivers.Driver {
	t := &${CLASSNAME}{}
	t.SetChild(t)
	t.SetExecutorType(types.LoadExecutorType(driverName))
	return t
}

func GetName() string {
	return new${CLASSNAME}().GetName()
}

func (u *${CLASSNAME}) GetDriverName() string {
	return driverName
}
