Class: GameEngine::Card

Inherits:
Object
  • Object
show all
Defined in:
lib/smack_engine/card.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(card_data) ⇒ Card

Returns a new instance of Card.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/smack_engine/card.rb', line 5

def initialize(card_data)
  @id = card_data.id
  @type = card_data.card_type
  @name = card_data.name
  @description = card_data.description
  @strength = card_data.strength
  @intelligence = card_data.intelligence
  @charisma = card_data.charisma
  @time_period = card_data.time_period
  @picture_url = card_data.picture_url
end

Instance Attribute Details

#card_typeObject (readonly)

Returns the value of attribute card_type.



3
4
5
# File 'lib/smack_engine/card.rb', line 3

def card_type
  @card_type
end

#charismaObject (readonly)

Returns the value of attribute charisma.



3
4
5
# File 'lib/smack_engine/card.rb', line 3

def charisma
  @charisma
end

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'lib/smack_engine/card.rb', line 3

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/smack_engine/card.rb', line 3

def id
  @id
end

#intelligenceObject (readonly)

Returns the value of attribute intelligence.



3
4
5
# File 'lib/smack_engine/card.rb', line 3

def intelligence
  @intelligence
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/smack_engine/card.rb', line 3

def name
  @name
end

#strengthObject (readonly)

Returns the value of attribute strength.



3
4
5
# File 'lib/smack_engine/card.rb', line 3

def strength
  @strength
end

#time_periodObject (readonly)

Returns the value of attribute time_period.



3
4
5
# File 'lib/smack_engine/card.rb', line 3

def time_period
  @time_period
end

Instance Method Details

#max_statObject



17
18
19
# File 'lib/smack_engine/card.rb', line 17

def max_stat
  [strength,intelligence,charisma].max
end