diff --git a/README.md b/README.md index 06e4c0ec1..0afd380d0 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,12 @@ TESTING TODO: ctrl+C functionality for all running command like hack(), analyze(), and tail Implemented for hack() and analyze(). Seems to work + Saving/Loading factions + No errors thrown when saving/loading game at the start -Tasks TODO: Scroll all the way down when something is post()ed + +Tasks TODO: Script logging functionality? Logs to internal "log file" (property of script itself) Tutorial and help Secret Servers diff --git a/src/Faction.js b/src/Faction.js index 99a77d9e6..4c26755a0 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -8,17 +8,22 @@ function Faction(name) { this.playerReputation = 0; //"Reputation" within faction }; -//TODO -Faction.prototype.init = function() { - -} - Faction.prototype.setAugmentations = function(augs) { for (var i = 0; i < augs.length; i++) { this.augmentations.push(augs[i]); } } +Faction.prototype.toJSON = function() { + return Generic_toJSON("Faction", this); +} + +Faction.fromJSON = function(value) { + return Generic_fromJSON(Faction, value.data); +} + +Reviver.constructors.Faction = Faction; + //Map of factions indexed by faction name Factions = {} diff --git a/src/Terminal.js b/src/Terminal.js index 236e8c489..49c1ddd13 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -1,18 +1,25 @@ //Terminal + +/* Write text to terminal */ var post = function(input) { $("#terminal-input").before('