parent
27104a4f33
commit
84b53933ff
@ -51,9 +51,9 @@ m.Template = m.Class({
|
||||
},
|
||||
|
||||
classes: function() {
|
||||
if (!this.get("Identity") || !this.get("Identity/Classes") || !this.get("Identity/Classes/_string"))
|
||||
if (!this.get("Identity"))
|
||||
return undefined;
|
||||
return this.get("Identity/Classes/_string").split(/\s+/);
|
||||
return m.GetIdentityClasses(this._template.Identity);
|
||||
},
|
||||
|
||||
requiredTech: function() {
|
||||
|
@ -85,6 +85,24 @@ m.PickRandom = function(list){
|
||||
return list[Math.floor(Math.random()*list.length)];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an array of all classes for this identity template
|
||||
* (temporarily duplicated from helpers/templates.js)
|
||||
*/
|
||||
m.GetIdentityClasses = function(template)
|
||||
{
|
||||
var classList = [];
|
||||
if (template.Classes && template.Classes._string)
|
||||
classList = classList.concat(template.Classes._string.split(/\s+/));
|
||||
|
||||
if (template.VisibleClasses && template.VisibleClasses._string)
|
||||
classList = classList.concat(template.VisibleClasses._string.split(/\s+/));
|
||||
|
||||
if (template.Rank)
|
||||
classList = classList.concat(template.Rank);
|
||||
return classList;
|
||||
}
|
||||
|
||||
return m;
|
||||
|
||||
}(API3);
|
||||
|
Loading…
Reference in New Issue
Block a user