첩보를 join '|' 에서 json dict로 변경

This commit is contained in:
2018-07-07 04:39:44 +09:00
parent a556877a17
commit 837db5183e
11 changed files with 119 additions and 91 deletions
+1 -13
View File
@@ -119,23 +119,11 @@ function reloadWorldMap(option){
};
}
function convertSpyList(arr){
var result = [];
arr.forEach(function(v){
var cityId = (v / 10) | 0;
var spy = v % 10;
result[cityId] = spy;
});
return result;
}
var cityList = obj.cityList.map(toCityObj);
var nationList = obj.nationList.map(toNationObj);
nationList = convertDictById(nationList); //array of object -> dict
var spyList = convertSpyList(obj.spyList);//Array -> Dict
var spyList = obj.spyList;
var shownByGeneralList = convertSet(obj.shownByGeneralList);//Array -> Set
var myCity = obj.myCity;