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

📄 ronda.java

📁 J2ME 技术开发的扑克牌类游戏 是开源代码
💻 JAVA
字号:
/*
 * Ronda.java
 *
 * Created on 3 de junio de 2005, 12:34
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package telefono;

/**
 *
 * @author Enrique Vicent Ramis
 */
public class Ronda
{
    
    private int multiplicador;
    /** n?mero de cartas que se reparten en esta ronda */
    private int cartas;
    /** guarda los putos acumulados */
    private Integer [] puntos;
    
    
    public Ronda(int jugadores)
    {
        this(jugadores,0);
    }
    
    public Ronda(int jugadores,int cartas)
    {
        this(jugadores,1,1);
    }
    
    public Ronda(int jugadores,int cartas,int multiplicador)
    {
        this.multiplicador=multiplicador;
        this.cartas=cartas;
        this.puntos=new Integer[jugadores];
        for (int i=0;i<jugadores;i++)
            puntos[i]=null;
    }

    public int getMultiplicador()
    {
        return multiplicador;
    }

    public void setMultiplicador(int multiplicador)
    {
        this.multiplicador = multiplicador;
    }

    public int getCartas()
    {
        return cartas;
    }

    public void setCartas(int cartas)
    {
        this.cartas = cartas;
    }
    
    /** da los puntos totales de un jugador*/
    public int getPuntos(int jugador) throws IndexOutOfBoundsException
    {
        Integer result=null;
        result=this.puntos[jugador-1];
        if(result==null)
            throw new IndexOutOfBoundsException();
        return result.intValue();
    }
    
    /** establece los puntos totales de un jugador */
    public void setPuntos(int jugador,int valor)throws IndexOutOfBoundsException
    {
        this.puntos[jugador-1]=new Integer(valor);
    }
}

⌨️ 快捷键说明

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