-
Notifications
You must be signed in to change notification settings - Fork 0
/
game_base.go
80 lines (59 loc) · 1.46 KB
/
game_base.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package happy
import (
"context"
"github.com/cnlisea/happy/proxy"
"time"
)
type GameBase struct {
Ctx context.Context
PMgr proxy.GamePMgr
PMsg proxy.PlayerMsg
Delay proxy.GameDelay
Log proxy.GameLog
}
func (g *GameBase) Init(ctx context.Context, delay proxy.GameDelay, pMgr proxy.GamePMgr, pMsg proxy.PlayerMsg, log proxy.GameLog) error {
g.Ctx = ctx
g.Delay = delay
g.PMgr = pMgr
g.PMsg = pMsg
g.Log = log
return nil
}
func (g *GameBase) PlayerMaxNum() int {
return 0
}
func (g *GameBase) PlayerJoin(userKey interface{}, exist bool, view bool) {}
func (g *GameBase) PlayerOp(userKey interface{}, exist bool, view bool) {}
func (g *GameBase) PlayerExit(userKey interface{}, view bool) {}
func (g *GameBase) PlayerOfflineKickOut() time.Duration {
return 0
}
func (g *GameBase) PlayerAuto(userKey interface{}) {}
func (g *GameBase) Msg(userKey interface{}, data interface{}) {}
func (g *GameBase) Begin(quick bool, round uint32) {}
func (g *GameBase) End() {}
func (g *GameBase) GameEnd() {
panic(PanicGameEnd)
}
func (g *GameBase) Auto() *proxy.GameAuto {
return nil
}
func (g *GameBase) Quick(num int) bool {
return false
}
func (g *GameBase) QuickTs() time.Duration {
return 0
}
func (g *GameBase) View() bool {
return false
}
func (g *GameBase) DisbandTs() time.Duration {
return 2 * time.Minute
}
func (g *GameBase) IpLimit() bool {
return false
}
func (g *GameBase) DistanceLimit() int {
return 0
}
func (g *GameBase) Finish(disband bool) {}