private void Connect_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { KulamiPeer peer = IncomingChallengesListBox.SelectedPeer(); if (peer == null) { return; } peer.SendResponse(true); StartGame(peer, BoardSetup.GetBoard(peer.IncomingRequest.BoardNum), !peer.IncomingRequest.ChallengerGoesFirst); }
public void Start() { dead = GameObject.FindGameObjectWithTag("Dead"); BoardSetup setup = this.gameObject.GetComponent <BoardSetup>(); playerManager = this.gameObject.GetComponent <PlayerManager>(); setup.InitBoard(); setup.InitPlayers(); setup.InitPieces(); board = setup.GetBoard(); playerManager.SetInitialTurnState(); }
private void on_game_response(object sender, NetGameResponseEventArgs e) { KulamiPeer peer = sender as KulamiPeer; if (peer == null) { return; } if (e.ChallengeAccpeted) { StartGame(peer, BoardSetup.GetBoard(e.BoardNum), e.ChallengerGoesFirst); } else { Dispatcher.Invoke(() => { IncomingChallengesListBox.RemovePeer(peer, IncomingChallengesCanvas); }); } }