コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();
            new LoadingScreen().ShowDialog();

            SetButtonClick();

            BanCoViewModel = new BanCoViewModel();
            BanCoViewModel.CurrentBanCo.OnPlayerAt  += CurrentBanCo_OnPlayerAt;
            BanCoViewModel.CurrentBanCo.OnPlayerWin += CurrentBanCo_OnPlayerWin;
            BanCoViewModel.CurrentBanCo.OnUndo      += CurrentBanCo_OnUndo;
            BanCoViewModel.CurrentBanCo.OnRedo      += CurrentBanCo_OnRedo;
            BanCoViewModel.CurrentBanCo.OnLoad      += CurrentBanCo_OnLoad;

            BanCoViewModel.CurrentBanCo.CurrentSocket.OnChatMessage += CurrentSocket_OnChatMessage;
            BanCoViewModel.CurrentBanCo.CurrentSocket.OnPlayAt      += CurrentSocket_OnPlayAt;
            BanCoViewModel.CurrentBanCo.CurrentSocket.OnEndGame     += CurrentSocket_OnEndGame;
            BanCoViewModel.CurrentBanCo.CurrentSocket.OnStart       += CurrentSocket_OnStart;

            btnPvP.Foreground = new SolidColorBrush(Colors.Yellow);
            BanCoViewModel.PvP();

            changeName.IsEnabled  = false;
            chatMessage.IsEnabled = false;

            btnChange.Content = "Start!";
        }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();

            SetButtonClick();

            BanCoViewModel = new BanCoViewModel();
            BanCoViewModel.CurrentBanCo.OnPlayerAt  += CurrentBanCo_OnPlayerAt;
            BanCoViewModel.CurrentBanCo.OnPlayerWin += CurrentBanCo_OnPlayerWin;
            BanCoViewModel.CurrentBanCo.OnUndo      += CurrentBanCo_OnUndo;
            BanCoViewModel.CurrentBanCo.OnRedo      += CurrentBanCo_OnRedo;

            BanCoViewModel.PvC();
            DrawBoard(Settings.Default.BOARD_SIZE);
        }