Skip to content

Conversation

@Hanmac
Copy link
Contributor

@Hanmac Hanmac commented Jan 19, 2026

Part of #8682

This adds the basic land type to ColorEnum
to be used for later changes

@Jetz72
Copy link
Contributor

Jetz72 commented Jan 19, 2026

Perhaps call the field "basicLandType" if Colorless doesn't point to Wastes? Might make sense at some point to split some of these constructor parameters out to EnumMaps. The signature is getting a little cluttered.

@fediazgon
Copy link
Contributor

Is there any rationale with not making these enums? There are a bunch of places in the code where we do things like:

saMana.hasParam("ReplaceOnly")

where this could have been an enum. If you need a display name, you can also do:

public enum BasicLandType {
    PLAINS("Plains"),
    ISLAND("Island"),
    SWAMP("Swamp"),
    MOUNTAIN("Mountain"),
    FOREST("Forest");

    private final String displayName;

    BasicLandType(String displayName) {
        this.displayName = displayName;
    }

    public String getDisplayName() {
        return displayName;
    }
}

@Jetz72
Copy link
Contributor

Jetz72 commented Jan 20, 2026

Is there any rationale with not making these enums? There are a bunch of places in the code where we do things like:

saMana.hasParam("ReplaceOnly")

I'm not sure the example here illustrates the potential upside from such an enum. I don't think we have too many parameters or fields that we'd want to be exclusive to basic land types.

@fediazgon
Copy link
Contributor

fediazgon commented Jan 20, 2026

The main upside I see is discoverability. With something like saMana.hasParam(Param.REPLACE_ONLY), autocomplete makes it much easier to see what parameters are valid. With raw strings, unless you already know the exact value, it’s hard to tell what hasParam can take without searching the codebase.

Note: this is just an example to explain why I think String basicLand should also be an enum.

@tehdiplomat
Copy link
Contributor

Who is going to be responsible for converting all of the scripts into enums? And then keeping those up to date when new scripts are written?

@Hanmac
Copy link
Contributor Author

Hanmac commented Jan 20, 2026

the enum discussion is not part of this MR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants