package nodeshape

import (
	
	
	
)

type shapeDiamond struct {
	shape.Shape
}

func ( shapeDiamond) ( LabelTier) map[label.Position]struct{} {
	switch  {
	case Good:
		return map[label.Position]struct{}{
			label.InsideMiddleCenter: {},
		}
	case OK:
		return map[label.Position]struct{}{
			label.OutsideTopCenter:    {},
			label.OutsideBottomCenter: {},
			label.InsideMiddleLeft:    {},
			label.InsideMiddleRight:   {},
			label.OutsideLeftMiddle:   {},
			label.OutsideRightMiddle:  {},
			label.InsideBottomCenter:  {},
			label.InsideTopCenter:     {},
		}
	case Unideal:
		return map[label.Position]struct{}{
			label.InsideTopLeft:     {},
			label.InsideTopRight:    {},
			label.InsideBottomLeft:  {},
			label.InsideBottomRight: {},
		}
	case Bad:
		return map[label.Position]struct{}{
			label.OutsideTopLeft:     {},
			label.OutsideTopRight:    {},
			label.OutsideLeftTop:     {},
			label.OutsideRightTop:    {},
			label.OutsideBottomLeft:  {},
			label.OutsideBottomRight: {},
			label.OutsideLeftBottom:  {},
			label.OutsideRightBottom: {},
		}
	}
	return map[label.Position]struct{}{}
}

func ( shapeDiamond) () [][]*geo.RelativePoint {
	return [][]*geo.RelativePoint{
		// Top
		{
			geo.NewRelativePoint(0.5, 0),
		},
		// Left
		{
			geo.NewRelativePoint(0, 0.5),
		},
		// Bottom
		{
			geo.NewRelativePoint(0.5, 1),
		},
		// Right
		{
			geo.NewRelativePoint(1, 0.5),
		},
	}
}

func ( shapeDiamond) ( geo.Orientation) []int {
	switch  {
	case geo.Top:
		return []int{0}
	case geo.Left:
		return []int{1}
	case geo.Bottom:
		return []int{2}
	case geo.Right:
		return []int{3}
	case geo.TopLeft:
		return []int{0, 1}
	case geo.TopRight:
		return []int{0, 3}
	case geo.BottomLeft:
		return []int{2, 1}
	case geo.BottomRight:
		return []int{2, 3}
	default:
		return []int{}
	}
}

func ( shapeDiamond) () map[int]int {
	return map[int]int{
		// Top and bottom
		0: 2,
		2: 0,
		// Left and right
		1: 3,
		3: 1,
	}
}

func ( shapeDiamond) () []int {
	return []int{0, 1, 2, 3}
}

func ( shapeDiamond) ( geo.Orientation) int {
	 := .CenterPortIndices()
	var  int
	switch  {
	case geo.Top:
		 = 0
	case geo.Left:
		 = 1
	case geo.Bottom:
		 = 2
	case geo.Right:
		 = 3
	default:
		return -1
	}

	return []
}