Add link to send resources

This commit is contained in:
2020-04-16 18:26:16 +03:00
parent c341c7d794
commit 342a0ec7b3
2 changed files with 38 additions and 2 deletions
src

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