Commit 44d4b43d authored by Zohten's avatar Zohten

Mourning step 1 : denial

parent 93588eac
...@@ -64,6 +64,7 @@ class GameController extends Controller ...@@ -64,6 +64,7 @@ class GameController extends Controller
/** /**
* (GET) Get a specific game in Game table based on id * (GET) Get a specific game in Game table based on id
* TODO : check if user is in the game
* *
* @return Response * @return Response
*/ */
......
<template>
<div class="hello">
<h1>{{ id }}</h1>
<button class="tile-symbol">
<img :src="this.background" :width="this.width" :height="this.height"/>
<img :src="this.svg" :width="this.width" :height="this.height"/>
</button>
</div>
</template>
<script>
import Tile from '@/model/Tile.js'
export default {
props: {
id: Number,
width: { type: [Number, String], default: 80 },
height: {type: [Number, String], default: 80 }
},
data(){ //data must be a function
return{
tile: null, //our tile object
svg: null,
}
},
mounted(){ //hook on mounted, we init the object. It could have been done before.
console.log(typeof(this.id));
this.tile = new Tile(this.id);
this.background = require("@/assets/img/mahjong-tiles/Black/Front.svg");
this.svg = require("@/assets/img/mahjong-tiles/Black/"+ this.tile.getSVG());
console.log(this.svg);
}
}
</script>
<style>
.tile-symbol{
border-radius: 10px;
background: transparent;
border: none;
}
</style>
//import Tile from '@/model/Tile.js'
import Tile from '../model/Tile.js'
const COMBINATION_NAME = {
"0": "Chow",
"1": "Pung",
"2": "Kong"
};
//export default
class Combination {
constructor(tiles) {
this.tiles = tiles;
}
getCombinationName(tiles){
return 'pouet';
}
}
test = new Combination(1);
console.log(test);
\ No newline at end of file
import Tile from '@/model/Tile.js'
export default class Hand {
constructor() {
this.tiles_left = [];
this.claimed =[];
}
}
\ No newline at end of file
...@@ -126,7 +126,7 @@ export default class Tile { ...@@ -126,7 +126,7 @@ export default class Tile {
return TILE_NAMES[this.id]; return TILE_NAMES[this.id];
} }
getImage(){ getSVG(){
return TILE_GLYPHS[this.id]; return TILE_GLYPHS[this.id];
} }
...@@ -147,5 +147,3 @@ export default class Tile { ...@@ -147,5 +147,3 @@ export default class Tile {
} }
} }
} }
\ No newline at end of file
const test = new Tile(26);
console.log(test.getFamily());
\ No newline at end of file
...@@ -22,7 +22,13 @@ const routes = [ ...@@ -22,7 +22,13 @@ const routes = [
path: '/lobby', path: '/lobby',
name: 'Lobby', name: 'Lobby',
component: () => import('../views/Lobby.vue') component: () => import('../views/Lobby.vue')
},{ },
{
path: '/betaparty',
name: 'Betaparty',
component: () => import('../views/Betaparty.vue')
},
{
path: '/register', path: '/register',
name: 'Register', name: 'Register',
component: () => import('../views/Register.vue') component: () => import('../views/Register.vue')
......
<template>
<div class="about">
<h1>This is minimal page</h1>
<tile :id="this.id" />
</div>
</template>
<script>
import Tile from '@/components/Tile.vue'
export default {
name: 'Betaparty',
components: {
Tile
},
data(){ //data must be a function
return{
id: 10,
}
}
}
</script>
<style>
</style>
\ No newline at end of file
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