-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a selection step for wild card colors
Fixes #17
- Loading branch information
Showing
14 changed files
with
178 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/io/github/haykam821/lastcard/card/display/CardRenderData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.github.haykam821.lastcard.card.display; | ||
|
||
import eu.pb4.mapcanvas.api.core.DrawableCanvas; | ||
import io.github.haykam821.lastcard.card.Card; | ||
import io.github.haykam821.lastcard.card.color.CardColor; | ||
import io.github.haykam821.lastcard.card.color.ColorRepresentation; | ||
|
||
public record CardRenderData(Card card, CardColor overrideColor) { | ||
public DrawableCanvas renderCard() { | ||
ColorRepresentation color = this.overrideColor == null ? this.card.getSelector() : this.overrideColor; | ||
return this.card.render(color); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/io/github/haykam821/lastcard/card/display/region/OpenSelectorCardRegion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.github.haykam821.lastcard.card.display.region; | ||
|
||
import io.github.haykam821.lastcard.card.Card; | ||
import io.github.haykam821.lastcard.card.display.player.PrivateCardDisplay; | ||
import io.github.haykam821.lastcard.game.player.AbstractPlayerEntry; | ||
|
||
public class OpenSelectorCardRegion extends CardRegion { | ||
private final Card card; | ||
private final PrivateCardDisplay display; | ||
|
||
public OpenSelectorCardRegion(Card card, PrivateCardDisplay display, int minX, int minY, int maxX, int maxY) { | ||
super(minX, minY, maxX, maxY); | ||
|
||
this.card = card; | ||
this.display = display; | ||
} | ||
|
||
@Override | ||
public void onClick(AbstractPlayerEntry player, int x, int y) { | ||
this.display.setSelectingCard(this.card); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "OpenSelectorCardRegion{card=" + this.card + ", display=" + this.display + "}" + this.getBoundsString(); | ||
} | ||
} |
Oops, something went wrong.