Commit d74ce25c authored by nanahira's avatar nanahira

fix

parent 3d85a8bd
Pipeline #41220 passed with stages
in 2 minutes and 16 seconds
......@@ -14,6 +14,7 @@ import {
} from './draw-text/draw-text-options';
import { CardDataService } from './card-data/card-data.service';
import _ from 'lodash';
import { BlankReturnMessageDto } from 'nesties';
@Injectable()
export class AppService extends ConsoleLogger {
......@@ -142,7 +143,15 @@ export class AppService extends ConsoleLogger {
};
const filterType = (type: number) =>
ydk.main.filter((id) => cardDataMap[id].type === type);
ydk.main.filter((id) => {
if (!cardDataMap[id]) {
throw new BlankReturnMessageDto(
404,
`Card ID ${id} has invalid data`,
).toException();
}
return cardDataMap[id].type === type;
});
await drawCards(filterType(1), Coordinates.main.monsters);
this.log(`Filled monster cards.`);
await drawCards(filterType(2), Coordinates.main.spells);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment