public override void OnPacket(Packet packet)
 {
     if (packet.Intent == Intent.GameState)
     {
         OnGameStateUpdate?.Invoke(this, new GameStateUpdateEvent(packet.GetPayload <Common.Game>()));
     }
     else if (packet.Intent == Intent.Welcome)
     {
         OnGameStateUpdate?.Invoke(this, new GameStateUpdateEvent(packet.GetPayload <WelcomePayload>().Game));
     }
 }
Exemple #2
0
        public CityAndSeekClient(string url)
        {
            Url = url;

            OnGameStateUpdate += OnGameStateUpdateHandler;

            var gameStateUpdateHandler = new GameStateUpdateHandler(this);

            gameStateUpdateHandler.OnGameStateUpdate += (sender, e) => OnGameStateUpdate?.Invoke(sender, e);

            RequestHandlers = new List <IRequestHandler>
            {
                gameStateUpdateHandler
            };
        }
Exemple #3
0
 protected void UpdateGameState(OnGameStateUpdateArgs args)
 {
     OnGameStateUpdate?.Invoke(this, args);
 }