Class: Baron::Action::StartCompany

Inherits:
Baron::Action show all
Defined in:
lib/baron/action/start_company.rb

Overview

Start a new company by purchasing the directors certificate and setting the par price.

Instance Attribute Summary

Attributes inherited from Baron::Action

#player

Instance Method Summary collapse

Methods inherited from Baron::Action

#process, #symbol

Constructor Details

#initialize(game, player, company, par_price) ⇒ StartCompany

Create the start company action

Examples:

Baron::Action::StartCompany.new(
  game,
  player,
  company,
  Baron::Money.new(100)
)

Parameters:


22
23
24
25
26
27
# File 'lib/baron/action/start_company.rb', line 22

def initialize(game, player, company, par_price)
  @game = game
  @player = player
  @company = company
  @par_price = par_price
end

Instance Method Details

#setupvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Perform the appropriate setup when the company is started

This will set the par price of the company, tranfer the directors certificate to the player who started the company (in exchange for the appropriate amount of money) and make the remaining certificates available.


38
39
40
41
42
# File 'lib/baron/action/start_company.rb', line 38

def setup
  set_par_price
  make_certificates_available
  create_transaction
end