Skip to content

Commit

Permalink
Game-specific utils and helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoster committed Oct 6, 2015
1 parent d9cb203 commit dcb4511
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/client/lib/gameUtil.js
@@ -0,0 +1,19 @@
define([
'lib/util',
'promise'
], function(util, Promise){

function lastLocationVisit(playerData, tileId) {
var visits = playerData.visits || [];
for(var idx = visits.length -1; idx >= 0; idx--) {
if (visits[idx].id === tileId) {
return visits[idx];
}
}
return null;
}

return {
lastLocationVisit: lastLocationVisit
};
});

0 comments on commit dcb4511

Please sign in to comment.