Skip to content

Commit 63fee7a

Browse files
committed
chore(docs): Fix method name and signature (#2989)
1 parent d5d4526 commit 63fee7a

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

docs/guides/how-to-add-contest-table-provider.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export const contestTableProviderGroups: Record<ProviderKey, ContestTableProvide
111111
- `setFilterCondition()`: 条件関数を返すメソッド
112112
- `getMetadata()`: `title``abbreviationName` を返す
113113
- `getDisplayConfig()`: 表示設定を返す
114-
- `getContestRoundLabel()`: ラウンドラベルを返す
114+
- `getContestRoundLabel(contestId)`: ラウンドラベルを返す
115115

116116
****:
117117

@@ -170,13 +170,15 @@ pnpm test:unit src/test/lib/utils/contest_table_provider.test.ts
170170

171171
```typescript
172172
class ABC001ToABC041Provider extends ContestTableProviderBase {
173-
protected contestType = ContestType.ABC;
173+
protected setFilterCondition(): (taskResult: TaskResult) => boolean {
174+
return (taskResult: TaskResult) => {
175+
if (classifyContest(taskResult.contest_id) !== this.contestType) {
176+
return false;
177+
}
174178

175-
filter(tasks: TaskResults): TaskResults | null {
176-
return tasks.filter((task) => {
177-
const round = this.extractRound(task.contest_id, 'abc');
178-
return round >= 1 && round <= 41;
179-
});
179+
const contestRound = parseContestRound(taskResult.contest_id, 'abc');
180+
return contestRound >= 1 && contestRound <= 41;
181+
};
180182
}
181183

182184
getMetadata(): ContestTableMetaData {
@@ -222,15 +224,19 @@ class ABC001ToABC041Provider extends ContestTableProviderBase {
222224

223225
```typescript
224226
class EDPCProvider extends ContestTableProviderBase {
225-
protected contestType = ContestType.EDPC;
227+
protected setFilterCondition(): (taskResult: TaskResult) => boolean {
228+
return (taskResult: TaskResult) => {
229+
if (classifyContest(taskResult.contest_id) !== this.contestType) {
230+
return false;
231+
}
226232

227-
filter(tasks: TaskResults): TaskResults | null {
228-
return tasks.filter((task) => task.contest_id === 'dp');
233+
return taskResult.contest_id === 'dp';
234+
};
229235
}
230236

231237
getMetadata(): ContestTableMetaData {
232238
return {
233-
title: 'AtCoder Educational DP Contest',
239+
title: 'Educational DP Contest / DP まとめコンテスト',
234240
abbreviationName: 'edpc',
235241
};
236242
}
@@ -269,10 +275,10 @@ class EDPCProvider extends ContestTableProviderBase {
269275

270276
```typescript
271277
class ABSProvider extends ContestTableProviderBase {
272-
protected contestType = ContestType.ABS;
273-
274-
filter(tasks: TaskResults): TaskResults | null {
275-
return tasks.filter((task) => task.contest_id === 'abs');
278+
protected setFilterCondition(): (taskResult: TaskResult) => boolean {
279+
return (taskResult: TaskResult) => {
280+
return classifyContest(taskResult.contest_id) === this.contestType;
281+
};
276282
}
277283

278284
getMetadata(): ContestTableMetaData {

0 commit comments

Comments
 (0)