|
|
@ -1,5 +1,8 @@
|
|
|
|
package roleplay
|
|
|
|
package roleplay
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type Entity interface {
|
|
|
|
type Entity interface {
|
|
|
|
Tick()
|
|
|
|
Tick()
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -8,22 +11,8 @@ type Instance struct {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////
|
|
|
|
|
|
|
|
// Temporary Code
|
|
|
|
|
|
|
|
//////////////////////////////////////////
|
|
|
|
|
|
|
|
type EntityID int
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var id int = -1
|
|
|
|
|
|
|
|
func NewEntityID() EntityID {
|
|
|
|
|
|
|
|
id += 1
|
|
|
|
|
|
|
|
return EntityID(id)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////
|
|
|
|
|
|
|
|
// End Temporary Code
|
|
|
|
|
|
|
|
//////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type Server struct {
|
|
|
|
type Server struct {
|
|
|
|
entities map[EntityID]Entity
|
|
|
|
entities map[int]Entity
|
|
|
|
instances map[string]Instance
|
|
|
|
instances map[string]Instance
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -32,3 +21,6 @@ func(server Server) Tick() {
|
|
|
|
entity.Tick()
|
|
|
|
entity.Tick()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func(server Server) Listen() {
|
|
|
|
|
|
|
|
}
|
|
|
|