Class: Baron::Round::InitialAuction

Inherits:
Baron::Round show all
Defined in:
lib/baron/round/initial_auction.rb

Overview

The initial auction round of the game

This is the phase of the game in which private companies are generally distributed, sometimes also containing directorships of companies.

Instance Attribute Summary

Attributes inherited from Baron::Round

#game

Instance Method Summary collapse

Methods inherited from Baron::Round

#end, #start

Constructor Details

#initialize(game) ⇒ InitialAuction

Create the initial auction round

Examples:

Baron::InitialAuction.new(game)

16
17
18
19
20
# File 'lib/baron/round/initial_auction.rb', line 16

def initialize(game)
  @game = game
  make_auctionable_companies_available
  new_auction(game.players)
end

Instance Method Details

#current_turnBaron::Turn

The current turn in the game

Examples:

round.current_turn

29
30
31
32
# File 'lib/baron/round/initial_auction.rb', line 29

def current_turn
  new_auction(ordered_players) if @current_turn.done?
  @current_turn
end

#next_priority_dealBaron::Player

The player who has priority deal for the next operating round

TODO: 1860 returns the player with the most money

Examples:

do

auction.next_priority_deal

57
58
59
# File 'lib/baron/round/initial_auction.rb', line 57

def next_priority_deal
  players.first
end

#over?Boolean

Returns whether the round is over

This will return true if there are no certificates remaining to be auctioned, and false otherwise.

Examples:

round.over?

44
45
46
# File 'lib/baron/round/initial_auction.rb', line 44

def over?
  game.initial_offering.certificates.empty?
end