コード例 #1
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            allTaboos = new Taboos();
            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }
コード例 #2
0
        public GamePage()
        {
            InitializeComponent();
            allTaboos = MainPage.allTaboos;
            BackKeyPress += OnBackKeyPressed;
            actualTeam = (int)PhoneApplicationService.Current.State["ActualTeam"];
            teamPoints = (int[])PhoneApplicationService.Current.State["TeamPoints"];
            teamPointsTextLabel.Text = "" + teamPoints[actualTeam].ToString();
            gameSettings = MainPage.gameSettings;
            actualTime = gameSettings.getTime();
            //allTaboos = new Taboos();
            Debugger.Log(1, "Warning", "ZAŁADOWAŁEM TABOOS \n ");
            changeTaboo();
            accelSensor = new Accelerometer();

            // Add the accelerometer event handler to the accelerometer sensor.
            accelSensor.ReadingChanged +=
                new EventHandler<AccelerometerReadingEventArgs>(AccelerometerReadingChanged);


            // Start the accelerometer
            try
            {
                accelSensor.Start();
                
            }
            catch (AccelerometerFailedException e)
            {
                // the accelerometer couldn't be started.  No fun!
                
            }

            timer.Interval = new TimeSpan(0, 0, 0, 1);
            timer.Tick += new EventHandler(timer_Tick);
            timer.Start();
        }
コード例 #3
0
 public void changeTaboo(){
     JsonObj temp = allTaboos.randomTaboo();
     Taboo.Text = temp.taboo; //main taboo
     taboos.Text = "";
     if (temp.taboos != null)
         for (int i = 0; i < temp.taboos.Count; i++)  //taboos
             taboos.Text += temp.taboos.ElementAt(i) + "\n";
     else
     {
         MainPage.allTaboos = new Taboos();
         allTaboos = MainPage.allTaboos;
         changeTaboo();
     }
 }