Package com.poker.analyst.parse

Source Code of com.poker.analyst.parse.BufferParser

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;
  }
   

   
}
TOP

Related Classes of com.poker.analyst.parse.BufferParser

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.