-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pulling master to continue coding (#9)
* Fix on build/node_modules folder * Added neighbour detection Behaviour not implemented yet * neighbours get added/merging to the correct builders * Finished implementing neighbours behaviour when placing a new assembler
- Loading branch information
Showing
3 changed files
with
261 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- Make sure this part of the library exists | ||
if not lib then lib = {} end | ||
if not lib.table then lib.table = {} end | ||
|
||
|
||
|
||
function lib.table.hasValue(table, value) | ||
for _,val in pairs(table) do | ||
if value == val then | ||
return true | ||
end | ||
end | ||
|
||
return false | ||
end | ||
|
||
|
||
|
||
function lib.table.isEmpty(t) | ||
return not next(t) | ||
end | ||
|
||
|
||
|
||
function lib.table.areEqual(t1, t2) | ||
if type(t1) ~= 'table' or type(t2) ~= 'table' then | ||
return t1 == t2 | ||
end | ||
for k,v in pairs(t1) do | ||
if not tablesAreEqual(v, t2[k]) then | ||
return false | ||
end | ||
end | ||
for k,v in pairs(t2) do | ||
if not tablesAreEqual(v, t1[k]) then | ||
return false | ||
end | ||
end | ||
return true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters