package com.tiedup.remake.cells;

/**
 * Enum indicating who owns a cell.
 * Used to distinguish player-created cells from camp-generated cells.
 *
 * Extracted from CellData.OwnerType to decouple V2 code from V1 CellData.
 */
public enum CellOwnerType {
    /** Cell created by a player using Cell Wand */
    PLAYER("player"),
    /** Cell generated with a kidnapper camp structure */
    CAMP("camp");

    private final String serializedName;

    CellOwnerType(String serializedName) {
        this.serializedName = serializedName;
    }

    public String getSerializedName() {
        return serializedName;
    }

    public static CellOwnerType fromString(String name) {
        for (CellOwnerType type : values()) {
            if (type.serializedName.equalsIgnoreCase(name)) {
                return type;
            }
        }
        return PLAYER; // Default to PLAYER for backwards compatibility
    }
}
