container

package
v0.0.0-...-ed75f63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container []item.Item

A container that holds items

func (Container) Encode

func (c Container) Encode() []slot.Slot

func (Container) EncodeResize

func (c Container) EncodeResize(size int) []slot.Slot

NetworkConvert encodes the container with the specified size and changes the slot from data slots to network slots. This should be used for inventories

func (*Container) Merge

func (c *Container) Merge(slot item.DataSlot, carriedItem *item.Item)

func (*Container) Set

func (c *Container) Set(item item.Item)

Set adds the item to the container and replaces the existing one if found, and returns if the operation was successful

func (*Container) SetAt

func (c *Container) SetAt(item item.Item, slot item.DataSlot)

Add adds the item to the container and replaces the existing one if found, and returns if the operation was successful

func (Container) Slot

func (c Container) Slot(slot item.DataSlot) (item.Item, bool)

finds the item at the specified data slot

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳