Card-Forge / Card-Forge/forge

Similfy MagicColor stuff

Open
#8,682 14 comments 1 reaction 1 assignee Claimed by @Hanmac View on GitHub
Game Mechanics GUI keep
Dominant language
Java
Stars
2.7k
Forks
1.1k
Avg merge
1d 1h
Merged PRs (30d)
163

Description

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

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 (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` or `Iterable`

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` to something using Enum

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.