Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Tabu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dennis Willers
Tabu
Commits
866e8b3f
Commit
866e8b3f
authored
Dec 30, 2020
by
Dennis Willers
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change designe and routing handling for explainer watchdog
parent
d42b70d9
Pipeline
#305
passed with stages
in 5 minutes and 19 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
game.component.html
src/app/game/game.component.html
+4
-2
game.component.ts
src/app/game/game.component.ts
+11
-1
overview.component.ts
src/app/overview/overview.component.ts
+8
-8
No files found.
src/app/game/game.component.html
View file @
866e8b3f
...
@@ -33,10 +33,12 @@
...
@@ -33,10 +33,12 @@
</h2>
</h2>
</mat-card>
</mat-card>
<br>
<br>
<button
mat-raised-button
color=
"primary"
(click)=
"rightAnswer()"
>
Richtig
✔
</button>
<button
*ngIf=
"isExplainer"
mat-raised-button
color=
"primary"
(click)=
"rightAnswer()"
>
Richtig
✔
</button>
<button
mat-raised-button
color=
"accent"
style=
"margin: 40px"
(click)=
"newCard()"
>
Überspringen
»
</button>
<button
*ngIf=
"isExplainer"
mat-raised-button
color=
"accent"
style=
"margin: 40px"
(click)=
"newCard()"
>
Überspringen
»
</button>
<button
mat-raised-button
color=
"warn"
(click)=
"wrongAnswer()"
>
Tabu
✘
</button>
<button
mat-raised-button
color=
"warn"
(click)=
"wrongAnswer()"
>
Tabu
✘
</button>
<br>
<br>
<br>
<br>
<mat-card
class=
"transparent"
>
<mat-card
class=
"transparent"
>
<mat-card-title>
Spielstand
</mat-card-title>
<mat-card-title>
Spielstand
</mat-card-title>
<mat-card-content>
<mat-card-content>
...
...
src/app/game/game.component.ts
View file @
866e8b3f
...
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
...
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import
{
ProgressSpinnerMode
}
from
'
@angular/material/progress-spinner
'
;
import
{
ProgressSpinnerMode
}
from
'
@angular/material/progress-spinner
'
;
import
{
CardInfo
}
from
'
../interface/cardInfo
'
;
import
{
CardInfo
}
from
'
../interface/cardInfo
'
;
import
{
TabuMiddlewareService
}
from
'
../dao/TabuMiddlewareService
'
;
import
{
TabuMiddlewareService
}
from
'
../dao/TabuMiddlewareService
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
GameStatus
}
from
'
../interface/gameStatus
'
;
import
{
GameStatus
}
from
'
../interface/gameStatus
'
;
@
Component
({
@
Component
({
...
@@ -13,6 +13,8 @@ import {GameStatus} from '../interface/gameStatus';
...
@@ -13,6 +13,8 @@ import {GameStatus} from '../interface/gameStatus';
export
class
GameComponent
implements
OnInit
{
export
class
GameComponent
implements
OnInit
{
sessionName
=
''
;
sessionName
=
''
;
isWatchdog
=
false
;
isExplainer
=
false
;
cardInfo
:
CardInfo
=
{
cardInfo
:
CardInfo
=
{
cardID
:
-
1
,
cardID
:
-
1
,
solution
:
''
,
solution
:
''
,
...
@@ -37,11 +39,19 @@ export class GameComponent implements OnInit {
...
@@ -37,11 +39,19 @@ export class GameComponent implements OnInit {
mode
:
ProgressSpinnerMode
=
'
determinate
'
;
mode
:
ProgressSpinnerMode
=
'
determinate
'
;
value
=
50
;
value
=
50
;
constructor
(
private
service
:
TabuMiddlewareService
,
constructor
(
private
service
:
TabuMiddlewareService
,
private
router
:
Router
,
private
activatedRoute
:
ActivatedRoute
)
{}
private
activatedRoute
:
ActivatedRoute
)
{}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
activatedRoute
.
paramMap
.
subscribe
(
params
=>
{
this
.
activatedRoute
.
paramMap
.
subscribe
(
params
=>
{
this
.
sessionName
=
String
(
params
.
get
(
'
sessionName
'
));
this
.
sessionName
=
String
(
params
.
get
(
'
sessionName
'
));
const
url
=
this
.
router
.
url
.
split
(
'
/
'
);
const
checkUser
=
url
[
url
.
length
-
1
];
if
(
checkUser
===
'
watchdog
'
)
{
this
.
isWatchdog
=
true
;
}
else
if
(
checkUser
===
'
explainer
'
)
{
this
.
isExplainer
=
true
;
}
this
.
service
.
getGamestatus
({
spielname
:
this
.
sessionName
}).
then
(
value
=>
{
this
.
service
.
getGamestatus
({
spielname
:
this
.
sessionName
}).
then
(
value
=>
{
const
status
=
JSON
.
parse
(
value
.
status
);
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
if
(
status
)
{
...
...
src/app/overview/overview.component.ts
View file @
866e8b3f
...
@@ -11,7 +11,7 @@ import {GameStatus} from '../interface/gameStatus';
...
@@ -11,7 +11,7 @@ import {GameStatus} from '../interface/gameStatus';
export
class
OverviewComponent
implements
OnInit
{
export
class
OverviewComponent
implements
OnInit
{
red
=
'
choose
'
;
red
=
'
choose
'
;
blue
=
'
choose
'
;
blue
=
'
choose
'
;
nextTeam
=
''
;
nextTeam
=
'
Blau
'
;
team
=
''
;
team
=
''
;
buttonPlayDisabled
=
true
;
buttonPlayDisabled
=
true
;
sessionName
=
''
;
sessionName
=
''
;
...
@@ -53,12 +53,6 @@ export class OverviewComponent implements OnInit {
...
@@ -53,12 +53,6 @@ export class OverviewComponent implements OnInit {
this
.
router
.
navigate
([
'
error
'
]);
this
.
router
.
navigate
([
'
error
'
]);
return
;
return
;
}
}
if
(
this
.
gameStatus
.
redTurn
){
this
.
nextTeam
=
'
Rot
'
;
}
else
{
this
.
nextTeam
=
'
Blau
'
;
}
this
.
service
.
getGamestatus
({
spielname
:
this
.
sessionName
}).
then
(
value
=>
{
this
.
service
.
getGamestatus
({
spielname
:
this
.
sessionName
}).
then
(
value
=>
{
const
status
=
JSON
.
parse
(
value
.
status
);
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
if
(
status
)
{
...
@@ -68,6 +62,12 @@ export class OverviewComponent implements OnInit {
...
@@ -68,6 +62,12 @@ export class OverviewComponent implements OnInit {
this
.
gameStatus
.
redTurn
=
JSON
.
parse
(
value
.
redTurn
);
this
.
gameStatus
.
redTurn
=
JSON
.
parse
(
value
.
redTurn
);
this
.
gameStatus
.
activeExplainer
=
JSON
.
parse
(
value
.
activeExplainer
);
this
.
gameStatus
.
activeExplainer
=
JSON
.
parse
(
value
.
activeExplainer
);
this
.
gameStatus
.
activeWatchdog
=
JSON
.
parse
(
value
.
activeWatchdog
);
this
.
gameStatus
.
activeWatchdog
=
JSON
.
parse
(
value
.
activeWatchdog
);
if
(
this
.
gameStatus
.
redTurn
){
this
.
nextTeam
=
'
Rot
'
;
}
else
{
this
.
nextTeam
=
'
Blau
'
;
}
}
}
console
.
log
(
this
.
gameStatus
);
console
.
log
(
this
.
gameStatus
);
}).
catch
(
reason
=>
console
.
log
(
reason
));
}).
catch
(
reason
=>
console
.
log
(
reason
));
...
@@ -76,7 +76,7 @@ export class OverviewComponent implements OnInit {
...
@@ -76,7 +76,7 @@ export class OverviewComponent implements OnInit {
startGame
():
void
{
startGame
():
void
{
if
(
this
.
team
===
'
red
'
||
this
.
team
===
'
blue
'
)
{
if
(
this
.
team
===
'
red
'
||
this
.
team
===
'
blue
'
)
{
this
.
router
.
navigate
([
this
.
router
.
url
+
'
/
watchdog
'
]);
this
.
router
.
navigate
([
this
.
router
.
url
+
'
/
explainer
'
]);
}
}
}
}
joinTeam
(
team
:
string
):
void
{
joinTeam
(
team
:
string
):
void
{
...
...
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