|
|
@@ -6,13 +6,13 @@ ItemSlot::ItemSlot(Framework::Text name,
|
|
|
int maxSize,
|
|
|
int pullPriority,
|
|
|
int pushPriority,
|
|
|
- int allowedPullSide,
|
|
|
- int allowedPushSides,
|
|
|
+ Directions allowedPullSides,
|
|
|
+ Directions allowedPushSides,
|
|
|
bool allowHigherStackSize)
|
|
|
: ReferenceCounter(),
|
|
|
items(0),
|
|
|
maxSize(maxSize),
|
|
|
- allowedPullSide(allowedPullSide),
|
|
|
+ allowedPullSides(allowedPullSides),
|
|
|
allowedPushSides(allowedPushSides),
|
|
|
pullPriority(pullPriority),
|
|
|
pushPriority(pushPriority),
|
|
|
@@ -34,7 +34,7 @@ void ItemSlot::setId(int id)
|
|
|
ItemStack* ItemSlot::takeItemsOut(int count, Direction dir)
|
|
|
{
|
|
|
if (!items) return 0;
|
|
|
- if ((dir | allowedPullSide) == allowedPullSide)
|
|
|
+ if ((dir | allowedPullSides) == allowedPullSides)
|
|
|
{
|
|
|
ItemStack* result = items->split(count);
|
|
|
if (items->getSize() == 0)
|
|
|
@@ -199,8 +199,8 @@ ItemSlot* ItemSlotFactory::fromJson(Framework::JSON::JSONObject* zJson) const
|
|
|
= (int)zJson->zValue("pullPriority")->asNumber()->getNumber();
|
|
|
int pushPriority
|
|
|
= (int)zJson->zValue("pushPriority")->asNumber()->getNumber();
|
|
|
- int allowedPullSides = 0;
|
|
|
- int allowedPushSides = 0;
|
|
|
+ Directions allowedPullSides = 0;
|
|
|
+ Directions allowedPushSides = 0;
|
|
|
for (Framework::JSON::JSONValue* side :
|
|
|
*zJson->zValue("allowedPullSides")->asArray())
|
|
|
{
|
|
|
@@ -284,17 +284,17 @@ Framework::JSON::JSONObject* ItemSlotFactory::toJsonObject(
|
|
|
new Framework::JSON::JSONNumber((double)zObject->getPushPriority()));
|
|
|
Framework::JSON::JSONArray* allowedPullSides
|
|
|
= new Framework::JSON::JSONArray();
|
|
|
- if (zObject->allowedPullSide & TOP)
|
|
|
+ if (zObject->allowedPullSides & TOP)
|
|
|
allowedPullSides->addValue(new Framework::JSON::JSONString("TOP"));
|
|
|
- if (zObject->allowedPullSide & BOTTOM)
|
|
|
+ if (zObject->allowedPullSides & BOTTOM)
|
|
|
allowedPullSides->addValue(new Framework::JSON::JSONString("BOTTOM"));
|
|
|
- if (zObject->allowedPullSide & NORTH)
|
|
|
+ if (zObject->allowedPullSides & NORTH)
|
|
|
allowedPullSides->addValue(new Framework::JSON::JSONString("NORTH"));
|
|
|
- if (zObject->allowedPullSide & EAST)
|
|
|
+ if (zObject->allowedPullSides & EAST)
|
|
|
allowedPullSides->addValue(new Framework::JSON::JSONString("EAST"));
|
|
|
- if (zObject->allowedPullSide & SOUTH)
|
|
|
+ if (zObject->allowedPullSides & SOUTH)
|
|
|
allowedPullSides->addValue(new Framework::JSON::JSONString("SOUTH"));
|
|
|
- if (zObject->allowedPullSide & WEST)
|
|
|
+ if (zObject->allowedPullSides & WEST)
|
|
|
allowedPullSides->addValue(new Framework::JSON::JSONString("WEST"));
|
|
|
result->addValue("allowedPullSides", allowedPullSides);
|
|
|
Framework::JSON::JSONArray* allowedPushSides
|