server for my chess game
Diffstat (limited to 'src/infos.js')
| -rw-r--r-- | src/infos.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/infos.js b/src/infos.js deleted file mode 100644 index 0e2e129..0000000 --- a/src/infos.js +++ /dev/null @@ -1,30 +0,0 @@ -import { flip_int } from "./utils.js"; - -export class Infos { - constructor(hosterIndex, hosterName, hosterCountry) { - this.hosterIndex = hosterIndex; - this.names = ["Anonymous", "Anonymous"]; - this.names[hosterIndex] = hosterName; - this.countrys = ["rainbow", "rainbow"]; - this.countrys[hosterIndex] = hosterCountry; - } - get(index) { - return { - name: this.names[index], - country: this.countrys[index], - }; - } - - get_all() { - return { w: this.get(0), b: this.get(1) }; - } - - get joinerIndex() { - return flip_int(this.hosterIndex); - } - - add(name, country) { - this.names[this.joinerIndex] = name; - this.countrys[this.joinerIndex] = country; - } -} |