コード例 #1
0
ファイル: GameWheel.cs プロジェクト: hdshivambu/NumberWheel
        // calculate the answer by simulating the whole spin
        string Simulate()
        {
            GameWheel simulation = new GameWheel();

            simulation.sectorAngle      = this.sectorAngle;
            simulation.rotateAngle      = this.rotateAngle;
            simulation.initialRotations = this.initialRotations;
            simulation.repaintCounter   = 0;

            simulation.wheel = new Sector[this.wheel.Length];
            for (int i = 0; i < this.wheel.Length; i++)
            {
                simulation.wheel[i] = new Sector(i, this.wheel[i].value, this.sectorAngle, Color.Blue);
            }

            simulation.state = STATE_INITIAL_SPIN;
            while (simulation.state != STATE_HIGHLIGHTING)
            {
                simulation.Refresh(false);
            }
            return(simulation.result);
        }
コード例 #2
0
 private void timerRepaint_Tick(object sender, EventArgs e)
 {
     wheel.Refresh(true);
 }