当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript is-platform-compatible.isPlatformCompatible函数代码示例

本文整理汇总了TypeScript中common/util/is-platform-compatible.isPlatformCompatible函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isPlatformCompatible函数的具体用法?TypeScript isPlatformCompatible怎么用?TypeScript isPlatformCompatible使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: filter

    set = filter(set, g => {
      if (!g) {
        return false;
      }

      if (prefs.onlyCompatibleGames && !isPlatformCompatible(g)) {
        return false;
      }
      if (
        prefs.onlyInstalledGames &&
        !installedSet[g.id] &&
        !downloadSet[g.id]
      ) {
        return false;
      }
      if (prefs.onlyOwnedGames && !ownedSet[g.id]) {
        return false;
      }

      return true;
    });
开发者ID:HorrerGames,项目名称:itch,代码行数:21,代码来源:sort-and-filter.ts

示例2: rawGetGameStatus

function rawGetGameStatus(
  game: Game,
  cave: CaveSummary,
  numCaves: number,
  downloadKey: DownloadKeySummary,
  pressUser: boolean,
  task: Task,
  download: Download,
  downloadProgress: DownloadProgress,
  update: GameUpdate,
  isDownloadActive: boolean,
  areDownloadsPaused: boolean,
  profileId: number
): GameStatus {
  let access = Access.None;

  if (game.userId == profileId) {
    access = Access.Edit;
  } else {
    const hasPrice = game.minPrice > 0;
    if (!hasPrice) {
      if (game.canBeBought) {
        access = Access.Pwyw;
      } else {
        access = Access.Free;
      }
    } else {
      // game has minimum price
      if (downloadKey) {
        // we have download keys
        access = Access.Key;
      } else {
        // we have no download keys
        if (game.inPressSystem && pressUser) {
          access = Access.Press;
        } else {
          // we have.. nothing
        }
      }
    }
  }

  let operation: Operation = null;

  if (task) {
    operation = {
      type: OperationType.Task,
      name: task.name,
      active: true,
      paused: false,
      progress: task.progress,
      eta: task.eta,
      bps: task.bps,
    };
  } else if (download) {
    let p = downloadProgress || {
      progress: null,
      eta: null,
      bps: null,
      stage: null,
    };
    operation = {
      type: OperationType.Download,
      id: download.id,
      reason: download.reason,
      active: isDownloadActive,
      paused: areDownloadsPaused,
      progress: p.progress,
      eta: p.eta,
      bps: p.bps,
      stage: p.stage,
    };
  }

  const compatible = isPlatformCompatible(game);
  return {
    cave,
    numCaves,
    downloadKey,
    access,
    operation,
    update,
    compatible,
  };
}
开发者ID:itchio,项目名称:itch,代码行数:85,代码来源:get-game-status.ts

示例3: filter

 let games = filter(params.games, g => isPlatformCompatible(g));
开发者ID:HorrerGames,项目名称:itch,代码行数:1,代码来源:index.ts


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