new reduced map data: first pass at loading the new format

This commit is contained in:
Jon Atkins
2013-11-30 04:15:17 +00:00
parent 20b4a10347
commit b9c8e9c6c5
8 changed files with 61 additions and 351 deletions

View File

@ -8,8 +8,14 @@
// given the entity detail data, returns the team the entity belongs
// to. Uses TEAM_* enum values.
window.getTeam = function(details) {
return teamStringToId(details.controllingTeam.team);
}
window.teamStringToId = function(teamStr) {
var team = TEAM_NONE;
if(details.controllingTeam.team === 'ALIENS' || details.controllingTeam.team === 'ENLIGHTENED') team = TEAM_ENL;
if(details.controllingTeam.team === 'RESISTANCE') team = TEAM_RES;
if(teamStr === 'ENLIGHTENED') team = TEAM_ENL;
if(teamStr === 'RESISTANCE') team = TEAM_RES;
return team;
}