Class: Baron::Action::PlaceTile

Inherits:
CompanyAction show all
Defined in:
lib/baron/action/place_tile.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 tile, hex, and orentation objects

Instance Attribute Summary collapse

Attributes inherited from Baron::Action

#player

Instance Method Summary collapse

Methods inherited from Baron::Action

#process, #symbol

Constructor Details

#initialize(turn, tile, hex, orientation) ⇒ PlaceTile

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

  • tile (String)

    Tile number

  • hex (String)

    Hex location

  • orientation (String)

    The orientation number


59
60
61
62
63
64
# File 'lib/baron/action/place_tile.rb', line 59

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

Instance Attribute Details

#hexString (readonly)

The hex the tile is being placed

Examples:

action.hex

Returns:

  • (String)

38
39
40
# File 'lib/baron/action/place_tile.rb', line 38

def hex
  @hex
end

#orientationString (readonly)

The orientation that the tile is being placed in

Examples:

action.orientation

Returns:

  • (String)

47
48
49
# File 'lib/baron/action/place_tile.rb', line 47

def orientation
  @orientation
end

#tileString (readonly)

The tile being placed

Examples:

action.tile

Returns:

  • (String)

29
30
31
# File 'lib/baron/action/place_tile.rb', line 29

def tile
  @tile
end

#turnBaron::Turn (readonly)

The turn that this action is a part of

Examples:

action.turn

Returns:


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

def turn
  @turn
end