Exemplo n.º 1
0
        public MainPage()
        {
            InitializeComponent();

            NetworkProcess();

            iIterstitia = DependencyService.Get <iAd_IterstitialView>();
            rewardVideo = DependencyService.Get <iAd_RewardVideoView>();
        }
Exemplo n.º 2
0
        public Lobby()
        {
            InitializeComponent();

            iIterstitia = DependencyService.Get <iAd_IterstitialView>();
            //      iIterstitia.ShowAd();

            mypicture.Source = null;

            Device.StartTimer(TimeSpan.FromMilliseconds(50), () =>
            {
                if (NoticeLabel.TranslationX > -(NoticeLabel.Width + (NoticeLabel.Width * 0.2)))
                {
                    NoticeLabel.TranslationX -= 5f;
                }
                else
                {
                    NoticeLabel.TranslationX = NoticeLabel.Width;
                }

                return(true);
            });


            //network thread
            Task.Run(() =>
            {
                while (true)
                {
                    NetProcess.start();
                    NetProcess.client.PacketRecvSync();
                }
            });

            //network thread
            Task.Run(() =>
            {
                DateTime checktime = DateTime.Now;

                while (true)
                {
                    NetProcess.Loop(this);
                }
            });

            UpdateLocalMenu();

            Navigation.PushModalAsync(new Loading() /*_MachPage*/);
        }
Exemplo n.º 3
0
        public SingleMatch()
        {
            InitializeComponent();

            InitBoardGrid();

            iIterstitia = DependencyService.Get <iAd_IterstitialView>();
            rewardVideo = DependencyService.Get <iAd_RewardVideoView>();

            _ai._renderer = _renderer;

            Device.StartTimer(TimeSpan.FromSeconds(1), () =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    try
                    {
                        if (User.myInfo.ai_reset_flag == true)
                        {
                            _ai.PlayGame(User.myInfo.ai_rule, User.myInfo.ai_mode);
                            isPlaying = true;
                            User.myInfo.ai_reset_flag = false;

                            _renderer.UpdateBattleInfo();
                        }

                        if (isPlaying == true)
                        {
                            isPlaying = _ai.PlaygameLoop(this, User.myInfo.ai_mode);

                            if (isPlaying == false) //종료
                            {
                                isPlaying = false;
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.ToString());
                    }
                });

                if (isExit == true)
                {
                    return(false);
                }

                return(true);
            });

            iIterstitia = DependencyService.Get <iAd_IterstitialView>();

            Clicked.IsEnabled = false;


            MessagingCenter.Subscribe <SingleMatch>(this, "close", (sender) =>
            {
                Navigation.PopModalAsync();
            });


            //언어 수동 변환
            if (User.Locale != "ko")
            {
                LeaveRoom.Text = "Exit";

                LeftButton.Text  = "Left";
                UPButton.Text    = "Up";
                Clicked.Text     = "Stone";
                DownButton.Text  = "Down";
                RightButton.Text = "Right";

                black.Text = "Black";
                white.Text = "White";

                BeginBtn.Text = "Begin";
                RuleBtn.Text  = "Rule";
            }
        }