Exemplo n.º 1
0
 private void HandleGameJoined(GameJoined gameJoined)
 {
     foreach (var handler in gameJoinedHandlers.ToArray())
     {
         handler(gameJoined);
     }
 }
Exemplo n.º 2
0
    private void OnGameJoined(GameJoined gameJoined)
    {
        Debug.Log("OnGameJoined: " + gameJoined.GUID);
        CurrentGame = new Game(gameJoined.Players);

        foreach (var player in gameJoined.Players)
        {
            Debug.Log($"OnGameJoined Player {player.Guid}: {player.Nickname}");
        }
    }
Exemplo n.º 3
0
        private void On(GameJoined @event)
        {
            var entry = Dict[@event.ID];

            if (@event.AccountID != entry.Receiver && entry.PlayerWhite == default)
            {
                entry.PlayerWhite = @event.AccountID;
            }
            else
            {
                entry.PlayerBlack = @event.AccountID;
            }
        }
Exemplo n.º 4
0
        public void JoinGame(IGameModel game, IUserModel user)
        {
            var message = new GameJoined()
            {
                User2Id = user.Id,
                GameId  = game.Id
            };

            var changed = this.ModelUpdaterResolver.GetUpdater <IUpdatableGame, GameJoined>().Update(this.model.Games.FirstOrDefault(x => x.Id == message.GameId), message);

            if (changed)
            {
                this.ServiceClient.PublishAsync <GameJoined>(message);
            }
        }
Exemplo n.º 5
0
 internal void RaiseGameJoined(KgsGame ongame)
 {
     GameJoined?.Invoke(this, ongame);
 }
Exemplo n.º 6
0
 private void OnGameJoined(GameJoined gameJoined)
 {
     SwitchScreen(ScreenStates.GameJoin);
 }