Skip to content

Commit

Permalink
cItemGrid: Allocate storage lazily (cuberite#4083)
Browse files Browse the repository at this point in the history
* cItemGrid: Allocate storage lazily
* cItemGrid: Fix spelling, Prioritary -> Priority
  • Loading branch information
peterbell10 authored Jan 21, 2018
1 parent cd88a11 commit ab350d1
Show file tree
Hide file tree
Showing 5 changed files with 261 additions and 91 deletions.
8 changes: 4 additions & 4 deletions Server/Plugins/APIDump/APIDesc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7213,7 +7213,7 @@ This class represents a 2D array of items. It is used as the underlying storage
IsOptional = true,
},
{
Name = "PrioritarySlot",
Name = "PrioritySlot",
Type = "number",
IsOptional = true,
},
Expand All @@ -7224,7 +7224,7 @@ This class represents a 2D array of items. It is used as the underlying storage
Type = "number",
},
},
Notes = "Adds as many items out of ItemStack as can fit. If AllowNewStacks is set to false, only existing stacks can be topped up. If AllowNewStacks is set to true (default), empty slots can be used for the rest. If PrioritarySlot is set to a non-negative value, then the corresponding slot will be used first (if empty or compatible with added items). If PrioritarySlot is set to -1 (default), regular order applies. Returns the number of items that fit.",
Notes = "Adds as many items out of ItemStack as can fit. If AllowNewStacks is set to false, only existing stacks can be topped up. If AllowNewStacks is set to true (default), empty slots can be used for the rest. If PrioritySlot is set to a non-negative value, then the corresponding slot will be used first (if empty or compatible with added items). If PrioritySlot is set to -1 (default), regular order applies. Returns the number of items that fit.",
},
AddItems =
{
Expand All @@ -7240,7 +7240,7 @@ This class represents a 2D array of items. It is used as the underlying storage
IsOptional = true,
},
{
Name = "PrioritarySlot",
Name = "PrioritySlot",
Type = "number",
IsOptional = true,
},
Expand All @@ -7251,7 +7251,7 @@ This class represents a 2D array of items. It is used as the underlying storage
Type = "number",
},
},
Notes = "Same as AddItem, but works on an entire list of item stacks. The a_ItemStackList is modified to reflect the leftover items. If a_AllowNewStacks is set to false, only existing stacks can be topped up. If AllowNewStacks is set to true, empty slots can be used for the rest. If PrioritarySlot is set to a non-negative value, then the corresponding slot will be used first (if empty or compatible with added items). If PrioritarySlot is set to -1 (default), regular order applies. Returns the total number of items that fit.",
Notes = "Same as AddItem, but works on an entire list of item stacks. The a_ItemStackList is modified to reflect the leftover items. If a_AllowNewStacks is set to false, only existing stacks can be topped up. If AllowNewStacks is set to true, empty slots can be used for the rest. If PrioritySlot is set to a non-negative value, then the corresponding slot will be used first (if empty or compatible with added items). If PrioritySlot is set to -1 (default), regular order applies. Returns the total number of items that fit.",
},
ChangeSlotCount =
{
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ SET (HDRS
Inventory.h
Item.h
ItemGrid.h
LazyArray.h
LightingThread.h
LineBlockTracer.h
LinearInterpolation.h
Expand Down
Loading

0 comments on commit ab350d1

Please sign in to comment.