File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -491,6 +491,29 @@ function utils.get_game_state()
491491 }
492492end
493493
494+ -- ==========================================================================
495+ -- Utility Functions
496+ -- ==========================================================================
497+
498+ function utils .sets_equal (list1 , list2 )
499+ if # list1 ~= # list2 then
500+ return false
501+ end
502+
503+ local set = {}
504+ for _ , v in ipairs (list1 ) do
505+ set [v ] = true
506+ end
507+
508+ for _ , v in ipairs (list2 ) do
509+ if not set [v ] then
510+ return false
511+ end
512+ end
513+
514+ return true
515+ end
516+
494517-- ==========================================================================
495518-- Debugging Utilities
496519-- ==========================================================================
You can’t perform that action at this time.
0 commit comments