-
Notifications
You must be signed in to change notification settings - Fork 0
/
World.js
25 lines (25 loc) · 973 Bytes
/
World.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
exports.__esModule = true;
function world_object_counter(object, state) {
for (var i in state.objects) {
var obj1 = state.objects[i];
if (obj1 == object)
continue;
if (obj1.form == object.form && obj1.color == object.color && obj1.size == object.size) {
//console.log(`${obj1.toString()} and ${object.toString()}`)
return 2; // no need to check if more than two similar objects
}
}
return 1;
}
exports.world_object_counter = world_object_counter;
});