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
fc9c0a6a
Commit
fc9c0a6a
authored
Dec 29, 2020
by
Isabell Heider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
8924c4d8
Pipeline
#300
passed with stages
in 5 minutes and 35 seconds
Changes
13
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
189 additions
and
40 deletions
+189
-40
app-routing.module.ts
src/app/app-routing.module.ts
+5
-1
app.component.html
src/app/app.component.html
+1
-1
game.component.html
src/app/game/game.component.html
+18
-2
game.component.scss
src/app/game/game.component.scss
+8
-0
game.component.ts
src/app/game/game.component.ts
+45
-15
guesser.component.html
src/app/guesser/guesser.component.html
+19
-7
guesser.component.ts
src/app/guesser/guesser.component.ts
+28
-3
overview.component.html
src/app/overview/overview.component.html
+10
-6
overview.component.scss
src/app/overview/overview.component.scss
+18
-0
overview.component.ts
src/app/overview/overview.component.ts
+25
-2
select-game.component.html
src/app/select-game/select-game.component.html
+1
-1
select-game.component.ts
src/app/select-game/select-game.component.ts
+9
-0
environment.ts
src/environments/environment.ts
+2
-2
No files found.
src/app/app-routing.module.ts
View file @
fc9c0a6a
...
...
@@ -7,6 +7,10 @@ import {GameComponent} from './game/game.component';
import
{
GuesserComponent
}
from
'
./guesser/guesser.component
'
;
const
routes
:
Routes
=
[
{
path
:
'
error
'
,
component
:
ErrorComponent
,
},
{
path
:
'
:sessionName
'
,
component
:
OverviewComponent
,
...
...
@@ -34,7 +38,7 @@ const routes: Routes = [
{
path
:
'
**
'
,
component
:
ErrorComponent
,
}
}
,
];
@
NgModule
({
...
...
src/app/app.component.html
View file @
fc9c0a6a
<div
fxLayout=
"column"
fxFlexFill
style=
"background-image: url(/assets/background.jpg)
"
>
<div
fxLayout=
"column"
fxFlexFill
style=
"background-image: url(/assets/background.jpg)
; background-repeat: repeat;"
>
<app-header>
</app-header>
<div
fxFlex
>
...
...
src/app/game/game.component.html
View file @
fc9c0a6a
<div
style=
"text-align: center; margin-left: 15em; margin-right: 15em; margin-top: 5em;"
>
<p>
Punktestand: {{points}}
</p>
<div
id=
"app"
></div>
<mat-card>
<h1>
...
...
@@ -35,6 +34,23 @@
</mat-card>
<br>
<button
mat-raised-button
color=
"primary"
(click)=
"rightAnswer()"
>
Richtig
✔
</button>
<button
mat-raised-button
color=
"accent"
style=
"margin: 40px"
>
Überspringen
»
</button>
<button
mat-raised-button
color=
"accent"
style=
"margin: 40px"
(click)=
"newCard()"
>
Überspringen
»
</button>
<button
mat-raised-button
color=
"warn"
(click)=
"wrongAnswer()"
>
Tabu
✘
</button>
<br>
<mat-card
class=
"transparent"
>
<mat-card-title>
Spielstand
</mat-card-title>
<mat-card-content>
<br>
<table>
<tr>
<th>
Team rot
</th>
<th>
Team blau
</th>
</tr>
<tr>
<th>
{{gameStatus.red}}
</th>
<th>
{{gameStatus.blue}}
</th>
</tr>
</table>
</mat-card-content>
</mat-card>
</div>
src/app/game/game.component.scss
View file @
fc9c0a6a
table
{
width
:
50%
;
margin-left
:
auto
;
margin-right
:
auto
;
}
.transparent
{
opacity
:
0
.9
;
}
body
{
font-family
:
sans-serif
;
...
...
src/app/game/game.component.ts
View file @
fc9c0a6a
...
...
@@ -3,6 +3,8 @@ import {ProgressSpinnerMode} from '@angular/material/progress-spinner';
import
{
CardInfo
}
from
'
../interface/cardInfo
'
;
import
{
TabuMiddlewareService
}
from
'
../dao/TabuMiddlewareService
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
GameStatus
}
from
'
../interface/gameStatus
'
;
@
Component
({
selector
:
'
app-game
'
,
templateUrl
:
'
./game.component.html
'
,
...
...
@@ -20,7 +22,16 @@ export class GameComponent implements OnInit {
tabu4
:
''
,
tabu5
:
''
};
points
=
0
;
gameStatus
:
GameStatus
=
{
sessionID
:
-
1
,
red
:
0
,
blue
:
0
,
redTurn
:
true
,
activeExplainer
:
false
,
activeWatchdog
:
false
};
team
=
''
;
color
=
'
primary
'
;
mode
:
ProgressSpinnerMode
=
'
determinate
'
;
...
...
@@ -31,6 +42,34 @@ export class GameComponent implements OnInit {
ngOnInit
():
void
{
this
.
activatedRoute
.
paramMap
.
subscribe
(
params
=>
{
this
.
sessionName
=
String
(
params
.
get
(
'
sessionName
'
));
this
.
service
.
getGamestatus
({
'
spielname
'
:
this
.
sessionName
}).
then
(
value
=>
{
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
this
.
gameStatus
.
sessionID
=
JSON
.
parse
(
value
.
sessionID
);
this
.
gameStatus
.
red
=
JSON
.
parse
(
value
.
red
);
this
.
gameStatus
.
blue
=
JSON
.
parse
(
value
.
blue
);
this
.
gameStatus
.
redTurn
=
JSON
.
parse
(
value
.
redTurn
);
this
.
gameStatus
.
activeExplainer
=
JSON
.
parse
(
value
.
activeExplainer
);
this
.
gameStatus
.
activeWatchdog
=
JSON
.
parse
(
value
.
activeWatchdog
);
}
console
.
log
(
this
.
gameStatus
);
}),
this
.
team
=
String
(
params
.
get
(
'
team
'
));
this
.
newCard
();
});
}
rightAnswer
():
void
{
this
.
newCard
();
this
.
service
.
addPoint
({
spielname
:
this
.
sessionName
,
team
:
this
.
team
});
}
wrongAnswer
():
void
{
this
.
newCard
();
this
.
service
.
removePoint
({
spielname
:
this
.
sessionName
,
team
:
this
.
team
});
}
newCard
():
void
{
this
.
service
.
getS2C
({
spielname
:
this
.
sessionName
}).
then
(
value
=>
{
console
.
log
(
'
Test1:
'
,
value
);
const
status
=
JSON
.
parse
(
value
.
status
);
...
...
@@ -46,14 +85,5 @@ export class GameComponent implements OnInit {
}
console
.
log
(
this
.
cardInfo
);
}).
catch
(
reason
=>
console
.
log
(
reason
));
});
}
rightAnswer
():
void
{
this
.
points
+=
1
;
}
wrongAnswer
():
void
{
this
.
points
-=
1
;
}
}
src/app/guesser/guesser.component.html
View file @
fc9c0a6a
<div
style=
"text-align: center; margin-left: 15em; margin-right: 15em; margin-top: 5em;"
>
<mat-card
class=
"transparent"
>
<h1>
Du musst raten!
</h1>
<p>
Punktestand: {{points}}
</p>
</mat-card>
<mat-card-title>
Du musst raten!
Spielstand
</mat-card-title>
<mat-card-content>
<br>
<table>
<tr>
<th>
Team rot
</th>
<th>
Team blau
</th>
</tr>
<tr>
<th>
{{gameStatus.red}}
</th>
<th>
{{gameStatus.blue}}
</th>
</tr>
</table>
</mat-card-content>
<br>
<mat-progress-spinner
color=
"primary"
mode=
"determinate"
value=
"value"
>
</mat-progress-spinner>
</mat-card>
</div>
<div
id=
"app"
></div>
...
...
src/app/guesser/guesser.component.ts
View file @
fc9c0a6a
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
TabuMiddlewareService
}
from
'
../dao/TabuMiddlewareService
'
;
import
{
GameStatus
}
from
'
../interface/gameStatus
'
;
declare
function
testJS
():
any
;
...
...
@@ -9,11 +11,34 @@ declare function testJS(): any;
styleUrls
:
[
'
./guesser.component.scss
'
]
})
export
class
GuesserComponent
implements
OnInit
{
points
=
0
;
sessionName
=
''
;
gameStatus
:
GameStatus
=
{
sessionID
:
-
1
,
red
:
0
,
blue
:
0
,
redTurn
:
true
,
activeExplainer
:
false
,
activeWatchdog
:
false
};
constructor
()
{
}
constructor
(
private
activatedRoute
:
ActivatedRoute
,
private
service
:
TabuMiddlewareService
)
{
}
ngOnInit
():
void
{
this
.
activatedRoute
.
paramMap
.
subscribe
(
params
=>
{
this
.
sessionName
=
String
(
params
.
get
(
'
sessionName
'
));
this
.
service
.
getGamestatus
({
'
spielname
'
:
this
.
sessionName
}).
then
(
value
=>
{
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
this
.
gameStatus
.
sessionID
=
JSON
.
parse
(
value
.
sessionID
);
this
.
gameStatus
.
red
=
JSON
.
parse
(
value
.
red
);
this
.
gameStatus
.
blue
=
JSON
.
parse
(
value
.
blue
);
this
.
gameStatus
.
redTurn
=
JSON
.
parse
(
value
.
redTurn
);
this
.
gameStatus
.
activeExplainer
=
JSON
.
parse
(
value
.
activeExplainer
);
this
.
gameStatus
.
activeWatchdog
=
JSON
.
parse
(
value
.
activeWatchdog
);
}
console
.
log
(
this
.
gameStatus
);
});
});
testJS
();
}
}
src/app/overview/overview.component.html
View file @
fc9c0a6a
<div
style=
"text-align: center; margin-left: 15em; margin-right: 15em; margin-top: 5em;"
>
<mat-card
class=
"transparent"
>
<h2>
Wähle dein Team
</h2>
<mat-icon
color =
"disabled"
aria-hidden=
"false"
aria-label=
"home icon blue"
>
home
</mat-icon>
Team grau
<mat-slide-toggle
color =
"warn"
>
Team rot
</mat-slide-toggle>
<h2>
{{membership}}
</h2>
<button
class =
"red"
(click)=
"joinTeam('red')"
>
<mat-icon
color =
"warn"
aria-hidden=
"false"
aria-label=
"home icon red"
>
home
</mat-icon>
</button>
<button
class =
"blue"
(click)=
"joinTeam('blue')"
>
<mat-icon
style=
"color: darkblue"
aria-hidden=
"false"
aria-label=
"home icon blue"
>
home
</mat-icon>
</button>
</mat-card>
<br>
<br>
...
...
@@ -18,8 +22,8 @@
<th>
Team blau
</th>
</tr>
<tr>
<th>
0
</th>
<th>
0
</th>
<th>
{{gameStatus.red}}
</th>
<th>
{{gameStatus.blue}}
</th>
</tr>
</table>
</mat-card-content>
...
...
src/app/overview/overview.component.scss
View file @
fc9c0a6a
...
...
@@ -7,3 +7,21 @@ table {
.transparent
{
opacity
:
0
.9
;
}
.blue
{
border-color
:
darkblue
;
margin
:
5px
;
cursor
:
pointer
;
}
.red
{
border-color
:
red
;
margin
:
5px
;
cursor
:
pointer
;
}
.button
:active
{
background-color
:darkred
;
}
src/app/overview/overview.component.ts
View file @
fc9c0a6a
...
...
@@ -9,8 +9,9 @@ import {GameStatus} from '../interface/gameStatus';
styleUrls
:
[
'
./overview.component.scss
'
]
})
export
class
OverviewComponent
implements
OnInit
{
team
=
''
;
sessionName
=
''
;
membership
=
'
Wähle dein Team
'
;
gameStatus
:
GameStatus
=
{
sessionID
:
-
1
,
red
:
0
,
...
...
@@ -27,6 +28,21 @@ export class OverviewComponent implements OnInit {
ngOnInit
():
void
{
this
.
activatedRoute
.
paramMap
.
subscribe
(
params
=>
{
this
.
sessionName
=
String
(
params
.
get
(
'
sessionName
'
));
this
.
team
=
String
(
params
.
get
(
'
team
'
));
console
.
log
(
'
Team:
'
,
this
.
team
);
if
(
this
.
team
===
'
red
'
){
this
.
membership
=
'
Du gehörst zu Team rot!
'
;
}
else
if
(
this
.
team
===
'
blue
'
){
this
.
membership
=
'
Du gehörst zu Team blau!
'
;
}
else
if
(
this
.
team
===
'
null
'
){
this
.
membership
=
'
Wähle dein Team
'
;
}
else
{
this
.
router
.
navigate
([
'
error
'
]);
return
;
}
this
.
service
.
getGamestatus
({
'
spielname
'
:
this
.
sessionName
}).
then
(
value
=>
{
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
...
...
@@ -43,6 +59,13 @@ export class OverviewComponent implements OnInit {
}
startGame
():
void
{
this
.
router
.
navigate
([
this
.
router
.
url
+
'
/red/watchdog
'
]);
if
(
this
.
team
===
'
red
'
||
this
.
team
===
'
blue
'
)
{
this
.
router
.
navigate
([
this
.
router
.
url
+
'
/watchdog
'
]);
}
}
joinTeam
(
team
:
string
):
void
{
this
.
team
=
team
;
this
.
router
.
navigate
([
this
.
sessionName
+
'
/
'
+
team
]);
}
}
src/app/select-game/select-game.component.html
View file @
fc9c0a6a
...
...
@@ -13,7 +13,7 @@
<form>
<mat-form-field>
<mat-label>
Spielname
</mat-label>
<input
#sessionName
type=
"text"
matInput
(keyup)=
"checkSpielname(sessionName.value)"
(keypress)=
"keyPressAlphaNumeric($event)"
>
<input
#sessionName
type=
"text"
matInput
(keyup)=
"checkSpielname(sessionName.value)"
(keypress)=
"keyPressAlphaNumeric($event)"
(keyup.enter)=
"enter(sessionName.value)"
>
</mat-form-field>
</form>
</mat-card-content>
...
...
src/app/select-game/select-game.component.ts
View file @
fc9c0a6a
...
...
@@ -49,6 +49,15 @@ export class SelectGameComponent implements OnInit {
}
}
enter
(
sessionName
:
string
):
void
{
if
(
!
this
.
buttonCreateGameDisabled
){
this
.
createGame
(
sessionName
);
}
if
(
!
this
.
buttonJoinGameDisabled
){
this
.
joinGame
(
sessionName
);
}
}
checkSpielname
(
sessionName
:
string
):
void
{
if
(
sessionName
.
length
===
0
)
{
this
.
buttonCreateGameDisabled
=
true
;
...
...
src/environments/environment.ts
View file @
fc9c0a6a
...
...
@@ -4,8 +4,8 @@
export
const
environment
=
{
production
:
false
,
tabuMiddlewareURL
:
'
http://localhost:8080/
'
//
tabuMiddlewareURL: 'http://tabu-middleware.willers.digital/'
//
tabuMiddlewareURL: 'http://localhost:8080/'
tabuMiddlewareURL
:
'
http://tabu-middleware.willers.digital/
'
};
/*
...
...
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