Skip to content

Commit 1ac28b8

Browse files
authored
refactor: reorder func overloads (#467)
This is a workaround for #465. Signed-off-by: Aofei Sheng <[email protected]>
1 parent 971e4a0 commit 1ac28b8

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

game.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,19 +1187,19 @@ func (p *Game) StartBackdrop__1(backdrop BackdropName, wait bool) {
11871187
p.startBackdrop(backdrop, wait)
11881188
}
11891189

1190-
func (p *Game) StartBackdrop__2(index int) {
1190+
func (p *Game) StartBackdrop__2(index float64) {
11911191
p.startBackdrop(index, false)
11921192
}
11931193

1194-
func (p *Game) StartBackdrop__3(index int, wait bool) {
1194+
func (p *Game) StartBackdrop__3(index float64, wait bool) {
11951195
p.startBackdrop(index, wait)
11961196
}
11971197

1198-
func (p *Game) StartBackdrop__4(index float64) {
1198+
func (p *Game) StartBackdrop__4(index int) {
11991199
p.startBackdrop(index, false)
12001200
}
12011201

1202-
func (p *Game) StartBackdrop__5(index float64, wait bool) {
1202+
func (p *Game) StartBackdrop__5(index int, wait bool) {
12031203
p.startBackdrop(index, wait)
12041204
}
12051205

sprite.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ type Sprite interface {
176176
Say__0(msg interface{})
177177
Say__1(msg interface{}, secs float64)
178178
SetCostume__0(costume SpriteCostumeName)
179-
SetCostume__1(index int)
180-
SetCostume__2(index float64)
179+
SetCostume__1(index float64)
180+
SetCostume__2(index int)
181181
SetCostume__3(action switchAction)
182182
SetDying()
183183
SetEffect(kind EffectKind, val float64)
@@ -196,8 +196,8 @@ type Sprite interface {
196196
Size() float64
197197
Stamp()
198198
Step__0(step float64)
199-
Step__1(step int)
200-
Step__2(step float64, animation SpriteAnimationName)
199+
Step__1(step float64, animation SpriteAnimationName)
200+
Step__2(step int)
201201
Think__0(msg interface{})
202202
Think__1(msg interface{}, secs float64)
203203
Touching__0(sprite SpriteName) bool
@@ -209,9 +209,9 @@ type Sprite interface {
209209
Turn__2(ti *TurningInfo)
210210
TurnTo__0(sprite Sprite)
211211
TurnTo__1(sprite SpriteName)
212-
TurnTo__2(obj specialObj)
213-
TurnTo__3(degree float64)
214-
TurnTo__4(dir specialDir)
212+
TurnTo__2(degree float64)
213+
TurnTo__3(dir specialDir)
214+
TurnTo__4(obj specialObj)
215215
Visible() bool
216216
Xpos() float64
217217
Ypos() float64
@@ -745,11 +745,11 @@ func (p *SpriteImpl) SetCostume__0(costume SpriteCostumeName) {
745745
p.setCostume(costume)
746746
}
747747

748-
func (p *SpriteImpl) SetCostume__1(index int) {
748+
func (p *SpriteImpl) SetCostume__1(index float64) {
749749
p.setCostume(index)
750750
}
751751

752-
func (p *SpriteImpl) SetCostume__2(index float64) {
752+
func (p *SpriteImpl) SetCostume__2(index int) {
753753
p.setCostume(index)
754754
}
755755

@@ -1138,14 +1138,10 @@ func (p *SpriteImpl) Move__1(step int) {
11381138

11391139
func (p *SpriteImpl) Step__0(step float64) {
11401140
animName := p.getStateAnimName(StateStep)
1141-
p.Step__2(step, animName)
1141+
p.Step__1(step, animName)
11421142
}
11431143

1144-
func (p *SpriteImpl) Step__1(step int) {
1145-
p.Step__0(float64(step))
1146-
}
1147-
1148-
func (p *SpriteImpl) Step__2(step float64, animation SpriteAnimationName) {
1144+
func (p *SpriteImpl) Step__1(step float64, animation SpriteAnimationName) {
11491145
if debugInstr {
11501146
log.Println("Step", p.name, step)
11511147
}
@@ -1162,6 +1158,10 @@ func (p *SpriteImpl) Step__2(step float64, animation SpriteAnimationName) {
11621158
p.goMoveForward(step)
11631159
}
11641160

1161+
func (p *SpriteImpl) Step__2(step int) {
1162+
p.Step__0(float64(step))
1163+
}
1164+
11651165
func (p *SpriteImpl) playDefaultAnim() {
11661166
animName := p.defaultAnimation
11671167
if p.isVisible {
@@ -1413,18 +1413,18 @@ func (p *SpriteImpl) TurnTo__1(sprite SpriteName) {
14131413
p.turnTo(sprite)
14141414
}
14151415

1416-
func (p *SpriteImpl) TurnTo__2(obj specialObj) {
1417-
p.turnTo(obj)
1418-
}
1419-
1420-
func (p *SpriteImpl) TurnTo__3(degree float64) {
1416+
func (p *SpriteImpl) TurnTo__2(degree float64) {
14211417
p.turnTo(degree)
14221418
}
14231419

1424-
func (p *SpriteImpl) TurnTo__4(dir specialDir) {
1420+
func (p *SpriteImpl) TurnTo__3(dir specialDir) {
14251421
p.turnTo(dir)
14261422
}
14271423

1424+
func (p *SpriteImpl) TurnTo__4(obj specialObj) {
1425+
p.turnTo(obj)
1426+
}
1427+
14281428
func (p *SpriteImpl) SetHeading(dir float64) {
14291429
p.setDirection(dir, false)
14301430
}

0 commit comments

Comments
 (0)