package com.trunksbomb.minetriad.game;

public enum CardSide {
    TOP(-1, 0),
    RIGHT(0, 1),
    BOTTOM(1, 0),
    LEFT(0, -1);

    private final int rowOffset;
    private final int columnOffset;

    CardSide(int rowOffset, int columnOffset) {
        this.rowOffset = rowOffset;
        this.columnOffset = columnOffset;
    }

    public int rowOffset() {
        return rowOffset;
    }

    public int columnOffset() {
        return columnOffset;
    }

    public CardSide opposite() {
        return switch (this) {
            case TOP -> BOTTOM;
            case RIGHT -> LEFT;
            case BOTTOM -> TOP;
            case LEFT -> RIGHT;
        };
    }
}
