45 lines
1.0 KiB
JavaScript
45 lines
1.0 KiB
JavaScript
|
|
// DEBUGGING TOOLS ///////////////////////////////////////////////////
|
|
// meant to be used from browser debugger tools and the like.
|
|
|
|
window.debug = function() {}
|
|
|
|
window.debug.renderDetails = function() {
|
|
console.log('portals: ' + Object.keys(portals).length);
|
|
console.log('links: ' + Object.keys(links).length);
|
|
console.log('fields: ' + Object.keys(fields).length);
|
|
}
|
|
|
|
window.debug.printStackTrace = function() {
|
|
var e = new Error('dummy');
|
|
console.log(e.stack);
|
|
}
|
|
|
|
window.debug.clearPortals = function() {
|
|
for(var i = 0; i < portalsLayers.length; i++)
|
|
portalsLayers[i].clearLayers();
|
|
}
|
|
|
|
window.debug.clearLinks = function() {
|
|
linksLayer.clearLayers();
|
|
}
|
|
|
|
window.debug.clearFields = function() {
|
|
fieldsLayer.clearLayers();
|
|
}
|
|
|
|
window.debug.getFields = function() {
|
|
return fields;
|
|
}
|
|
|
|
window.debug.forceSync = function() {
|
|
localStorage.clear();
|
|
window.playersToResolve = [];
|
|
window.playersInResolving = [];
|
|
debug.clearFields();
|
|
debug.clearLinks();
|
|
debug.clearPortals();
|
|
updateGameScore();
|
|
requestData();
|
|
}
|