starting to refactor the code in multiple packages
This commit is contained in:
27
internal/gmgr/gomgr.go
Normal file
27
internal/gmgr/gomgr.go
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package gmgr
|
||||||
|
|
||||||
|
type player struct {
|
||||||
|
id int
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func newPlayer(id int, name string) *player {
|
||||||
|
return &player{id: id, name: name}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *player) Id() int {
|
||||||
|
return p.id
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *player) Name() string {
|
||||||
|
return p.name
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *player) SetName(name string) {
|
||||||
|
p.name = name
|
||||||
|
}
|
||||||
|
|
||||||
|
type lobby struct {
|
||||||
|
id int
|
||||||
|
teams []player
|
||||||
|
}
|
Reference in New Issue
Block a user