Hopeless with bitwise operators
OK, I'm a dunce with bitwise operators.
In the CardColor class, given another CardColor, I want to find all colors that are NOT in the base CardColor.
So if my base CardColor is Green, and I pass in a Green-White, I want to get White out.
Something like:
In the CardColor class, given another CardColor, I want to find all colors that are NOT in the base CardColor.
So if my base CardColor is Green, and I pass in a Green-White, I want to get White out.
Something like:
- Code: Select all
public CardColor getOffColors(CardColor ccOther) {
return CardColor.fromMask(~this.myColor & ccOther.myColor);
}