aboutsummaryrefslogtreecommitdiff
path: root/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-05-20 11:37:23 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2017-05-20 11:37:23 -0400
commitc6698dad925e75ffd2ca2f2e30a595d4ce48d240 (patch)
tree226338dc7ee26a6316951554cf953112ba072c76 /gamemode/inventorysystem/shapedinventory/sh_shaped.lua
parent9e0537b0aa417e88a6a61238484ddcef74080ae0 (diff)
downloadartery-c6698dad925e75ffd2ca2f2e30a595d4ce48d240.tar.gz
artery-c6698dad925e75ffd2ca2f2e30a595d4ce48d240.tar.bz2
artery-c6698dad925e75ffd2ca2f2e30a595d4ce48d240.zip
Massive changes I guess
Diffstat (limited to 'gamemode/inventorysystem/shapedinventory/sh_shaped.lua')
-rw-r--r--gamemode/inventorysystem/shapedinventory/sh_shaped.lua20
1 files changed, 0 insertions, 20 deletions
diff --git a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
index 00beb7f..b77f378 100644
--- a/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
+++ b/gamemode/inventorysystem/shapedinventory/sh_shaped.lua
@@ -17,13 +17,10 @@ local function calcposition(dimx,dimy,x,y)
end
local function canfitin(self,x,y,shape)
- print("Checking canfitin, tracker was")
- PrintTable(self.tracker)
for rn,row in ipairs(shape) do
for cn,col in ipairs(row) do
local absx,absy = x + rn - 1, y + cn - 1
local slot = calcposition(self.dimx,self.dimy,absx,absy)
- print("Checking slot", slot)
if col and ((self.tracker[slot] ~= nil) or (absx > self.dimx) or (absy > self.dimy)) then
return false
end
@@ -45,19 +42,13 @@ end
function inv:CanFitIn(tbl,item)
if canfitin(self,tbl[1],tbl[2],item.Shape) then
- print("calculated, and can fit")
return true
else
- print("calculated, could not fit")
return "Could not fit :("
end
end
function inv:Put(tbl,item)
- print("Before putting ", item)
- PrintTable(item)
- print("tracker was")
- PrintTable(self.tracker)
--Set the item's shape to true
for rn,row in ipairs(item.Shape) do
@@ -72,8 +63,6 @@ function inv:Put(tbl,item)
--Now set the item in the correct slot
local slot = calcposition(self.dimx,self.dimy,tbl[1],tbl[2])
self.tracker[slot] = item
- print("After, tracker was ")
- PrintTable(self.tracker)
end
function inv:Has(ptr)
@@ -94,14 +83,8 @@ function inv:Has(ptr)
end
function inv:Remove(tbl)
- print("Removeing from",tbl[1],tbl[2])
local slot = calcposition(self.dimx,self.dimy,tbl[1],tbl[2])
- print("Slot is",slot)
- print("Tracking structure is:")
- PrintTable(self.tracker)
local item = self.tracker[slot]
- print("Removeing item",item)
- PrintTable(item)
self.tracker[slot] = nil
for rn,row in ipairs(item.Shape) do
for cn,col in ipairs(row) do
@@ -111,8 +94,6 @@ function inv:Remove(tbl)
end
end
end
- print("After, tracker was")
- PrintTable(self.tracker)
end
function inv:Get(tbl)
@@ -132,7 +113,6 @@ function inv:Serialize()
end
function inv:DeSerialize(str)
- print("Deserializeing from ", str)
--TODO:Implement
local tbl = util.JSONToTable(str)
for k,v in pairs(tbl) do