-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement remaining Academy Elite ability
- Loading branch information
Showing
5 changed files
with
131 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module Magic | ||
module Costs | ||
class RemoveCounter | ||
attr_reader :source, :counter_class | ||
|
||
def initialize(source, counter_class) | ||
@source = source | ||
@counter_class = counter_class | ||
end | ||
|
||
def can_pay? | ||
source.counters.count(counter_class) > 0 | ||
end | ||
|
||
def finalize!(_player) | ||
source.remove_counter(counter_class) | ||
end | ||
end | ||
end | ||
end |
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,18 @@ | ||
module Magic | ||
module Events | ||
class CounterRemoved | ||
attr_reader :permanent, :player, :counter_type, :amount | ||
|
||
def initialize(permanent: nil, player: nil, counter_type:, amount:) | ||
@permanent = permanent | ||
@player = player | ||
@counter_type = counter_type | ||
@amount = amount | ||
end | ||
|
||
def inspect | ||
"#<Events::CounterRemoved player: #{player&.name}, permanent: #{permanent&.name}, type: #{counter_type}, amount: #{amount}>" | ||
end | ||
end | ||
end | ||
end |
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