package internal

import (
	"fmt"
	"golang.source-fellows.com/pattern/command/internal/model"
)

type HomeCommand interface {
	Execute()
}

type LightSwitchCommand struct {
	light *model.Light
}

func NewLightSwitchCommand(light *model.Light) *LightSwitchCommand {
	return &LightSwitchCommand{light: light}
}

func (l LightSwitchCommand) Execute() {
	l.light.ToggleState()
	fmt.Println(l.light)
}

type DoorbellCommand struct {
	doorbell *model.DoorBell
}

func NewDoorbellCommand(doorbell *model.DoorBell) *DoorbellCommand {
	return &DoorbellCommand{doorbell: doorbell}
}

func (d DoorbellCommand) Execute() {
	d.doorbell.ToggleState()
	fmt.Println(d.doorbell)
}
