github.com/df-mc/dragonfly@v0.9.13/server/item/recipe/shape.go (about)

     1  package recipe
     2  
     3  // Shape make up the shape of a shaped recipe. It consists of a width and a height.
     4  type Shape [2]int
     5  
     6  // Width returns the width of the shape.
     7  func (s Shape) Width() int {
     8  	return s[0]
     9  }
    10  
    11  // Height returns the height of the shape.
    12  func (s Shape) Height() int {
    13  	return s[1]
    14  }
    15  
    16  // NewShape creates a new shape using the provided width and height.
    17  func NewShape(width, height int) Shape {
    18  	return Shape{width, height}
    19  }