Commit de3c0ef8 authored by Zohten's avatar Zohten

model madness

parent 024af59f
export default class User {
constructor() {
this.state = {
id: id,
users: [],
players: []
};
}
/**
*
*/
async registerPlayer(id) {
}
}
\ No newline at end of file
export default class Round {
constructor(players) {
this.state = {
id: id,
users: [],
players: []
};
}
/**
* Register player
*/
async registerPlayer(id) {
}
}
\ No newline at end of file
const TILE_NAMES = {
"0": "bamboo 1",
"1": "bamboo 2",
"2": "bamboo 3",
"3": "bamboo 4",
"4": "bamboo 5",
"5": "bamboo 6",
"6": "bamboo 7",
"7": "bamboo 8",
"8": "bamboo 9",
"9": "characters 1",
"10": "characters 2",
"11": "characters 3",
"12": "characters 4",
"13": "characters 5",
"14": "characters 6",
"15": "characters 7",
"16": "characters 8",
"17": "characters 9",
"18": "dots 1",
"19": "dots 2",
"20": "dots 3",
"21": "dots 4",
"22": "dots 5",
"23": "dots 6",
"24": "dots 7",
"25": "dots 8",
"26": "dots 9",
"27": "east",
"28": "south",
"29": "west",
"30": "north",
"31": "green dragon",
"32": "red dragon",
"33": "white dragon"
"0": "Bamboo 1",
"1": "Bamboo 2",
"2": "Bamboo 3",
"3": "Bamboo 4",
"4": "Bamboo 5",
"5": "Bamboo 6",
"6": "Bamboo 7",
"7": "Bamboo 8",
"8": "Bamboo 9",
"9": "Characters 1",
"10": "Characters 2",
"11": "Characters 3",
"12": "Characters 4",
"13": "Characters 5",
"14": "Characters 6",
"15": "Characters 7",
"16": "Characters 8",
"17": "Characters 9",
"18": "Dots 1",
"19": "Dots 2",
"20": "Dots 3",
"21": "Dots 4",
"22": "Dots 5",
"23": "Dots 6",
"24": "Dots 7",
"25": "Dots 8",
"26": "Dots 9",
"27": "East",
"28": "South",
"29": "West",
"30": "North",
"31": "Green dragon",
"32": "Red dragon",
"33": "White dragon"
};
const TILE_CODES = {
......@@ -110,15 +110,42 @@ const TILE_NAMES = {
};
const SUIT_NAMES = {
"0": "bamboo",
"1": "characters",
"2": "dots",
"3": "winds",
"4": "dragons"
"0": "Bamboo",
"1": "Characters",
"2": "Dots",
"3": "Winds",
"4": "Dragons"
};
export default class Tile {
constructor() {
constructor(id) {
this.id = id;
}
}
\ No newline at end of file
getName(){
return TILE_NAMES[this.id];
}
getImage(){
return TILE_GLYPHS[this.id];
}
getCode(){
return TILE_CODES[this.id];
}
getFamily(){
const divEucl = Math.floor(this.id/9);
if(divEucl<=3){
return SUIT_NAMES[divEucl];
}else if(this.id<=30 && this.id>=27){
return SUIT_NAMES[3];
}else if(this.id<=33 && this.id>=31){
return SUIT_NAMES[4];
}else{
return 'Unknown';
}
}
}
const test = new Tile(26);
console.log(test.getFamily());
\ No newline at end of file
......@@ -33,7 +33,7 @@ import UserRibbon from '@/components/UserRibbon.vue'
import PageTitle from '@/components/PageTitle.vue'
import ButtonText from '@/components/ButtonText.vue'
import TextInput from '@/components/form/TextInput.vue'
import User from '@/model/user.js'
import User from '@/model/User.js'
export default {
name: 'lobby',
......
......@@ -38,7 +38,7 @@
import Avatar from '../components/Avatar.vue';
import PageTitle from '../components/PageTitle.vue';
import SvgButton from '../components/SvgButton.vue';
import User from '@/model/user.js'
import User from '@/model/User.js'
// @ is an alias to /src
......
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