Class: Player

Inherits:
Object
  • Object
show all
Includes:
Emoji
Defined in:
lib/ttt-cli/player.rb

Overview

Класс Player (abstract class)

Direct Known Subclasses

Players::Computer, Players::Human

Constant Summary

Constants included from Emoji

Emoji::DASH, Emoji::O, Emoji::X

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Player

Returns a new instance of Player.



9
10
11
12
# File 'lib/ttt-cli/player.rb', line 9

def initialize(params)
  @name = params[:name]
  @token = params[:token]
end

Instance Attribute Details

#boardObject

Returns the value of attribute board.



5
6
7
# File 'lib/ttt-cli/player.rb', line 5

def board
  @board
end

#enemyObject

Returns the value of attribute enemy.



5
6
7
# File 'lib/ttt-cli/player.rb', line 5

def enemy
  @enemy
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/ttt-cli/player.rb', line 5

def name
  @name
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/ttt-cli/player.rb', line 5

def token
  @token
end

Instance Method Details

#make_move(board) ⇒ Object



14
# File 'lib/ttt-cli/player.rb', line 14

def make_move(board); end

#positionObject



16
# File 'lib/ttt-cli/player.rb', line 16

def position; end