Class: Baron::Action::PlaceToken

Inherits:
CompanyAction show all
Defined in:
lib/baron/action/place_token.rb

Overview

This action is where a company places a tile on the board

The tile is places in a hex with a specific orientation. This placement can be either a standard placement of a yellow tile, or an upgrade of an existing tile to another tile.

TODO: Implement map interaction TODO: Make hex, an objects

Instance Attribute Summary collapse

Attributes inherited from CompanyAction

#turn

Attributes inherited from Baron::Action

#player

Instance Method Summary collapse

Methods inherited from Baron::Action

#process, #symbol

Constructor Details

#initialize(turn, hex) ⇒ PlaceToken

Create the place tile action

Examples:

Baron::Action::PlaceTile(action, tile, hex, orientation)

Parameters:

  • turn (Baron::Turn)

    The turn this action is a part of

  • hex (String)

    Hex location


30
31
32
33
# File 'lib/baron/action/place_token.rb', line 30

def initialize(turn, hex)
  super(turn)
  @hex = hex
end

Instance Attribute Details

#hexString (readonly)

The hex the tile is being placed

Examples:

action.hex

Returns:

  • (String)

20
21
22
# File 'lib/baron/action/place_token.rb', line 20

def hex
  @hex
end