Added sideswitch functionality, cleanup, comments
This commit is contained in:
@@ -21,7 +21,7 @@ function configTeam(team, name, name2, isSpielgemeinschaft) {};
|
||||
function setScore(team, score) {};
|
||||
function alterScore(team, dir) {};
|
||||
function clearScore() {};
|
||||
function toggleSwitch() {};
|
||||
function toggleSideSwitch() {};
|
||||
function getEnabled() {};
|
||||
function getValues() {};
|
||||
|
||||
@@ -83,8 +83,11 @@ function clearScore() {
|
||||
}
|
||||
|
||||
// Toggle sideswitch
|
||||
function toggleSwitch() {
|
||||
function toggleSideswitch() {
|
||||
console.log("Seiten gewechselt");
|
||||
sideswitch = !sideswitch;
|
||||
io.sockets.emit('score', print());
|
||||
io.sockets.emit('scoreSideswitch', '');
|
||||
}
|
||||
|
||||
// Return enabled value
|
||||
@@ -92,6 +95,7 @@ function getEnabled() {
|
||||
return enabled
|
||||
}
|
||||
|
||||
// Print current score depending on sideswitch
|
||||
function print() {
|
||||
if(sideswitch) {
|
||||
return teamB.score + ":" + teamA.score
|
||||
@@ -100,6 +104,7 @@ function print() {
|
||||
}
|
||||
}
|
||||
|
||||
// Return all important values
|
||||
function getValues() {
|
||||
return {
|
||||
enabled: enabled,
|
||||
|
||||
Reference in New Issue
Block a user