-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into 18hiawatha-move-t…
…o-beta
- Loading branch information
Showing
3 changed files
with
180 additions
and
6 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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Engine | ||
module Game | ||
module G22Mars | ||
module Round | ||
class PermitPurchase < Engine::Round::Draft | ||
def self.short_name | ||
'PPR' | ||
end | ||
|
||
def name | ||
'Permit Purchase Round' | ||
end | ||
end | ||
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,52 @@ | ||
# frozen_string_literal: true | ||
|
||
module Engine | ||
module Game | ||
module G22Mars | ||
module Step | ||
class SelectOrDiscard < Engine::Step::SimpleDraft | ||
ACTIONS = %w[bid pass].freeze | ||
|
||
def setup | ||
@companies = @game.companies | ||
end | ||
|
||
def available | ||
[@companies.first] | ||
end | ||
|
||
def finished? | ||
@companies.empty? | ||
end | ||
|
||
def actions(entity) | ||
return [] if finished? | ||
|
||
entity == current_entity ? ACTIONS : [] | ||
end | ||
|
||
def process_pass(action) | ||
company = available.first | ||
player = action.entity | ||
|
||
company.close! | ||
@companies.delete(company) | ||
|
||
@log << "#{player.name} discards #{company.name} from the game" | ||
|
||
@round.next_entity_index! | ||
action_finalized | ||
end | ||
|
||
def description | ||
'Buy or Discard Permit' | ||
end | ||
|
||
def pass_description | ||
'Discard Permit' | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |