• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript garland-tools.service.GarlandToolsService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中app/core/garland-tools.service.GarlandToolsService的典型用法代码示例。如果您正苦于以下问题:TypeScript service.GarlandToolsService类的具体用法?TypeScript service.GarlandToolsService怎么用?TypeScript service.GarlandToolsService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了service.GarlandToolsService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: getCraftedBy

 protected getCraftedBy(item: any): Observable<CraftedBy[]> {
     const result = [];
     for (const craft of item.craft) {
         const craftedBy: CraftedBy = {
             itemId: item.id,
             icon: `https://secure.xivdb.com/img/classes/set2/${this.gt.getJob(craft.job).name.toLowerCase()}.png`,
             level: craft.lvl,
             stars_tooltip: this.generateStars(craft.stars)
         };
         if (craft.job === 0) {
             craftedBy.icon = '';
         }
         if (craft.unlockId !== undefined) {
             result.push(this.db.getItem(craft.unlockId).map(masterbook => {
                 craftedBy.masterbook = {
                     name: this.getI18nName(masterbook.item),
                     id: masterbook.item.id
                 };
                 return craftedBy;
             }));
         } else {
             result.push(Observable.of(craftedBy));
         }
     }
     return Observable.combineLatest(result);
 }
开发者ID:aluink,项目名称:ffxiv-teamcraft,代码行数:26,代码来源:list-manager.service.ts


示例2:

 .map(data => {
     tradeSource.npcName = data.npc.name;
     if (data.npc.zoneid === undefined) {
         return undefined;
     }
     tradeSource.zoneName = this.gt.getLocation(data.npc.zoneid).name;
     return tradeSource as TradeSource;
 });
开发者ID:aluink,项目名称:ffxiv-teamcraft,代码行数:8,代码来源:list-manager.service.ts


示例3: 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;
 }
开发者ID:aluink,项目名称:ffxiv-teamcraft,代码行数:37,代码来源:list-manager.service.ts


示例4: addCraft

 protected addCraft(additions: CraftAddition[], list: List): List {
     const nextIteration: CraftAddition[] = [];
     for (const addition of additions) {
         for (const element of addition.item.craft[0].ingredients) {
             // If this is a crystal
             if (element.id < 20 && element.id > 1) {
                 const crystal = this.gt.getCrystalDetails(element.id);
                 this.add(list.crystals, {
                     id: element.id,
                     name: this.getI18nName(crystal),
                     icon: this.getIcon(crystal),
                     amount: element.amount * addition.amount,
                     done: 0,
                     yield: 1,
                     addedAt: Date.now()
                 });
             } else {
                 const elementDetails = this.getRelated(addition.data, element.id);
                 if (elementDetails.craft !== undefined) {
                     const yields = elementDetails.craft[0].yield || 1;
                     const amount = Math.ceil(element.amount * addition.amount / yields);
                     this.add(list.preCrafts, {
                         id: elementDetails.id,
                         icon: this.getIcon(elementDetails),
                         amount: amount,
                         requires: elementDetails.craft[0].ingredients,
                         done: 0,
                         name: this.getI18nName(elementDetails),
                         yield: yields,
                         addedAt: Date.now()
                     });
                     nextIteration.push({
                         item: elementDetails,
                         data: addition.data,
                         amount: amount
                     });
                 } else if (elementDetails.nodes !== undefined || elementDetails.fishingSpots !== undefined) {
                     this.add(list.gathers, {
                         id: elementDetails.id,
                         icon: this.getIcon(elementDetails),
                         amount: element.amount * addition.amount,
                         done: 0,
                         name: this.getI18nName(elementDetails),
                         yield: 1,
                         addedAt: Date.now()
                     });
                 } else {
                     this.add(list.others, {
                         id: elementDetails.id,
                         icon: this.getIcon(elementDetails),
                         amount: element.amount * addition.amount,
                         done: 0,
                         name: this.getI18nName(elementDetails),
                         yield: 1,
                         addedAt: Date.now()
                     });
                 }
             }
         }
     }
     if (nextIteration.length > 0) {
         return this.addCraft(nextIteration, list);
     }
     return list;
 }
开发者ID:aluink,项目名称:ffxiv-teamcraft,代码行数:65,代码来源:list-manager.service.ts



注:本文中的app/core/garland-tools.service.GarlandToolsService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript i18n.t函数代码示例发布时间:2022-05-25
下一篇:
TypeScript core_module.service函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap