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