001package ball.game.card.poker;
002/*-
003 * ##########################################################################
004 * Game Applications and Utilities
005 * %%
006 * Copyright (C) 2010 - 2022 Allen D. Ball
007 * %%
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *      http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 * ##########################################################################
020 */
021import ball.game.card.Card;
022import java.util.function.Predicate;
023
024import static ball.game.card.Card.Rank.JACK;
025import static ball.game.card.Card.Rank.KING;
026import static ball.game.card.Card.Suit.HEARTS;
027import static ball.game.card.Card.Suit.SPADES;
028import static ball.game.card.Card.Suit.DIAMONDS;
029
030/**
031 * Poker-specific static fields and methods.
032 *
033 * @author {@link.uri mailto:ball@hcf.dev Allen D. Ball}
034 */
035public abstract class Poker {
036    private Poker() { }
037
038    /**
039     * {@link Predicate} to test for one-eyed
040     * {@link ball.game.card.Card.Rank#JACK JACK}
041     */
042    public Predicate<Card> ONE_EYED_JACK = JACK.and(SPADES.or(HEARTS));
043
044    /**
045     * {@link Predicate} to test for one-eyed
046     * {@link ball.game.card.Card.Rank#KING KING}
047     */
048    public Predicate<Card> ONE_EYED_KING = KING.and(DIAMONDS);
049
050    /**
051     * {@link Predicate} to test for "suicide"
052     * {@link ball.game.card.Card.Rank#KING KING}
053     */
054    public Predicate<Card> SUICIDE_KING = KING.and(HEARTS);
055}