feat 初次提交
This commit is contained in:
25
internal/npc/npc.go
Normal file
25
internal/npc/npc.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package npc
|
||||
|
||||
import (
|
||||
"common/proto/ss/grpc_pb"
|
||||
)
|
||||
|
||||
// NPCNode 定义NPC节点
|
||||
type NPCNode struct {
|
||||
USN int64 // 用户ID
|
||||
GatewaySID int64 // 网关服务ID
|
||||
|
||||
Position [2]float64 // 二维坐标 [x, y]
|
||||
MoveCross int8 // 移动十字,1 上 2 下 4 左 8 右
|
||||
Action []*grpc_pb.ActionReq // 其他操作
|
||||
}
|
||||
|
||||
func NewNPCNode(gatewaySID int64, usn int64) *NPCNode {
|
||||
return &NPCNode{
|
||||
USN: usn,
|
||||
GatewaySID: gatewaySID,
|
||||
Position: [2]float64{0, 0},
|
||||
MoveCross: 0,
|
||||
Action: make([]*grpc_pb.ActionReq, 0),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user