@Tsukihime lol! I found those comment useless generally I comment like that and in really order it's permit to make the code 'breathing'
//----------------------------------------------------------------------------
// ○ new function: setNumber
//----------------------------------------------------------------------------
// * It's create the plugin command into number but also permit to add maths
// * conversion.
// * They have multiple options who permit to quick convert your number in
// * math process. Process who are :
// * 'default' or "" : transform the param string in a regular number.
// * 'floor' : round your number to the lowest round. E.g : 3.9 -> 3
// * 'ceil' : round your number to the highest round. E.g : 3.9 -> 4
// * 'round' : round your number to the nearest values. E.g : 5.35 -> 5
// * 'topercent' : convert your number in a Percentage value.
// * 'todecimal' : convert your percent in a decimal value.
// * 'topi' : convert your number in a PI value.
// * 'abs' : return the absolute value of your number
// *
// * You can use this method by doing this.setNumber or $emoji.setNumber.
// * the function works like this :
// * this.setNumber(Plugin_var,ParamName,type,max_number);
// * The definition of these arguments are :
// * Plugin_var : The variable you stored your plugin name.
// * ParamName : The Name of your Param command.
// * Type : Set the Number process you want to do (set to 'default' for reg number).
// * max_number : set the limit of your number (use only for topercent and todecimal).
// * (PS : you can setup a varaible for max_number. E.g : this.maxHP)
//
Emoji.setNumber = function(plugin,param,type,maxNumber){
var number = Number(plugin[param]);
switch(type.toLowerCase()){
// Get the regular number.
default :
return number;
break;
// Get the low round.
case 'floor' :
return Math.floor(number);
break;
// Get the uppest round.
case 'ceil' :
return Math.ceil(number);
break;
// Round to the nearest value.
case 'round' :
return Math.round(number);
break;
// Convert number to percent.
case 'topercent' :
return (number / maxNumber) * 100;
break
// Convert the percent in float number.
case 'todecimal' :
return (number / 100) * maxNumber;
break;
// Convert the number in PI value.
case 'topi' :
return Math.PI(number);
break;
// Return the absolute value of the number.
case 'abs' :
return Math.abs(number);
break;
case 'tocos' :
return Math.cos(number);
break;
case 'tosin' :
return Math.sin(number);
break;
case 'totan' :
return Math.tan(number);
break;
}
};
the comment is the older one but it's nice to have clear comment instead of :