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
3192fcd4
Commit
3192fcd4
authored
Dec 30, 2020
by
Dennis Willers
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Services from Joshua and create Logic for nextRound Button
parent
fbd9fe2b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
6 deletions
+35
-6
TabuMiddlewareService.ts
src/app/dao/TabuMiddlewareService.ts
+15
-0
overview.component.html
src/app/overview/overview.component.html
+2
-2
overview.component.ts
src/app/overview/overview.component.ts
+18
-4
No files found.
src/app/dao/TabuMiddlewareService.ts
View file @
3192fcd4
...
@@ -53,4 +53,19 @@ export class TabuMiddlewareService {
...
@@ -53,4 +53,19 @@ export class TabuMiddlewareService {
console
.
log
(
req
);
console
.
log
(
req
);
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
removePoint`
,
req
);
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
removePoint`
,
req
);
}
}
newGame
(
req
:
any
):
Promise
<
any
>
{
console
.
log
(
req
);
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
newGame`
,
req
);
}
newRound
(
req
:
any
):
Promise
<
any
>
{
console
.
log
(
req
);
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
newRound`
,
req
);
}
endRound
(
req
:
any
):
Promise
<
any
>
{
console
.
log
(
req
);
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
endRound`
,
req
);
}
}
}
src/app/overview/overview.component.html
View file @
3192fcd4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<mat-card
class=
"transparent"
>
<mat-card
class=
"transparent"
>
<div
class=
"FloatLeftAndCenterElement"
>
<div
class=
"FloatLeftAndCenterElement"
>
<div
class=
"newStartButtonLeft"
>
<div
class=
"newStartButtonLeft"
>
<button
matTooltip=
"Neues Spiel starten"
[disabled]=
"button
Play
Disabled"
mat-raised-button
color=
"primary"
(click)=
"startGame()"
>
<button
matTooltip=
"Neues Spiel starten"
[disabled]=
"button
NewGame
Disabled"
mat-raised-button
color=
"primary"
(click)=
"startGame()"
>
<mat-icon
color =
"white"
aria-hidden=
"false"
>
autorenew
</mat-icon></button>
<mat-icon
color =
"white"
aria-hidden=
"false"
>
autorenew
</mat-icon></button>
</div>
</div>
<div
class=
"CenterText"
>
<div
class=
"CenterText"
>
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<br>
<br>
<mat-card-title>
{{nextTeam}} ist am Zug:
</mat-card-title>
<mat-card-title>
{{nextTeam}} ist am Zug:
</mat-card-title>
<br>
<br>
<button
[disabled]=
"button
PlayDisabled"
mat-raised-button
color=
"primary
"
>
Nächste Runde
</button>
<button
[disabled]=
"button
NextRoundDisabled"
mat-raised-button
color=
"primary"
(click)=
"nextRound()
"
>
Nächste Runde
</button>
</mat-card-actions>
</mat-card-actions>
</mat-card>
</mat-card>
</div>
</div>
src/app/overview/overview.component.ts
View file @
3192fcd4
...
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
...
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
TabuMiddlewareService
}
from
'
../dao/TabuMiddlewareService
'
;
import
{
TabuMiddlewareService
}
from
'
../dao/TabuMiddlewareService
'
;
import
{
GameStatus
}
from
'
../interface/gameStatus
'
;
import
{
GameStatus
}
from
'
../interface/gameStatus
'
;
import
{
error
}
from
'
selenium-webdriver
'
;
@
Component
({
@
Component
({
selector
:
'
app-overview
'
,
selector
:
'
app-overview
'
,
...
@@ -13,7 +14,8 @@ export class OverviewComponent implements OnInit {
...
@@ -13,7 +14,8 @@ export class OverviewComponent implements OnInit {
blue
=
'
choose
'
;
blue
=
'
choose
'
;
nextTeam
=
'
Blau
'
;
nextTeam
=
'
Blau
'
;
team
=
''
;
team
=
''
;
buttonPlayDisabled
=
true
;
buttonNewGameDisabled
=
true
;
buttonNextRoundDisabled
=
true
;
sessionName
=
''
;
sessionName
=
''
;
membership
=
'
Wähle dein Team
'
;
membership
=
'
Wähle dein Team
'
;
gameStatus
:
GameStatus
=
{
gameStatus
:
GameStatus
=
{
...
@@ -36,13 +38,13 @@ export class OverviewComponent implements OnInit {
...
@@ -36,13 +38,13 @@ export class OverviewComponent implements OnInit {
console
.
log
(
'
Team:
'
,
this
.
team
);
console
.
log
(
'
Team:
'
,
this
.
team
);
if
(
this
.
team
===
'
red
'
){
if
(
this
.
team
===
'
red
'
){
this
.
membership
=
'
Du gehörst zu Team rot!
'
;
this
.
membership
=
'
Du gehörst zu Team rot!
'
;
this
.
button
Play
Disabled
=
false
;
this
.
button
NewGame
Disabled
=
false
;
this
.
red
=
'
red
'
;
this
.
red
=
'
red
'
;
this
.
blue
=
'
choose
'
;
this
.
blue
=
'
choose
'
;
}
}
else
if
(
this
.
team
===
'
blue
'
){
else
if
(
this
.
team
===
'
blue
'
){
this
.
membership
=
'
Du gehörst zu Team blau!
'
;
this
.
membership
=
'
Du gehörst zu Team blau!
'
;
this
.
button
Play
Disabled
=
false
;
this
.
button
NewGame
Disabled
=
false
;
this
.
blue
=
'
blue
'
;
this
.
blue
=
'
blue
'
;
this
.
red
=
'
choose
'
;
this
.
red
=
'
choose
'
;
}
}
...
@@ -64,9 +66,11 @@ export class OverviewComponent implements OnInit {
...
@@ -64,9 +66,11 @@ export class OverviewComponent implements OnInit {
this
.
gameStatus
.
activeWatchdog
=
JSON
.
parse
(
value
.
activeWatchdog
);
this
.
gameStatus
.
activeWatchdog
=
JSON
.
parse
(
value
.
activeWatchdog
);
if
(
this
.
gameStatus
.
redTurn
){
if
(
this
.
gameStatus
.
redTurn
){
this
.
nextTeam
=
'
Rot
'
;
this
.
nextTeam
=
'
Rot
'
;
this
.
buttonNextRoundDisabled
=
this
.
team
!==
'
red
'
;
}
}
else
{
else
{
this
.
nextTeam
=
'
Blau
'
;
this
.
nextTeam
=
'
Blau
'
;
this
.
buttonNextRoundDisabled
=
this
.
team
!==
'
blue
'
;
}
}
}
}
console
.
log
(
this
.
gameStatus
);
console
.
log
(
this
.
gameStatus
);
...
@@ -76,9 +80,19 @@ export class OverviewComponent implements OnInit {
...
@@ -76,9 +80,19 @@ export class OverviewComponent implements OnInit {
startGame
():
void
{
startGame
():
void
{
if
(
this
.
team
===
'
red
'
||
this
.
team
===
'
blue
'
)
{
if
(
this
.
team
===
'
red
'
||
this
.
team
===
'
blue
'
)
{
this
.
service
.
newGame
({
spielname
:
this
.
sessionName
}).
then
(
value
=>
{
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
this
.
router
.
navigate
([
this
.
router
.
url
+
'
/explainer
'
]);
this
.
router
.
navigate
([
this
.
router
.
url
+
'
/explainer
'
]);
}
}
}).
catch
(
reason
=>
console
.
log
(
reason
));
}
}
}
nextRound
():
void
{
this
.
router
.
navigate
([
this
.
router
.
url
+
'
/explainer
'
]);
}
joinTeam
(
team
:
string
):
void
{
joinTeam
(
team
:
string
):
void
{
this
.
team
=
team
;
this
.
team
=
team
;
this
.
router
.
navigate
([
this
.
sessionName
+
'
/
'
+
team
]);
this
.
router
.
navigate
([
this
.
sessionName
+
'
/
'
+
team
]);
...
...
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