Files
zombie/command.go
T

32 lines
589 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()
}