Skip to content

Instantly share code, notes, and snippets.

@akrennmair
Created July 5, 2011 21:23
type Boat struct {
Vehicle
}
func(b *Boat) Accelerate(delta uint) {
b.Vehicle.speed += int(delta)
}
func(b *Boat) Brake(delta uint) {
b.Vehicle.speed -= int(delta)
}
func NewBoat() Drivable {
b := new(Boat)
b.Vehicle.speed = 0
return b
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment