1 Star 0 Fork 0

wuzpdev/goworld

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
ClientSpace.go 776 Bytes
Copy Edit Raw Blame History
seis authored 2017-08-09 13:41 . fixing lint errors
package main
import (
"fmt"
"sync"
"github.com/xiaonanln/goworld/engine/common"
"github.com/xiaonanln/typeconv"
)
// ClientSpace is the space on client
type ClientSpace struct {
sync.Mutex
owner *ClientBot
ID common.EntityID
Kind int
Attrs clientAttrs
destroyed bool
}
func newClientSpace(owner *ClientBot, entityid common.EntityID, data map[string]interface{}) *ClientSpace {
space := &ClientSpace{
owner: owner,
ID: entityid,
Attrs: data,
}
space.Kind = int(typeconv.Int(data["_K"]))
return space
}
func (space *ClientSpace) String() string {
return fmt.Sprintf("ClientSpace<%d|%s>", space.Kind, space.ID)
}
// Destroy the client space
func (space *ClientSpace) Destroy() {
if space.destroyed {
return
}
space.destroyed = true
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wuzpdev/goworld.git
git@gitee.com:wuzpdev/goworld.git
wuzpdev
goworld
goworld
v0.1.6

Search