Example #1
0
File: Game.cs Project: LwPol/Makao
        private CardRank?User_JackDemandChoice()
        {
            state.LordAndSaviour.DefferMoveMadeDeclaration = true;

            MethodInvoker dialogInvoke = () =>
            {
                DemandDialog dlg = new DemandDialog(DemandDialogType.JackDemand);
                dlg.ShowDialog(mainWindow);

                if (dlg.DialogResult == DialogResult.OK)
                {
                    if (dlg.DemandedRank.HasValue)
                    {
                        state.JackDemand = new JackDemandInfo(dlg.DemandedRank.Value, (uint)state.PlayersInGame.Count);
                    }
                }

                dlg.Dispose();

                state.LordAndSaviour.DeclareMoveMade();
            };

            mainWindow.BeginInvoke(dialogInvoke);

            return(null);
        }
Example #2
0
File: Game.cs Project: LwPol/Makao
        private CardSuit?User_AceDemandChoice()
        {
            state.LordAndSaviour.DefferMoveMadeDeclaration = true;

            MethodInvoker dialogInvoke = () =>
            {
                DemandDialog dlg = new DemandDialog(DemandDialogType.AceDemand);
                dlg.ShowDialog(mainWindow);

                if (dlg.DialogResult == DialogResult.OK)
                {
                    if (dlg.DemandedSuit.HasValue && dlg.DemandedSuit.Value != state.MakaoStack.TopCard.Suit)
                    {
                        state.AceSuit = dlg.DemandedSuit.Value;
                    }
                }

                dlg.Dispose();

                state.LordAndSaviour.DeclareMoveMade();
            };

            mainWindow.BeginInvoke(dialogInvoke);

            return(null);
        }