예제 #1
0
파일: Morte.java 프로젝트: kalibu/pre-dojo
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((arma == null) ? 0 : arma.hashCode());
   result = prime * result + ((data == null) ? 0 : data.hashCode());
   result = prime * result + ((matador == null) ? 0 : matador.hashCode());
   result = prime * result + ((morto == null) ? 0 : morto.hashCode());
   return result;
 }
예제 #2
0
파일: Morte.java 프로젝트: kalibu/pre-dojo
 @Override
 public boolean equals(Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (getClass() != obj.getClass()) return false;
   Morte other = (Morte) obj;
   if (arma == null) {
     if (other.arma != null) return false;
   } else if (!arma.equals(other.arma)) return false;
   if (data == null) {
     if (other.data != null) return false;
   } else if (!data.equals(other.data)) return false;
   if (matador == null) {
     if (other.matador != null) return false;
   } else if (!matador.equals(other.matador)) return false;
   if (morto == null) {
     if (other.morto != null) return false;
   } else if (!morto.equals(other.morto)) return false;
   return true;
 }
예제 #3
0
 public int dano() {
   return arma.getDano() - armadura.getResistencia();
 }