Sha256: 07c191d86db2a1f298d26ece05d4dd8c665419e457a42fcecd3d1b2b9dd3bb02

Contents?: true

Size: 438 Bytes

Versions: 1

Compression:

Stored size: 438 Bytes

Contents

module CribbageGame
  class Player
    attr_accessor :id, :name, :hand, :total_score

    def initialize game, id
      @id = id
      @game = game
      @hand = {}
      @total_score = 0
    end

    def discard cards
      [cards].flatten.each do |card|
        @game.discard self, card
      end
    end

    def play_card card
      @game.play_card self, card
    end

    def score_hand
      @game.score_hand self
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cribbage_game-0.1.0 lib/cribbage_game/player.rb