Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Quentin Vrel
projet-cdaw
Commits
44d4b43d
Commit
44d4b43d
authored
Dec 03, 2020
by
Zohten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mourning step 1 : denial
parent
93588eac
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
5 deletions
+107
-5
GameController.class.php
BackEnd/src/controller/GameController.class.php
+1
-0
Tile.vue
frontend/src/components/Tile.vue
+42
-0
Combination.js
frontend/src/model/Combination.js
+22
-0
Hand.js
frontend/src/model/Hand.js
+8
-0
Tile.js
frontend/src/model/Tile.js
+2
-4
index.js
frontend/src/router/index.js
+7
-1
Betaparty.vue
frontend/src/views/Betaparty.vue
+25
-0
No files found.
BackEnd/src/controller/GameController.class.php
View file @
44d4b43d
...
...
@@ -64,6 +64,7 @@ class GameController extends Controller
/**
* (GET) Get a specific game in Game table based on id
* TODO : check if user is in the game
*
* @return Response
*/
...
...
frontend/src/components/Tile.vue
0 → 100644
View file @
44d4b43d
<
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
>
frontend/src/model/Combination.js
0 → 100644
View file @
44d4b43d
//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
frontend/src/model/Hand.js
0 → 100644
View file @
44d4b43d
import
Tile
from
'@/model/Tile.js'
export
default
class
Hand
{
constructor
()
{
this
.
tiles_left
=
[];
this
.
claimed
=
[];
}
}
\ No newline at end of file
frontend/src/model/Tile.js
View file @
44d4b43d
...
...
@@ -126,7 +126,7 @@ export default class Tile {
return
TILE_NAMES
[
this
.
id
];
}
get
Image
(){
get
SVG
(){
return
TILE_GLYPHS
[
this
.
id
];
}
...
...
@@ -146,6 +146,4 @@ export default class Tile {
return
'Unknown'
;
}
}
}
const
test
=
new
Tile
(
26
);
console
.
log
(
test
.
getFamily
());
\ No newline at end of file
}
\ No newline at end of file
frontend/src/router/index.js
View file @
44d4b43d
...
...
@@ -22,7 +22,13 @@ const routes = [
path
:
'/lobby'
,
name
:
'Lobby'
,
component
:
()
=>
import
(
'../views/Lobby.vue'
)
},{
},
{
path
:
'/betaparty'
,
name
:
'Betaparty'
,
component
:
()
=>
import
(
'../views/Betaparty.vue'
)
},
{
path
:
'/register'
,
name
:
'Register'
,
component
:
()
=>
import
(
'../views/Register.vue'
)
...
...
frontend/src/views/Betaparty.vue
0 → 100644
View file @
44d4b43d
<
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment