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
e5288479
Commit
e5288479
authored
Dec 29, 2020
by
Dennis Willers
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show different cards
parent
76299016
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
20 deletions
+60
-20
TabuMiddlewareService.ts
src/app/dao/TabuMiddlewareService.ts
+5
-0
game.component.html
src/app/game/game.component.html
+6
-6
game.component.ts
src/app/game/game.component.ts
+34
-7
cardInfo.ts
src/app/interface/cardInfo.ts
+9
-0
overview.component.ts
src/app/overview/overview.component.ts
+2
-3
select-game.component.ts
src/app/select-game/select-game.component.ts
+4
-4
No files found.
src/app/dao/TabuMiddlewareService.ts
View file @
e5288479
...
@@ -38,4 +38,9 @@ export class TabuMiddlewareService {
...
@@ -38,4 +38,9 @@ export class TabuMiddlewareService {
console
.
log
(
req
);
console
.
log
(
req
);
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
getGamestatus`
,
req
);
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
getGamestatus`
,
req
);
}
}
getS2C
(
req
:
any
):
Promise
<
any
>
{
console
.
log
(
req
);
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
getS2C`
,
req
);
}
}
}
src/app/game/game.component.html
View file @
e5288479
...
@@ -2,34 +2,34 @@
...
@@ -2,34 +2,34 @@
<p>
Punktestand: {{points}}
</p>
<p>
Punktestand: {{points}}
</p>
<mat-card>
<mat-card>
<h1>
<h1>
{{
word
}}
{{
cardInfo.solution
}}
</h1>
</h1>
</mat-card>
</mat-card>
<br>
<br>
<mat-card>
<mat-card>
<h2>
<h2>
{{
forbidden
1}}
{{
cardInfo.tabu
1}}
</h2>
</h2>
</mat-card>
</mat-card>
<mat-card>
<mat-card>
<h2>
<h2>
{{
forbidden
2}}
{{
cardInfo.tabu
2}}
</h2>
</h2>
</mat-card>
</mat-card>
<mat-card>
<mat-card>
<h2>
<h2>
{{
forbidden
3}}
{{
cardInfo.tabu
3}}
</h2>
</h2>
</mat-card>
</mat-card>
<mat-card>
<mat-card>
<h2>
<h2>
{{
forbidden
4}}
{{
cardInfo.tabu
4}}
</h2>
</h2>
</mat-card>
</mat-card>
<mat-card>
<mat-card>
<h2>
<h2>
{{
forbidden
5}}
{{
cardInfo.tabu
5}}
</h2>
</h2>
</mat-card>
</mat-card>
<br>
<br>
...
...
src/app/game/game.component.ts
View file @
e5288479
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
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
{
TabuMiddlewareService
}
from
'
../dao/TabuMiddlewareService
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
@
Component
({
@
Component
({
selector
:
'
app-game
'
,
selector
:
'
app-game
'
,
templateUrl
:
'
./game.component.html
'
,
templateUrl
:
'
./game.component.html
'
,
...
@@ -7,21 +10,45 @@ import {ProgressSpinnerMode} from '@angular/material/progress-spinner';
...
@@ -7,21 +10,45 @@ import {ProgressSpinnerMode} from '@angular/material/progress-spinner';
})
})
export
class
GameComponent
implements
OnInit
{
export
class
GameComponent
implements
OnInit
{
word
=
'
Hund
'
;
sessionName
=
''
;
forbidden1
=
'
Haustier
'
;
cardInfo
:
CardInfo
=
{
forbidden2
=
'
Katze
'
;
cardID
:
-
1
,
forbidden3
=
'
Gassi
'
;
solution
:
''
,
forbidden4
=
'
Leine
'
;
tabu1
:
''
,
forbidden5
=
'
Welpe
'
;
tabu2
:
''
,
tabu3
:
''
,
tabu4
:
''
,
tabu5
:
''
};
points
=
0
;
points
=
0
;
color
=
'
primary
'
;
color
=
'
primary
'
;
mode
:
ProgressSpinnerMode
=
'
determinate
'
;
mode
:
ProgressSpinnerMode
=
'
determinate
'
;
value
=
50
;
value
=
50
;
constructor
()
{
}
constructor
(
private
service
:
TabuMiddlewareService
,
private
activatedRoute
:
ActivatedRoute
)
{}
ngOnInit
():
void
{
ngOnInit
():
void
{
this
.
activatedRoute
.
paramMap
.
subscribe
(
params
=>
{
this
.
sessionName
=
String
(
params
.
get
(
'
sessionName
'
));
this
.
service
.
getS2C
({
spielname
:
this
.
sessionName
}).
then
(
value
=>
{
console
.
log
(
'
Test1:
'
,
value
);
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
console
.
log
(
'
Test2:
'
,
value
);
this
.
cardInfo
.
cardID
=
JSON
.
parse
(
value
.
cardID
);
this
.
cardInfo
.
solution
=
value
.
solution
;
this
.
cardInfo
.
tabu1
=
value
.
tabu1
;
this
.
cardInfo
.
tabu2
=
value
.
tabu2
;
this
.
cardInfo
.
tabu3
=
value
.
tabu3
;
this
.
cardInfo
.
tabu4
=
value
.
tabu4
;
this
.
cardInfo
.
tabu5
=
value
.
tabu5
;
}
}
console
.
log
(
this
.
cardInfo
);
}).
catch
(
reason
=>
console
.
log
(
reason
));
});
}
rightAnswer
():
void
{
rightAnswer
():
void
{
this
.
points
+=
1
;
this
.
points
+=
1
;
}
}
...
...
src/app/interface/cardInfo.ts
0 → 100644
View file @
e5288479
export
interface
CardInfo
{
cardID
:
number
;
solution
:
string
;
tabu1
:
string
;
tabu2
:
string
;
tabu3
:
string
;
tabu4
:
string
;
tabu5
:
string
;
}
src/app/overview/overview.component.ts
View file @
e5288479
...
@@ -27,8 +27,7 @@ export class OverviewComponent implements OnInit {
...
@@ -27,8 +27,7 @@ export class OverviewComponent implements OnInit {
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
'
));
console
.
log
(
'
SessionName:
'
,
this
.
sessionName
);
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
)
{
this
.
gameStatus
.
sessionID
=
JSON
.
parse
(
value
.
sessionID
);
this
.
gameStatus
.
sessionID
=
JSON
.
parse
(
value
.
sessionID
);
...
@@ -44,6 +43,6 @@ export class OverviewComponent implements OnInit {
...
@@ -44,6 +43,6 @@ export class OverviewComponent implements OnInit {
}
}
startGame
():
void
{
startGame
():
void
{
this
.
router
.
navigate
([
this
.
router
.
url
+
'
/red/watchdog
'
]);
this
.
router
.
navigate
([
this
.
router
.
url
+
'
/red/watchdog
'
]);
}
}
}
}
src/app/select-game/select-game.component.ts
View file @
e5288479
...
@@ -12,19 +12,19 @@ export class SelectGameComponent implements OnInit {
...
@@ -12,19 +12,19 @@ export class SelectGameComponent implements OnInit {
buttonCreateGameDisabled
=
true
;
buttonCreateGameDisabled
=
true
;
buttonJoinGameDisabled
=
true
;
buttonJoinGameDisabled
=
true
;
constructor
(
private
router
:
Router
,
constructor
(
private
router
:
Router
,
private
serv
er
:
TabuMiddlewareService
)
{
}
private
serv
ice
:
TabuMiddlewareService
)
{
}
ngOnInit
():
void
{
ngOnInit
():
void
{
}
}
getSpielSessions
():
any
{
getSpielSessions
():
any
{
console
.
log
(
'
Start
'
);
console
.
log
(
'
Start
'
);
const
response
=
this
.
serv
er
.
getSessions
();
const
response
=
this
.
serv
ice
.
getSessions
();
console
.
log
(
'
Response:
'
,
response
);
console
.
log
(
'
Response:
'
,
response
);
}
}
createGame
(
sessionName
:
string
):
void
{
createGame
(
sessionName
:
string
):
void
{
this
.
serv
er
.
addSession
({
"
spielname
"
:
sessionName
}).
then
(
value
=>
{
this
.
serv
ice
.
addSession
({
spielname
:
sessionName
}).
then
(
value
=>
{
console
.
log
(
value
);
console
.
log
(
value
);
const
status
=
JSON
.
parse
(
value
.
status
);
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
if
(
status
)
{
...
@@ -55,7 +55,7 @@ export class SelectGameComponent implements OnInit {
...
@@ -55,7 +55,7 @@ export class SelectGameComponent implements OnInit {
this
.
buttonJoinGameDisabled
=
true
;
this
.
buttonJoinGameDisabled
=
true
;
return
;
return
;
}
else
{
}
else
{
this
.
serv
er
.
isSession
({
'
spielname
'
:
sessionName
}).
then
(
value
=>
{
this
.
serv
ice
.
isSession
({
'
spielname
'
:
sessionName
}).
then
(
value
=>
{
console
.
log
(
'
Response:
'
,
value
.
status
);
console
.
log
(
'
Response:
'
,
value
.
status
);
const
status
=
JSON
.
parse
(
value
.
status
);
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
if
(
status
)
{
...
...
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