Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stephtelolahy committed Nov 19, 2023
1 parent eec5655 commit c75e980
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ private extension CardEffect {
case .eliminate:
EffectJust { .eliminate(player: $0.player()) }

case let .chooseCard(card):
EffectChooseCard(card: card)
case .drawArena:
EffectDrawArena()

case let .discard(card, chooser):
EffectDiscard(card: card, chooser: chooser)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
//
// EffectChooseCard.swift
// EffectDrawArena.swift
//
//
// Created by Hugues Stephano TELOLAHY on 20/06/2023.
//

struct EffectChooseCard: EffectResolver {
let card: ArgCard

struct EffectDrawArena: EffectResolver {
func resolve(state: GameState, ctx: EffectContext) throws -> [GameAction] {
let card = ArgCard.selectArena
let player = ctx.player()
return try card.resolve(state: state, ctx: ctx) {
switch card {
Expand Down
4 changes: 2 additions & 2 deletions GameKit/Sources/Game/State/CardEffect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public indirect enum CardEffect: Codable, Equatable {
/// - `toPlayer` is the player that receives the card
case passInPlay(ArgCard, toPlayer: ArgPlayer)

/// Choose card from a location
case chooseCard(ArgCard)
/// Draw cards from arena
case drawArena

/// Draw a card from deck and put to arena
case discover
Expand Down
4 changes: 2 additions & 2 deletions GameKit/Sources/Inventory/CardList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private extension CardList {
CardEffect.group {
CardEffect.discover
.repeat(.activePlayers)
CardEffect.chooseCard(.selectArena)
CardEffect.drawArena
.target(.all)
}
.on([.playImmediate])
Expand Down Expand Up @@ -370,7 +370,7 @@ private extension CardList {
CardEffect.discover
.repeat(.attr(.startTurnCards))
CardEffect.discover
CardEffect.chooseCard(.selectArena)
CardEffect.drawArena
.repeat(.attr(.startTurnCards))
CardEffect.putBack
}
Expand Down

0 comments on commit c75e980

Please sign in to comment.