本文整理汇总了TypeScript中app/core/garland-tools.service.GarlandToolsService.getNode方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.GarlandToolsService.getNode方法的具体用法?TypeScript service.GarlandToolsService.getNode怎么用?TypeScript service.GarlandToolsService.getNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app/core/garland-tools.service.GarlandToolsService
的用法示例。
在下文中一共展示了service.GarlandToolsService.getNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getGatheredBy
protected getGatheredBy(item: any): GatheredBy {
const gatheredBy: GatheredBy = {
icon: '',
stars_tooltip: '',
level: 0,
nodes: []
};
// If it's a node gather (not a fish)
if (item.nodes !== undefined) {
for (const node of item.nodes) {
const details = this.gt.getNode(node);
if (details.type <= 1) {
gatheredBy.icon = 'https://garlandtools.org/db/images/MIN.png';
} else if (details.type < 4) {
gatheredBy.icon = 'https://garlandtools.org/db/images/BTN.png';
} else {
gatheredBy.icon = 'https://garlandtools.org/db/images/FSH.png';
}
gatheredBy.stars_tooltip = this.generateStars(details.stars);
gatheredBy.level = details.lvl;
if (details.areaid !== undefined) {
gatheredBy.nodes.push(details);
}
}
} else {
// If it's a fish, we have to handle it in another way
for (const spot of item.fishingSpots) {
const details = this.gt.getFishingSpot(spot);
gatheredBy.icon = 'https://garlandtools.org/db/images/FSH.png';
if (details.areaid !== undefined) {
gatheredBy.nodes.push(details);
}
gatheredBy.level = details.lvl;
}
}
return gatheredBy;
}