Clase Atacable
/**
* Interface Atacable
*/
public interface Atacable {
//
// Fields
//
//
// Methods
//
//
// Accessor methods
//
//
// Other methods
//
/**
* @param a
*/
public void atacar( Atacable a );
/**
* @param intensidad
*/
public void recibirAtaque( int intensidad );
}
Clase Capturable
/**
* Interface Capturable
*/
public interface Capturable {
//
// Fields
//
//
// Methods
//
//
// Accessor methods
//
//
// Other methods
//
/**
*/
public void capturar( );
/**
*/
public void liberar( );
}
Clase Congelable
/**
* Interface Congelable
*/
public interface Congelable {
//
// Fields
//
//
// Methods
//
//
// Accessor methods
//
//
// Other methods
//
/**
*/
public void congelar( );
}
Clase Curable
/**
* Interface Curable
*/
public interface Curable {
//
// Fields
//
//
// Methods
//
//
// Accessor methods
//
//
// Other methods
//
/**
* @return int
*/
public int curar( );
}
Clase Mago
import java.util.*;
/**
* Class Mago
*/
public class Mago extends Personaje {
//
// Fields
//
//
// Constructors
//
public Mago () { };
//
// Methods
//
//
// Accessor methods
//
//
// Other methods
//
/**
* @param c
*/
public void lanzarHechizo( Congelable c )
{
}
/**
* @param c
*/
public void curar( Curable c )
{
}
}
Clase Ogro
import java.util.*;
/**
* Class Ogro
*/
public class Ogro extends PersonajeAtacable implements Capturable, Congelable {
//
// Fields
//
private boolean congelado = false;
//
// Constructors
//
public Ogro () { };
//
// Methods
//
//
// Accessor methods
//
/**
* Set the value of congelado
* @param newVar the new value of congelado
*/
private void setCongelado ( boolean newVar ) {
congelado = newVar;
}
/**
* Get the value of congelado
* @return the value of congelado
*/
private boolean getCongelado ( ) {
return congelado;
}
//
// Other methods
//
/**
* @param c
*/
public void capturar( Capturable c )
{
}
/**
*/
public void capturar( )
{
}
/**
*/
public void liberar( )
{
}
/**
*/
public void congelar( )
{
}
}
Clase Personaje
/**
* Class Personaje
*/
public class Personaje {
//
// Fields
//
private String nombre;
//
// Constructors
//
public Personaje () { };
//
// Methods
//
//
// Accessor methods
//
/**
* Set the value of nombre
* @param newVar the new value of nombre
*/
private void setNombre ( String newVar ) {
nombre = newVar;
}
/**
* Get the value of nombre
* @return the value of nombre
*/
private String getNombre ( ) {
return nombre;
}
//
// Other methods
//
}
Clase PersonajeAtacable
/**
* Class PersonajeAtacable
*/
public class PersonajeAtacable extends Personaje implements Atacable {
//
// Fields
//
static private int DEFAULT_VIDA = 100;
private int vida;
//
// Constructors
//
public PersonajeAtacable () { };
//
// Methods
//
//
// Accessor methods
//
/**
* Get the value of DEFAULT_VIDA
* @return the value of DEFAULT_VIDA
*/
private int getDEFAULT_VIDA ( ) {
return DEFAULT_VIDA;
}
/**
* Set the value of vida
* @param newVar the new value of vida
*/
private void setVida ( int newVar ) {
vida = newVar;
}
/**
* Get the value of vida
* @return the value of vida
*/
private int getVida ( ) {
return vida;
}
//
// Other methods
//
/**
* @param cuanta
*/
public void restarVida( int cuanta )
{
}
/**
* @param a
*/
public void atacar( Atacable a )
{
}
/**
* @param intensidad
*/
public void recibirAtaque( int intensidad )
{
}
}
Clase Princesa
/**
* Class Princesa
*/
public class Princesa extends Personaje implements Capturable {
//
// Fields
//
private String status = "libre";
//
// Constructors
//
public Princesa () { };
//
// Methods
//
//
// Accessor methods
//
/**
* Set the value of status
* @param newVar the new value of status
*/
private void setStatus ( String newVar ) {
status = newVar;
}
/**
* Get the value of status
* @return the value of status
*/
private String getStatus ( ) {
return status;
}
//
// Other methods
//
/**
*/
public void capturar( )
{
}
/**
*/
public void liberar( )
{
}
}
Clase Principe
import java.util.*;
/**
* Class Principe
*/
public class Principe extends PersonajeAtacable implements Curable {
//
// Fields
//
//
// Constructors
//
public Principe () { };
//
// Methods
//
//
// Accessor methods
//
//
// Other methods
//
/**
* @return Mago
*/
public Mago invocarMago( )
{
}
/**
* @param o
*/
public void atacar( Ogro o )
{
}
/**
* @param c
*/
public void rescatar( Capturable c )
{
}
/**
* @return int
*/
public int curar( )
{
}
}
Tambien autogeneramos en Pyton, pero la documentacion tecnica la realizamos en java, asi que nos basamos en estas autogeneraciones.
No hay comentarios:
Publicar un comentario