first commit
This commit is contained in:
26
internal/entity/entity.go
Normal file
26
internal/entity/entity.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
pb "a301_game_server/proto/gen/pb"
|
||||
"a301_game_server/pkg/mathutil"
|
||||
)
|
||||
|
||||
// Type identifies the kind of entity.
|
||||
type Type int
|
||||
|
||||
const (
|
||||
TypePlayer Type = iota
|
||||
TypeMob
|
||||
TypeNPC
|
||||
)
|
||||
|
||||
// Entity is anything that exists in the game world.
|
||||
type Entity interface {
|
||||
EntityID() uint64
|
||||
EntityType() Type
|
||||
Position() mathutil.Vec3
|
||||
SetPosition(pos mathutil.Vec3)
|
||||
Rotation() float32
|
||||
SetRotation(rot float32)
|
||||
ToProto() *pb.EntityState
|
||||
}
|
||||
Reference in New Issue
Block a user