@xcpcio/core 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1258,6 +1258,22 @@ class Rank {
1258
1258
  this.rankStatistics = new RankStatistics();
1259
1259
  this.options = new RankOptions();
1260
1260
  this.balloons = [];
1261
+ {
1262
+ const se = /* @__PURE__ */ new Set();
1263
+ this.submissions.forEach((s) => {
1264
+ if (s.language) {
1265
+ se.add(s.language);
1266
+ }
1267
+ });
1268
+ this.languages = [...se].sort();
1269
+ }
1270
+ {
1271
+ const se = /* @__PURE__ */ new Set();
1272
+ this.submissions.forEach((s) => {
1273
+ se.add(s.status);
1274
+ });
1275
+ this.statuses = [...se].sort();
1276
+ }
1261
1277
  }
1262
1278
  cleanRank() {
1263
1279
  (() => {
package/dist/index.d.ts CHANGED
@@ -247,6 +247,8 @@ declare class Rank {
247
247
  rankStatistics: RankStatistics;
248
248
  options: RankOptions;
249
249
  balloons: Balloons;
250
+ languages: Array<string>;
251
+ statuses: Array<SubmissionStatus>;
250
252
  constructor(contest: Contest, teams: Teams, submissions: Submissions);
251
253
  cleanRank(): void;
252
254
  buildRank(): this;
package/dist/index.mjs CHANGED
@@ -1228,6 +1228,22 @@ class Rank {
1228
1228
  this.rankStatistics = new RankStatistics();
1229
1229
  this.options = new RankOptions();
1230
1230
  this.balloons = [];
1231
+ {
1232
+ const se = /* @__PURE__ */ new Set();
1233
+ this.submissions.forEach((s) => {
1234
+ if (s.language) {
1235
+ se.add(s.language);
1236
+ }
1237
+ });
1238
+ this.languages = [...se].sort();
1239
+ }
1240
+ {
1241
+ const se = /* @__PURE__ */ new Set();
1242
+ this.submissions.forEach((s) => {
1243
+ se.add(s.status);
1244
+ });
1245
+ this.statuses = [...se].sort();
1246
+ }
1231
1247
  }
1232
1248
  cleanRank() {
1233
1249
  (() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcpcio/core",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "description": "XCPCIO Core",
5
5
  "author": "Dup4 <lyuzhi.pan@gmail.com>",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "lodash": "^4.17.21",
45
45
  "string-width": "^6.1.0",
46
46
  "xlsx-js-style": "^1.2.0",
47
- "@xcpcio/types": "0.29.0"
47
+ "@xcpcio/types": "0.30.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@babel/types": "^7.22.4",
package/src/rank.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import _ from "lodash";
2
2
 
3
+ import type { SubmissionStatus } from "@xcpcio/types";
4
+
3
5
  import type { Contest } from "./contest";
4
6
  import type { Teams } from "./team";
5
7
  import { Team } from "./team";
@@ -129,6 +131,9 @@ export class Rank {
129
131
 
130
132
  balloons: Balloons;
131
133
 
134
+ languages: Array<string>;
135
+ statuses: Array<SubmissionStatus>;
136
+
132
137
  constructor(contest: Contest, teams: Teams, submissions: Submissions) {
133
138
  this.contest = contest;
134
139
 
@@ -162,6 +167,28 @@ export class Rank {
162
167
  this.options = new RankOptions();
163
168
 
164
169
  this.balloons = [];
170
+
171
+ {
172
+ const se = new Set<string>();
173
+
174
+ this.submissions.forEach((s) => {
175
+ if (s.language) {
176
+ se.add(s.language);
177
+ }
178
+ });
179
+
180
+ this.languages = [...se].sort();
181
+ }
182
+
183
+ {
184
+ const se = new Set<SubmissionStatus>();
185
+
186
+ this.submissions.forEach((s) => {
187
+ se.add(s.status);
188
+ });
189
+
190
+ this.statuses = [...se].sort();
191
+ }
165
192
  }
166
193
 
167
194
  cleanRank() {