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)); } }
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 }; }
protected void UpdateGameState(OnGameStateUpdateArgs args) { OnGameStateUpdate?.Invoke(this, args); }