MAPG-235 basic gameflow works

This commit is contained in:
balazs committed 2021-05-12 21:01:41 +02:00
1 parent 5daed10036
commit 93f8fc3f34
10 files changed
+209 -55

No files matched your search

+1 -13
View File
@@ -4,7 +4,7 @@ class UserInChallenge extends Model
{
protected static string $table = 'user_in_challenge';
protected static array $fields = ['user_id', 'challenge_id', 'round', 'score', 'time_left', 'is_owner'];
protected static array $fields = ['user_id', 'challenge_id', 'round', 'time_left', 'is_owner'];
protected static array $relations = ['user' => User::class, 'challenge' => Challenge::class];
@@ -18,8 +18,6 @@ class UserInChallenge extends Model
private int $round = 0;
private int $score = 0;
private ?int $timeLeft = null;
private bool $isOwner = false;
@@ -49,11 +47,6 @@ class UserInChallenge extends Model
$this->round = $round;
}
public function setScore(int $score): void
{
$this->score = $score;
}
public function setTimeLeft(?int $timeLeft): void
{
if(isset($timeLeft)) {
@@ -91,11 +84,6 @@ class UserInChallenge extends Model
return $this->round;
}
public function getScore(): int
{
return $this->score;
}
public function getTimeLeft(): ?int
{
return $this->timeLeft;