package main

import (
	"fmt"
	"golang.source-fellows.com/solid/srp"
	"golang.source-fellows.com/solid/srp/output/html"
	"golang.source-fellows.com/solid/srp/tax"
	"os"
)

func main() {

	p2 := srp.Product{Name: "Goldbären", Price: 0.85}

	// Polymorphic TaxCalculator
	var taxCalculator = tax.NewTaxCalculator("FR")

	fmt.Println(taxCalculator(p2))

	pos := []srp.Position{srp.Position{
		Count:   1,
		Product: p2,
	}}
	sc := srp.ShoppingCard{Positions: pos}
	fmt.Println(sc.Price(taxCalculator))

	// Interface-based HTML Renderer
	var renderer = &html.Renderer{}
	fmt.Println(renderer.GetRepresentation(p2, os.Stdout))

}
