⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 randomchoosetask.java

📁 一款麻将游戏的J2me源代码
💻 JAVA
字号:
// FrontEnd Plus GUI for JAD
// DeCompiled : RandomChooseTask.class
 
import java.util.*;

// Referenced classes of package com.joypark.mj13:
//            RandomChooseThread

public class RandomChooseTask extends TimerTask
{

    private int m_nRandomTimes;
    private RandomChooseThread m_RandomChooseThread;

    public RandomChooseTask(RandomChooseThread randomchoosethread)
    {
        m_nRandomTimes = 0;
        m_RandomChooseThread = randomchoosethread;
    }

    public void run()
    {
        if(++m_nRandomTimes == 8)
            m_RandomChooseThread.cancelRandomChooseTimer();
        int i = 0;
        do
            i = getNextRandom();
        while(m_RandomChooseThread.getComputerPosition() == i || m_RandomChooseThread.getHumanPosition() == i);
        m_RandomChooseThread.setComputerPosition(i);
        m_RandomChooseThread.repaintCharacterChooserCanvas();
        if(m_nRandomTimes == 8)
            (new Timer()).schedule(new TimerTask() {

                public void run()
                {
                    m_RandomChooseThread.endChoice();
                }

            }, 1500L);
    }

    private int getNextRandom()
    {
        return Math.abs((new Random()).nextInt()) % 6;
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -