Example #1
0
func NewTeam(conn interface{}, tt TeamType) *Team {
	t := Team{
		ID:            <-go4game.IdGenCh,
		GameObjs:      make(map[int64]*GameObject, 10),
		Color:         rand.Intn(0x1000000),
		PacketStat:    *go4game.NewActionStat(),
		CollisionStat: *go4game.NewActionStat(),
		NearStat:      *go4game.NewActionStat(),
		Type:          tt,
	}
	t.SetType(tt)
	if conn != nil {
		t.AddConn(conn)
	}
	return &t
}
Example #2
0
func NewActionPoint() *ActionPoint {
	r := ActionPoint{}
	for i := ActionAccel; i < ActionEnd; i++ {
		r.as[i] = *go4game.NewActionStat()
	}
	return &r
}