package model

type Builder interface {
	SetHardDisksizeInGB(disksize int)
	SetRamInGB(ram int)
	SetCPU(cpu string)
	Reset()
}

type Computer struct {
	cpu      string
	ram      int
	disksize int
}

func NewComputerBuilder() *ComputerBuilder {
	return &ComputerBuilder{computer: Computer{}}
}

type ComputerBuilder struct {
	computer Computer
}

func (c *ComputerBuilder) Reset() {
	c.computer = Computer{}
}

func (c *ComputerBuilder) SetHardDisksizeInGB(disksize int) {
	c.computer.disksize = disksize
}

func (c *ComputerBuilder) SetRamInGB(ram int) {
	c.computer.ram = ram
}

func (c *ComputerBuilder) SetCPU(cpu string) {
	c.computer.cpu = cpu
}

func (c *ComputerBuilder) Build() Computer {
	comp := c.computer
	c.Reset()
	return comp
}
