本文整理汇总了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;
});
示例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,
};
}
示例3: filter
let games = filter(params.games, g => isPlatformCompatible(g));