1
0
forked from MTSR/mapserver

33 lines
617 B
Go
Raw Normal View History

2019-02-15 11:25:49 +01:00
package mapobject
import (
2021-10-12 07:44:07 +02:00
"mapserver/coords"
2019-02-15 11:25:49 +01:00
"mapserver/mapobjectdb"
2021-10-12 07:44:07 +02:00
"github.com/minetest-go/mapparser"
2019-02-15 11:25:49 +01:00
)
type ATM struct{}
2021-10-12 07:44:07 +02:00
func (this *ATM) onMapObject(mbpos *coords.MapBlockCoords, x, y, z int, block *mapparser.MapBlock) *mapobjectdb.MapObject {
2019-05-14 09:01:52 +02:00
nodename := block.GetNodeName(x, y, z)
2021-10-12 07:44:07 +02:00
o := mapobjectdb.NewMapObject(mbpos, x, y, z, "atm")
2019-05-14 09:01:52 +02:00
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
2019-02-15 11:25:49 +01:00
}