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

@ -58,19 +58,19 @@
<a href="#" id="active-scripts-menu-link"> Active Scripts </a>
</li>
<li class="world-tab" style="visibility:hidden">
<li class="world-tab">
<a href="#" id="world-menu-link"> World </a>
</li>
<li class="create-program-tab" style="visibility:hidden">
<li class="create-program-tab">
<a href="#" id="create-program-menu-link"> Create Program </a>
</li>
<li class="factions-tab" style="visibility:hidden">
<li class="factions-tab">
<a href="#" id="factions-menu-link"> Factions </a>
</li>
<li class="augmentations-tab" style="visiblity:hidden">
<li class="augmentations-tab">
<a href="#" id="augmentations-menu-link"> Augmentations </a>
</li>
@ -119,10 +119,26 @@
<!-- Active scripts info page -->
<div id="active-scripts-container">
<ul class="active-scripts-list" id="active-scripts-list">
<ul>
</ul>
</div>
<!-- World -->
<!-- Create a program(executable) -->
<!-- Factions -->
<div id="factions-container">
<ul class="active-scripts-list" id="active-scripts-list">
</ul>
</div>
<!-- Single Faction info (when you select a faction from the Factions menu) -->
<div id="faction-container">
</div>
<!-- Installed augmentations -->
</body>
</html>

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");
}
}