forge icon indicating copy to clipboard operation
forge copied to clipboard

Similfy MagicColor stuff

Open Hanmac opened this issue 3 months ago • 11 comments

Right now, there are multiple ways of Colors being stored:

  • as Byte (mutable)
  • as String (short/long)
  • as Enum (MagicColor.Color, not really used?)
  • as ColorSet(immutable, Iterable Byte, but EnumSet too?)

CardFace in core uses ColorSet

CardState stores it as byte (to be changed by CloneState) Same with CardColor (with is byte + flag) but returns it as ColorSet after CardColor is applied to CardState one. In Card, chosenColor it is stored as Set<String>

addColor is used for:

  • CardState in CardFactory in CloneState (changes Byte)
  • Card in Animate and StaticAbility (adds CardColor)

setColor is used for:

  • CardState in CardFactory in CloneState (changes Byte)
  • Creating Effects and Emblems (Emblems are colorless)

PlayerController.chooseColors uses List<String> (can't use ColorSet as parameter, because Colorless might be allowed too)

Functions like getMostProminentColors or getColorByProminence should return ColorSet or EnumColor, not byte or string getMostProminentColorsFromList should not use List<String> or Iterable<String>

ChangeTextEffect for ChangeColorWord only uses "Choose Choose" Might better to simplify the code? Also would be better if it would create an Effect that uses StaticAbility Layers Would be cool if i could change changedTextColors Map<String,String> to something using Enum

Produced Color should not be a String ala "B B B" anymore, but more like a EnumMap<Color, Integer> to prevent overflows

Hanmac avatar Sep 09 '25 16:09 Hanmac