Skip to content

Commit

Permalink
Merge main goplus#465 : Reorder func overloads to temp fix the gop co…
Browse files Browse the repository at this point in the history
…mpiler bug
  • Loading branch information
JiepengTan committed Dec 6, 2024
1 parent c171baf commit 7dab5fb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
8 changes: 4 additions & 4 deletions game.go
Original file line number Diff line number Diff line change
Expand Up @@ -1091,19 +1091,19 @@ func (p *Game) StartBackdrop__1(backdrop BackdropName, wait bool) {
p.startBackdrop(backdrop, wait)
}

func (p *Game) StartBackdrop__2(index int) {
func (p *Game) StartBackdrop__2(index float64) {
p.startBackdrop(index, false)
}

func (p *Game) StartBackdrop__3(index int, wait bool) {
func (p *Game) StartBackdrop__3(index float64, wait bool) {
p.startBackdrop(index, wait)
}

func (p *Game) StartBackdrop__4(index float64) {
func (p *Game) StartBackdrop__4(index int) {
p.startBackdrop(index, false)
}

func (p *Game) StartBackdrop__5(index float64, wait bool) {
func (p *Game) StartBackdrop__5(index int, wait bool) {
p.startBackdrop(index, wait)
}

Expand Down
43 changes: 21 additions & 22 deletions sprite.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ type Sprite interface {
IEventSinks
Shape
Main()

Animate(name SpriteAnimationName)
Ask(msg interface{})
BounceOffEdge()
Expand Down Expand Up @@ -108,6 +107,7 @@ type Sprite interface {
IsCloned() bool
Move__0(step float64)
Move__1(step int)
Name() string
NextCostume()
OnCloned__0(onCloned func(data interface{}))
OnCloned__1(onCloned func())
Expand All @@ -130,8 +130,8 @@ type Sprite interface {
Say__0(msg interface{})
Say__1(msg interface{}, secs float64)
SetCostume__0(costume SpriteCostumeName)
SetCostume__1(index int)
SetCostume__2(index float64)
SetCostume__1(index float64)
SetCostume__2(index int)
SetCostume__3(action switchAction)
SetDying()
SetEffect(kind EffectKind, val float64)
Expand All @@ -150,8 +150,8 @@ type Sprite interface {
Size() float64
Stamp()
Step__0(step float64)
Step__1(step int)
Step__2(step float64, animation SpriteAnimationName)
Step__1(step float64, animation SpriteAnimationName)
Step__2(step int)
Think__0(msg interface{})
Think__1(msg interface{}, secs float64)
TimeSinceLevelLoad() float64
Expand All @@ -164,9 +164,9 @@ type Sprite interface {
Turn__2(ti *TurningInfo)
TurnTo__0(sprite Sprite)
TurnTo__1(sprite SpriteName)
TurnTo__2(obj specialObj)
TurnTo__3(degree float64)
TurnTo__4(dir specialDir)
TurnTo__2(degree float64)
TurnTo__3(dir specialDir)
TurnTo__4(obj specialObj)
Visible() bool
Xpos() float64
Ypos() float64
Expand Down Expand Up @@ -679,11 +679,11 @@ func (p *SpriteImpl) SetCostume__0(costume SpriteCostumeName) {
p.setCostume(costume)
}

func (p *SpriteImpl) SetCostume__1(index int) {
func (p *SpriteImpl) SetCostume__1(index float64) {
p.setCostume(index)
}

func (p *SpriteImpl) SetCostume__2(index float64) {
func (p *SpriteImpl) SetCostume__2(index int) {
p.setCostume(index)
}

Expand Down Expand Up @@ -1010,14 +1010,10 @@ func (p *SpriteImpl) Move__1(step int) {

func (p *SpriteImpl) Step__0(step float64) {
animName := p.getStateAnimName(StateStep)
p.Step__2(step, animName)
}

func (p *SpriteImpl) Step__1(step int) {
p.Step__0(float64(step))
p.Step__1(step, animName)
}

func (p *SpriteImpl) Step__2(step float64, animation SpriteAnimationName) {
func (p *SpriteImpl) Step__1(step float64, animation SpriteAnimationName) {
if debugInstr {
log.Println("Step", p.name, step)
}
Expand All @@ -1034,6 +1030,10 @@ func (p *SpriteImpl) Step__2(step float64, animation SpriteAnimationName) {
p.goMoveForward(step)
}

func (p *SpriteImpl) Step__2(step int) {
p.Step__0(float64(step))
}

func (p *SpriteImpl) playDefaultAnim() {
animName := p.defaultAnimation
if p.isVisible {
Expand Down Expand Up @@ -1289,18 +1289,17 @@ func (p *SpriteImpl) TurnTo__1(sprite SpriteName) {
p.turnTo(sprite)
}

func (p *SpriteImpl) TurnTo__2(obj specialObj) {
p.turnTo(obj)
}

func (p *SpriteImpl) TurnTo__3(degree float64) {
func (p *SpriteImpl) TurnTo__2(degree float64) {
p.turnTo(degree)
}

func (p *SpriteImpl) TurnTo__4(dir specialDir) {
func (p *SpriteImpl) TurnTo__3(dir specialDir) {
p.turnTo(dir)
}

func (p *SpriteImpl) TurnTo__4(obj specialObj) {
p.turnTo(obj)
}
func (p *SpriteImpl) SetHeading(dir float64) {
p.setDirection(dir, false)
}
Expand Down

0 comments on commit 7dab5fb

Please sign in to comment.