30 lines
637 B
Go
Raw Normal View History

2019-02-15 11:25:49 +01:00
package mapobject
import (
"mapserver/mapobjectdb"
2023-12-29 16:00:11 +01:00
"mapserver/types"
2021-10-12 07:44:07 +02:00
"github.com/minetest-go/mapparser"
2019-02-15 11:25:49 +01:00
)
type ATM struct{}
2023-12-29 16:00:11 +01:00
func (this *ATM) onMapObject(mbpos *types.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
switch nodename {
case "atm:wtt", "um_wtt:wtt":
o.Attributes["type"] = "wiretransfer"
case "atm:atm2", "um_atm:atm_2":
o.Attributes["type"] = "atm2"
case "atm:atm3", "um_atm:atm_3":
o.Attributes["type"] = "atm3"
default:
o.Attributes["type"] = "atm"
2019-05-14 09:01:52 +02:00
}
return o
2019-02-15 11:25:49 +01:00
}