Created
May 8, 2015 22:16
-
-
Save EliteMasterEric/a14de1a12a09dfc4fe91 to your computer and use it in GitHub Desktop.
Source Memory for Screeps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This module allows you to store memory in energy sources, | |
| similarly to other objects like spawns and creeps. | |
| It can even by accessed by the source.memory alias! | |
| To use this in your code, add this line to the top of main: | |
| var SourceMemory = require("SourceMemory"); | |
| */ | |
| //Creating source memory... | |
| console.log("Creating source memory..."); | |
| //Create memory for energy sources. | |
| if(Memory.sources == undefined) | |
| Memory.sources = { }; | |
| Source.prototype.memory = Memory.sources[this.id]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment