Skip to content
Snippets Groups Projects
Commit b30c98f1 authored by Siyu Lin's avatar Siyu Lin
Browse files

OnePairEvaluator implements IEvaluator temporarily without extending AbstractEvaluator Class

parent 277d747a
No related branches found
No related tags found
No related merge requests found
package hw3; package hw3;
import api.Card;
import api.Hand;
/** /**
* Evaluator for a hand in which the rank of each card is a prime number. * Evaluator for a hand in which the rank of each card is a prime number.
* The number of cards required is equal to the hand size. * The number of cards required is equal to the hand size.
...@@ -8,7 +11,7 @@ package hw3; ...@@ -8,7 +11,7 @@ package hw3;
*/ */
//Note: You must edit this declaration to extend AbstractEvaluator //Note: You must edit this declaration to extend AbstractEvaluator
//or to extend some other class that extends AbstractEvaluator //or to extend some other class that extends AbstractEvaluator
public class AllPrimesEvaluator public class AllPrimesEvaluator extends AbstractEvaluator
{ {
/** /**
* Constructs the evaluator. * Constructs the evaluator.
...@@ -22,5 +25,53 @@ public class AllPrimesEvaluator ...@@ -22,5 +25,53 @@ public class AllPrimesEvaluator
// TODO: call appropriate superclass constructor and // TODO: call appropriate superclass constructor and
// perform other initialization // perform other initialization
} }
@Override
public String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getRanking() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int cardsRequired() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int handSize() {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean canSatisfy(Card[] mainCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canSubsetSatisfy(Card[] allCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public Hand createHand(Card[] allCards, int[] subset) {
// TODO Auto-generated method stub
return null;
}
@Override
public Hand getBestHand(Card[] allCards) {
// TODO Auto-generated method stub
return null;
}
} }
package hw3; package hw3;
import api.Card;
import api.Hand;
/** /**
* Evaluator satisfied by any set of cards. The number of * Evaluator satisfied by any set of cards. The number of
* required cards is equal to the hand size. * required cards is equal to the hand size.
...@@ -8,7 +11,7 @@ package hw3; ...@@ -8,7 +11,7 @@ package hw3;
*/ */
//Note: You must edit this declaration to extend AbstractEvaluator //Note: You must edit this declaration to extend AbstractEvaluator
//or to extend some other class that extends AbstractEvaluator //or to extend some other class that extends AbstractEvaluator
public class CatchAllEvaluator public class CatchAllEvaluator extends AbstractEvaluator
{ {
/** /**
* Constructs the evaluator. * Constructs the evaluator.
...@@ -22,6 +25,54 @@ public class CatchAllEvaluator ...@@ -22,6 +25,54 @@ public class CatchAllEvaluator
// TODO: call appropriate superclass constructor and // TODO: call appropriate superclass constructor and
// perform other initialization // perform other initialization
} }
@Override
public String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getRanking() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int cardsRequired() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int handSize() {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean canSatisfy(Card[] mainCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canSubsetSatisfy(Card[] allCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public Hand createHand(Card[] allCards, int[] subset) {
// TODO Auto-generated method stub
return null;
}
@Override
public Hand getBestHand(Card[] allCards) {
// TODO Auto-generated method stub
return null;
}
} }
package hw3; package hw3;
import api.Card;
import api.Hand;
/** /**
* Evaluator for a hand containing (at least) four cards of the same rank. * Evaluator for a hand containing (at least) four cards of the same rank.
* The number of cards required is four. * The number of cards required is four.
...@@ -8,7 +11,7 @@ package hw3; ...@@ -8,7 +11,7 @@ package hw3;
*/ */
//Note: You must edit this declaration to extend AbstractEvaluator //Note: You must edit this declaration to extend AbstractEvaluator
//or to extend some other class that extends AbstractEvaluator //or to extend some other class that extends AbstractEvaluator
public class FourOfAKindEvaluator public class FourOfAKindEvaluator extends AbstractEvaluator
{ {
/** /**
* Constructs the evaluator. * Constructs the evaluator.
...@@ -22,6 +25,54 @@ public class FourOfAKindEvaluator ...@@ -22,6 +25,54 @@ public class FourOfAKindEvaluator
// TODO: call appropriate superclass constructor and // TODO: call appropriate superclass constructor and
// perform other initialization // perform other initialization
} }
@Override
public String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getRanking() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int cardsRequired() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int handSize() {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean canSatisfy(Card[] mainCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canSubsetSatisfy(Card[] allCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public Hand createHand(Card[] allCards, int[] subset) {
// TODO Auto-generated method stub
return null;
}
@Override
public Hand getBestHand(Card[] allCards) {
// TODO Auto-generated method stub
return null;
}
} }
package hw3; package hw3;
import api.Card;
import api.Hand;
/** /**
* Evaluator for a generalized full house. The number of required * Evaluator for a generalized full house. The number of required
* cards is equal to the hand size. If the hand size is an odd number * cards is equal to the hand size. If the hand size is an odd number
...@@ -16,7 +19,7 @@ package hw3; ...@@ -16,7 +19,7 @@ package hw3;
*/ */
//Note: You must edit this declaration to extend AbstractEvaluator //Note: You must edit this declaration to extend AbstractEvaluator
//or to extend some other class that extends AbstractEvaluator //or to extend some other class that extends AbstractEvaluator
public class FullHouseEvaluator public class FullHouseEvaluator extends AbstractEvaluator
{ {
/** /**
* Constructs the evaluator. * Constructs the evaluator.
...@@ -30,4 +33,52 @@ public class FullHouseEvaluator ...@@ -30,4 +33,52 @@ public class FullHouseEvaluator
// TODO: call appropriate superclass constructor and // TODO: call appropriate superclass constructor and
// perform other initialization // perform other initialization
} }
@Override
public String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getRanking() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int cardsRequired() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int handSize() {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean canSatisfy(Card[] mainCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canSubsetSatisfy(Card[] allCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public Hand createHand(Card[] allCards, int[] subset) {
// TODO Auto-generated method stub
return null;
}
@Override
public Hand getBestHand(Card[] allCards) {
// TODO Auto-generated method stub
return null;
}
} }
...@@ -14,6 +14,8 @@ import api.IEvaluator; ...@@ -14,6 +14,8 @@ import api.IEvaluator;
//or to extend some other class that extends AbstractEvaluator //or to extend some other class that extends AbstractEvaluator
public class OnePairEvaluator implements IEvaluator public class OnePairEvaluator implements IEvaluator
{ {
private int ranking;
private int handSize;
/** /**
* Constructs the evaluator. * Constructs the evaluator.
* @param ranking * @param ranking
...@@ -25,18 +27,21 @@ public class OnePairEvaluator implements IEvaluator ...@@ -25,18 +27,21 @@ public class OnePairEvaluator implements IEvaluator
{ {
// TODO: call appropriate superclass constructor and // TODO: call appropriate superclass constructor and
// perform other initialization // perform other initialization
this.ranking = ranking;
this.handSize = handSize;
} }
@Override @Override
public String getName() { public String getName() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null; return "One Pair";
} }
@Override @Override
public int getRanking() { public int getRanking() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return 0; return ranking;
} }
@Override @Override
...@@ -48,7 +53,7 @@ public int cardsRequired() { ...@@ -48,7 +53,7 @@ public int cardsRequired() {
@Override @Override
public int handSize() { public int handSize() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return 0; return handSize;
} }
@Override @Override
......
package hw3; package hw3;
import api.Card;
import api.Hand;
/** /**
* Evaluator for a hand containing (at least) three cards of the same rank. * Evaluator for a hand containing (at least) three cards of the same rank.
* The number of cards required is three. * The number of cards required is three.
...@@ -8,7 +11,7 @@ package hw3; ...@@ -8,7 +11,7 @@ package hw3;
*/ */
//Note: You must edit this declaration to extend AbstractEvaluator //Note: You must edit this declaration to extend AbstractEvaluator
//or to extend some other class that extends AbstractEvaluator //or to extend some other class that extends AbstractEvaluator
public class ThreeOfAKindEvaluator public class ThreeOfAKindEvaluator extends AbstractEvaluator
{ {
/** /**
* Constructs the evaluator. * Constructs the evaluator.
...@@ -23,4 +26,52 @@ public class ThreeOfAKindEvaluator ...@@ -23,4 +26,52 @@ public class ThreeOfAKindEvaluator
// perform other initialization // perform other initialization
} }
@Override
public String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getRanking() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int cardsRequired() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int handSize() {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean canSatisfy(Card[] mainCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canSubsetSatisfy(Card[] allCards) {
// TODO Auto-generated method stub
return false;
}
@Override
public Hand createHand(Card[] allCards, int[] subset) {
// TODO Auto-generated method stub
return null;
}
@Override
public Hand getBestHand(Card[] allCards) {
// TODO Auto-generated method stub
return null;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment