Set adds the item to the container and replaces the existing one if found, and returns if the operation was successful
(item item.Item)
| 46 | |
| 47 | // Set adds the item to the container and replaces the existing one if found, and returns if the operation was successful |
| 48 | func (c *Container) Set(item item.Item) { |
| 49 | for x, i := range *c { |
| 50 | if i.Slot == item.Slot { |
| 51 | (*c)[x] = item |
| 52 | return |
| 53 | } |
| 54 | } |
| 55 | *c = append(*c, item) |
| 56 | } |
| 57 | |
| 58 | // Add adds the item to the container and replaces the existing one if found, and returns if the operation was successful |
| 59 | func (c *Container) SetAt(item item.Item, slot item.DataSlot) { |
no outgoing calls
no test coverage detected