Beispiel #1
0
        public void ListenerStart()
        {
            button_state       = false;
            btn_sender.Enabled = false;
            btn_recever.Text   = "待ち受けを停止する";
            ListenerResponseDelegate result_delegate = new ListenerResponseDelegate(ListenerResponse);

            network.ListenMessage(SENDER_PORT, result_delegate, listener_exception_delegate);
        }
Beispiel #2
0
 //じゃんけんの結果を設定する
 private void SetResult(Choice player1_choice, Choice player2_choice, Result result)
 {
     //結果をテキストに設定
     lbl_result.Text = result.ToString();
     //プレイヤー1,2の選択をテキストに設定
     lbl_player1.Text = player1_choice.ToString();
     lbl_player2.Text = player2_choice.ToString();
     //選択の初期化(もう一度選択ができるようになる)
     UnlockSelect();
     network.ListenMessage(GAME_PORT, listener_result_delegate, listener_exception_delegate);
 }
Beispiel #3
0
        public JankenForm(ShowConfigFormDelegate show_config, IPAddress address)
        {
            InitializeComponent();
            this.show_config = show_config;
            lbl_result.Text  = "";
            lbl_player1.Text = "";
            lbl_player2.Text = "";
            ResultDelegate result_delegate = new ResultDelegate(JankenResponse);

            this.bt     = new LibJanken(result_delegate);
            this.random = new Random(1000);

            network      = new LibUDP();
            peer_address = address;


            listener_result_delegate    = new ListenerResponseDelegate(ListenerResponse);
            listener_exception_delegate = new ListenerExceptionDelegate(ShowExceptionMessage);
            network.ListenMessage(GAME_PORT, listener_result_delegate, listener_exception_delegate);
        }