Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reorder func overloads #467

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions game.go
Original file line number Diff line number Diff line change
Expand Up @@ -1187,19 +1187,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
42 changes: 21 additions & 21 deletions sprite.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,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 @@ -196,8 +196,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)
Touching__0(sprite SpriteName) bool
Expand All @@ -209,9 +209,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 @@ -745,11 +745,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 @@ -1138,14 +1138,10 @@ func (p *SpriteImpl) Move__1(step int) {

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

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

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 @@ -1162,6 +1158,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 @@ -1413,18 +1413,18 @@ 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
Loading