package com.poker.analyst.parse;
import java.util.List;
import com.poker.analyst.element.Board;
import com.poker.analyst.element.Card;
import com.poker.analyst.element.CardFace;
import com.poker.analyst.element.Player;
import com.poker.analyst.element.Rounds;
import com.poker.analyst.element.Suit;
import com.poker.analyst.elements.state.PlayerState;
public abstract class BufferParser {
String heroName;
public abstract ParserResult getParserResult(final String buffer, Rounds round);
public abstract List<String> getPlayersName(final String buffer);
public static Card parseCard(final String comb) {
if (comb.length() != 2) {
return null;
}
final CardFace face = CardFace.getCardFaceFromShortName(comb.charAt(0));
final Suit suit = Suit.getSuitFromShortName(comb.charAt(1));
if (suit != null && face != null) {
return new Card(suit, face);
}
return null;
}
public BufferParser(String heroName) {
super();
this.heroName = heroName;
}
public String getHeroName() {
return heroName;
}
public void setHeroName(String heroName) {
this.heroName = heroName;
}
}