public MainPage() { InitializeComponent(); _chartView = InitializeChartView(); _circularGauge = InitializeCircularGauge(); _accelerationVector = AccelerationVector.X; stkChart.Children.Add(_chartView); }
/// <summary> /// Change Accelerometer Reading /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnAcceleration_Clicked(object sender, EventArgs e) { string selectedButton = (sender as Button).Text.ToUpper(); switch (selectedButton) { case "X": _chartView.Chart.SubTitle.Text = "X Axis"; _accelerationVector = AccelerationVector.X; break; case "Y": _chartView.Chart.SubTitle.Text = "Y Axis"; _accelerationVector = AccelerationVector.Y; break; case "Z": _chartView.Chart.SubTitle.Text = "Z Axis"; _accelerationVector = AccelerationVector.Z; break; } }
private AccelerationVector ChooseAcceleration(PlayingdInfo info) { // Get your own sphere. // // Other sphere information is the same. Sphere myself = info.players[roundInfo.yourIndex]; // Position. int x = myself.x; int y = myself.y; // Velocity. int vx = myself.vx; int vy = myself.vy; // Other information. int index = myself.index; bool inArena = myself.inArena; // -------------------------------------------------------------- // Your code begins here. // -------------------------------------------------------------- // You are expected to return an AccelerationVector. AccelerationVector result = new AccelerationVector(); // Return dummy value. result.dVx = roundInfo.maxSpeedVariation; result.dVy = 0; // -------------------------------------------------------------- // Your code ends here. // -------------------------------------------------------------- return result; }