mirror of
https://github.com/wahyd4/zombie.git
synced 2026-08-09 04:35:54 +10:00
32 lines
594 B
Go
32 lines
594 B
Go
package zombie
|
|
|
|
import "github.com/wahyd4/zombie/models"
|
|
|
|
type MoveCommand interface {
|
|
Execute(zombie *models.Zombie)
|
|
}
|
|
|
|
|
|
type MoveUpCommand struct {}
|
|
|
|
func (command *MoveUpCommand) Execute(zombie *models.Zombie) {
|
|
zombie.MoveUp()
|
|
}
|
|
|
|
type MoveDownCommand struct {}
|
|
|
|
func (command *MoveDownCommand) Execute(zombie *models.Zombie) {
|
|
zombie.MoveDown()
|
|
}
|
|
|
|
type MoveLeftCommand struct {}
|
|
|
|
func (command *MoveLeftCommand) Execute(zombie *models.Zombie) {
|
|
zombie.MoveLeft()
|
|
}
|
|
|
|
type MoveRightCommand struct {}
|
|
|
|
func (command *MoveRightCommand) Execute(zombie *models.Zombie) {
|
|
zombie.MoveRight()
|
|
} |