package model

import "fmt"

type Manual struct {
	cpuText      string
	ramText      string
	disksizeText string
}

func (m Manual) String() string {
	val := ""
	if m.cpuText != "" {
		val += m.cpuText + "\n"
	}
	if m.ramText != "" {
		val += m.ramText + "\n"
	}
	if m.disksizeText != "" {
		val += m.disksizeText + "\n"
	}
	return val
}

func NewManualBuilder() *ManualBuilder {
	return &ManualBuilder{manual: Manual{}}
}

type ManualBuilder struct {
	manual Manual
}

func (m *ManualBuilder) Reset() {
	m.manual = Manual{}
}

func (m *ManualBuilder) SetHardDisksizeInGB(disksize int) {
	m.manual.disksizeText = fmt.Sprintf("hardDrive as a capacity of %v", disksize)
}

func (m *ManualBuilder) SetRamInGB(ram int) {
	m.manual.ramText = fmt.Sprintf("RAM as a capacity of %v", ram)
}

func (m *ManualBuilder) SetCPU(cpu string) {
	m.manual.cpuText = fmt.Sprintf("CPU is %v", cpu)
}
func (m *ManualBuilder) Build() Manual {
	manual := m.manual
	m.Reset()
	return manual
}
