games: add: goal table
This commit is contained in:
@ -4,6 +4,8 @@ from .. import config
|
||||
|
||||
from channels.generic.websocket import WebsocketConsumer
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from .Position import Position
|
||||
from .Spectator import Spectator
|
||||
from .Point import Point
|
||||
@ -27,6 +29,8 @@ class Player(Spectator):
|
||||
|
||||
self.rail: Segment = rail
|
||||
|
||||
self.username: str = User.objects.get(pk = self.user_id).username
|
||||
|
||||
def receive(self, data: dict):
|
||||
|
||||
detail: str = data.get("detail")
|
||||
@ -111,6 +115,7 @@ class Player(Spectator):
|
||||
def to_dict(self) -> dict:
|
||||
|
||||
data = {
|
||||
"username": self.username,
|
||||
"user_id": self.user_id,
|
||||
"position": self.position.to_dict(),
|
||||
"nb_goal": self.nb_goal,
|
||||
|
Reference in New Issue
Block a user