Skip to content

Commit

Permalink
Updated dist and version.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Jul 27, 2021
1 parent 73a4258 commit c7cdb11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions dist/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1527,9 +1527,10 @@ FunctionUtil = {

bind: function(func, scope)
{
var args = FunctionUtil.args(arguments, 2);
var argsBinded = FunctionUtil.args(arguments, 2);
return function() {
var result = FunctionUtil.call.apply(null, [func, scope].concat(args));
var args = FunctionUtil.args(arguments);
var result = FunctionUtil.call.apply(null, [func, scope].concat(argsBinded).concat(args));
return result;
};
},
Expand Down Expand Up @@ -2447,6 +2448,15 @@ RandomUtil = {
return Math.floor(Math.round(RandomUtil.float(min - 0.5, max + 0.5)));
},

map: function(func, count)
{
var m = [];
for (var i = 0; i < count; i++) {
m.push(func(i));
}
return m;
},

sign: function(chance)
{
return (RandomUtil.boolean(chance) ? 1 : -1);
Expand Down
Loading

0 comments on commit c7cdb11

Please sign in to comment.