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
a0064812
Commit
a0064812
authored
Jan 03, 2021
by
Dennis Willers
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent 4 Pressing same time tabu and giving the time pressed a value count
parent
2c5bfb68
Pipeline
#343
passed with stages
in 5 minutes and 27 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
TabuMiddlewareService.ts
src/app/dao/TabuMiddlewareService.ts
+0
-1
game.component.ts
src/app/game/game.component.ts
+22
-11
No files found.
src/app/dao/TabuMiddlewareService.ts
View file @
a0064812
...
...
@@ -39,7 +39,6 @@ export class TabuMiddlewareService {
}
getS2C
(
req
:
any
):
Promise
<
any
>
{
console
.
log
(
"
getS2C Request:
"
,
req
);
return
this
.
request
(
'
POST
'
,
`
${
environment
.
tabuMiddlewareURL
}
getS2C`
,
req
);
}
...
...
src/app/game/game.component.ts
View file @
a0064812
...
...
@@ -53,7 +53,8 @@ export class GameComponent implements OnInit, OnDestroy {
private
router
:
Router
,
private
activatedRoute
:
ActivatedRoute
,
private
isAllowedToPlay
:
IsAllowedToPlay
,
private
socketDataService
:
SocketDataService
)
{}
private
socketDataService
:
SocketDataService
)
{
}
ngOnInit
():
void
{
this
.
activatedRoute
.
paramMap
.
subscribe
(
params
=>
{
...
...
@@ -108,7 +109,7 @@ export class GameComponent implements OnInit, OnDestroy {
});
}
onTimesUp
():
void
{
onTimesUp
():
void
{
this
.
unsubscribeAll
();
this
.
router
.
navigate
([
this
.
sessionName
+
'
/
'
+
this
.
team
]);
}
...
...
@@ -124,28 +125,34 @@ export class GameComponent implements OnInit, OnDestroy {
}
},
593
);
}
startCountdown
():
void
{
setInterval
(()
=>
{
this
.
timeRemaining
=
this
.
timeRemaining
-=
1
;
},
1000
);
}
rightAnswer
():
void
{
this
.
newCard
();
rightAnswer
():
void
{
this
.
service
.
addPoint
({
spielname
:
this
.
sessionName
,
team
:
this
.
team
,
red
:
this
.
gameStatus
.
red
,
blue
:
this
.
gameStatus
.
blue
}).
then
(
value
=>
{
spielname
:
this
.
sessionName
,
team
:
this
.
team
,
red
:
this
.
gameStatus
.
red
,
blue
:
this
.
gameStatus
.
blue
,
cardID
:
this
.
gameStatus
.
activeCard
}).
then
(
value
=>
{
this
.
newCard
();
this
.
gameStatus
.
red
=
JSON
.
parse
(
value
.
red
);
this
.
gameStatus
.
blue
=
JSON
.
parse
(
value
.
blue
);
});
}
wrongAnswer
():
void
{
wrongAnswer
():
void
{
this
.
newCard
();
if
(
this
.
isExplainer
)
{
this
.
service
.
removePoint
({
spielname
:
this
.
sessionName
,
team
:
this
.
team
,
red
:
this
.
gameStatus
.
red
,
blue
:
this
.
gameStatus
.
blue
spielname
:
this
.
sessionName
,
team
:
this
.
team
,
red
:
this
.
gameStatus
.
red
,
blue
:
this
.
gameStatus
.
blue
,
cardID
:
this
.
gameStatus
.
activeCard
}).
then
(
value
=>
{
this
.
gameStatus
.
red
=
JSON
.
parse
(
value
.
red
);
this
.
gameStatus
.
blue
=
JSON
.
parse
(
value
.
blue
);
...
...
@@ -159,7 +166,11 @@ export class GameComponent implements OnInit, OnDestroy {
}
this
.
service
.
removePoint
({
spielname
:
this
.
sessionName
,
team
:
opennentTeam
,
red
:
this
.
gameStatus
.
red
,
blue
:
this
.
gameStatus
.
blue
spielname
:
this
.
sessionName
,
team
:
opennentTeam
,
red
:
this
.
gameStatus
.
red
,
blue
:
this
.
gameStatus
.
blue
,
cardID
:
this
.
gameStatus
.
activeCard
}).
then
(
value
=>
{
this
.
gameStatus
.
red
=
JSON
.
parse
(
value
.
red
);
this
.
gameStatus
.
blue
=
JSON
.
parse
(
value
.
blue
);
...
...
@@ -167,7 +178,7 @@ export class GameComponent implements OnInit, OnDestroy {
}
}
newCard
():
void
{
newCard
():
void
{
this
.
service
.
getS2C
({
spielname
:
this
.
sessionName
}).
then
(
value
=>
{
const
status
=
JSON
.
parse
(
value
.
status
);
if
(
status
)
{
...
...
@@ -197,11 +208,11 @@ export class GameComponent implements OnInit, OnDestroy {
this
.
gameStatus
.
redTurn
=
JSON
.
parse
(
value
.
redTurn
);
this
.
gameStatus
.
activeExplainer
=
JSON
.
parse
(
value
.
activeExplainer
);
this
.
gameStatus
.
activeCard
=
JSON
.
parse
(
value
.
activeCard
);
console
.
log
(
"
SOLUTION:
"
,
this
.
cardInfo
.
cardID
);
console
.
log
(
'
SOLUTION:
'
,
this
.
cardInfo
.
cardID
);
if
(
this
.
cardInfo
.
cardID
===
-
1
)
{
console
.
log
(
'
I am in
'
);
this
.
service
.
getCard
({
cardID
:
value
.
activeCard
}).
then
(
value1
=>
{
console
.
log
(
"
FIRST CARDS:
"
,
value1
);
console
.
log
(
'
FIRST CARDS:
'
,
value1
);
this
.
fillNewCard
(
value1
);
});
}
...
...
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