Add contextual resource info

This commit is contained in:
2020-04-17 22:35:42 +03:00
parent 085e499bf8
commit f99a8fce86
3 changed files with 41 additions and 19 deletions

View File

@ -40,20 +40,8 @@ function grabVillageInfo($el): Village {
const id = getNumber(parsedHref.query.newdid);
const name = $el.find('.name').text();
const active = $el.hasClass('active');
const x = getNumber(
$el
.find('.coordinateX')
.text()
.replace('', '-')
.replace(/[^0-9-]/gi, '')
);
const y = getNumber(
$el
.find('.coordinateY')
.text()
.replace('', '-')
.replace(/[^0-9-]/gi, '')
);
const x = getNumber($el.find('.coordinateX').text());
const y = getNumber($el.find('.coordinateY').text());
return new Village(id, name, active, new Coordinates(x, y));
}