33 lines
615 B
Go
33 lines
615 B
Go
package mapobject
|
|
|
|
import (
|
|
"mapserver/mapobjectdb"
|
|
"mapserver/types"
|
|
|
|
"github.com/minetest-go/mapparser"
|
|
)
|
|
|
|
type ATM struct{}
|
|
|
|
func (this *ATM) onMapObject(mbpos *types.MapBlockCoords, x, y, z int, block *mapparser.MapBlock) *mapobjectdb.MapObject {
|
|
nodename := block.GetNodeName(x, y, z)
|
|
|
|
o := mapobjectdb.NewMapObject(mbpos, x, y, z, "atm")
|
|
|
|
if nodename == "atm:wtt" {
|
|
o.Attributes["type"] = "wiretransfer"
|
|
|
|
} else if nodename == "atm:atm2" {
|
|
o.Attributes["type"] = "atm2"
|
|
|
|
} else if nodename == "atm:atm3" {
|
|
o.Attributes["type"] = "atm3"
|
|
|
|
} else {
|
|
o.Attributes["type"] = "atm"
|
|
|
|
}
|
|
|
|
return o
|
|
}
|