Preparing code to create the Factions page

This commit is contained in:
Daniel Xie
2016-12-22 11:13:00 -06:00
parent 8239e94a3a
commit 25bf876f4a
2 changed files with 37 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
function Faction(name) {
this.name = name;
this.augmentations = [];
this.information = ""; //Introductory/informational text about the faction
//Player-related properties for faction
this.isMember = false; //Whether player is member
@@ -14,6 +15,10 @@ Faction.prototype.setAugmentations = function(augs) {
}
}
Faction.prototype.setInformation(info) {
this.information = info;
}
Faction.prototype.toJSON = function() {
return Generic_toJSON("Faction", this);
}
@@ -32,6 +37,7 @@ AddToFactions = function(faction) {
Factions[name] = faction;
}
//TODO Add faction information
initFactions = function() {
//Endgame
var Illuminati = new Faction("Illuminati");
@@ -97,4 +103,13 @@ initFactions = function() {
AddToFactions(TianDiHui);
var CyberSec = new Faction("CyberSec");
AddToFactions(CyberSec);
}
//Displays the HTML content for this faction
displayFactionContent = function(faction) {
if (faction.isMember) {
} else {
console.log("Not a member of this faction, cannot display faction information");
}
}