async Task IMiscDataNM.MiscDataReceived(string status, string content) { switch (status) //can't do switch because we don't know what the cases are ahead of time. { case "goout": MultiplayerOut thisOut = await js.DeserializeObjectAsync <MultiplayerOut>(content); WasGuarantee = thisOut.WasGuaranteed; CardForDiscard = _gameContainer.DeckList !.GetSpecificItem(thisOut.Deck); await GoOutAsync(); break; default: throw new BasicBlankException($"Nothing for status {status} with the message of {content}"); } }
public async Task GoOutAsync() { if (_mainGame !.CanGoOut() == false) { await UIPlatform.ShowMessageAsync("Sorry; you cannot go out"); return; } if (_mainGame.BasicData !.MultiPlayer == true) { MultiplayerOut thisOut = new MultiplayerOut(); thisOut.Deck = _mainGame.CardForDiscard !.Deck; thisOut.WasGuaranteed = _mainGame.WasGuarantee; await _mainGame.Network !.SendAllAsync("goout", thisOut); } await _mainGame.GoOutAsync(); }