Update README and fix linting issues #37
5 changed files with 15 additions and 17 deletions
|
@ -18,9 +18,7 @@ module.exports = {
|
|||
|
||||
overrides: [
|
||||
{
|
||||
files: [
|
||||
'**/__tests__/*.{j,t}s?(x)'
|
||||
],
|
||||
files: ["**/__tests__/*.{j,t}s?(x)"],
|
||||
env: {
|
||||
jest: true
|
||||
}
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
<img :src="imageURL" />
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Prop } from "vue-property-decorator";
|
||||
|
|
|
@ -57,7 +57,7 @@ export class Session extends EventEmitter {
|
|||
|
||||
// Place players in the pod
|
||||
switch (this.options.spacing) {
|
||||
case "evenly":
|
||||
case "evenly": {
|
||||
const playerRatio = spots / playerNum;
|
||||
let i = 0;
|
||||
for (const player of players) {
|
||||
|
@ -67,16 +67,15 @@ export class Session extends EventEmitter {
|
|||
i += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "randomly":
|
||||
for (const player of players) {
|
||||
while (true) {
|
||||
const idx = Math.floor(Math.random() * spots);
|
||||
if (this.pod[idx].name == "") {
|
||||
this.pod[idx].name = player;
|
||||
assignFn(name, this.pod[idx]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
const free = [...Array(spots).keys()].filter(
|
||||
i => this.pod[i].name == ""
|
||||
);
|
||||
const idx = Math.floor(Math.random() * free.length);
|
||||
const chosen = free[idx];
|
||||
assignFn(player, this.pod[chosen]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -179,10 +178,11 @@ export class Session extends EventEmitter {
|
|||
const provider = DraftProvider.set(factory, options.packs);
|
||||
return new Session(options, provider);
|
||||
}
|
||||
case "i8pcube":
|
||||
case "i8pcube": {
|
||||
const cube = await I8PCube.fromURL(options.url);
|
||||
const provider = new DraftProvider(cube.schema());
|
||||
return new Session(options, provider);
|
||||
}
|
||||
default:
|
||||
throw new Error("Unknown draft source");
|
||||
}
|
||||
|
|
|
@ -12,12 +12,13 @@ export async function cardImageURL(cardid: string): Promise<string> {
|
|||
return remoteImageURL(cardid);
|
||||
}
|
||||
switch (cardImageSource()) {
|
||||
case "local":
|
||||
case "local": {
|
||||
const card = await Database.images.get(`${cardid}.webp`);
|
||||
if (!card) {
|
||||
return remoteImageURL(cardid);
|
||||
}
|
||||
return URL.createObjectURL(card.image);
|
||||
}
|
||||
//TODO
|
||||
case "remote":
|
||||
return remoteImageURL(cardid);
|
||||
|
|
|
@ -2,4 +2,4 @@ module.exports = {
|
|||
env: {
|
||||
jest: true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue