Class: Card

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

Direct Known Subclasses

BasicLandCard, PathwayCard, SlowLandCard, TapLandCard

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(card_type) ⇒ Card

Returns a new instance of Card.



4
5
6
7
# File 'lib/manasimu/card.rb', line 4

def initialize(card_type)
  @card_type = card_type
  @playable = false
end

Instance Attribute Details

#card_typeObject

Returns the value of attribute card_type.



2
3
4
# File 'lib/manasimu/card.rb', line 2

def card_type
  @card_type
end

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/manasimu/card.rb', line 2

def id
  @id
end

#sideObject

Returns the value of attribute side.



2
3
4
# File 'lib/manasimu/card.rb', line 2

def side
  @side
end

Instance Method Details

#can_play?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/manasimu/card.rb', line 63

def can_play?
  @can_play
end

#color_identityObject



75
76
77
# File 'lib/manasimu/card.rb', line 75

def color_identity
  @card_type.color_identity
end

#color_identity_sizeObject



83
84
85
# File 'lib/manasimu/card.rb', line 83

def color_identity_size
  @card_type.color_identity_size
end

#configureObject



9
10
# File 'lib/manasimu/card.rb', line 9

def configure
end

#converted_mana_costObject



79
80
81
# File 'lib/manasimu/card.rb', line 79

def converted_mana_cost
  @card_type.converted_mana_cost
end

#drawed(turn) ⇒ Object



21
22
23
24
# File 'lib/manasimu/card.rb', line 21

def drawed(turn)
  @drawed = turn
  @card_type.drawed(turn)
end

#edges(lands, capas) ⇒ Object



110
111
112
# File 'lib/manasimu/card.rb', line 110

def edges(lands, capas)
  @card_type.edges(lands, capas)
end

#first_produce_symbol=(symbol) ⇒ Object



118
119
# File 'lib/manasimu/card.rb', line 118

def first_produce_symbol=(symbol)
end

#is_land?Boolean

Returns:

  • (Boolean)


102
103
104
# File 'lib/manasimu/card.rb', line 102

def is_land?
  @card_type.is_land? @side
end

#mana_costObject



87
88
89
# File 'lib/manasimu/card.rb', line 87

def mana_cost
  @card_type.mana_cost
end

#mana_produced?Boolean

Returns:

  • (Boolean)


114
115
116
# File 'lib/manasimu/card.rb', line 114

def mana_produced?
  @side
end

#mana_sourceObject



45
46
47
# File 'lib/manasimu/card.rb', line 45

def mana_source
  @card_type.mana_source
end

#mana_source?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/manasimu/card.rb', line 53

def mana_source?
  @card_type.mana_source?
end

#mana_source_sizeObject



49
50
51
# File 'lib/manasimu/card.rb', line 49

def mana_source_size
  @card_type.mana_source_size
end

#max_flow(lands, capas) ⇒ Object



106
107
108
# File 'lib/manasimu/card.rb', line 106

def max_flow(lands, capas)
  @card_type.max_flow(lands, capas)
end

#playable?(lands, capas) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
60
61
# File 'lib/manasimu/card.rb', line 57

def playable?(lands, capas)
  ret = @card_type.playable?(lands, capas)
  @can_play = true if ret and ret[0]
  ret
end

#played(turn, side = "a") ⇒ Object



26
27
28
29
30
31
32
# File 'lib/manasimu/card.rb', line 26

def played(turn, side = "a")
  @played = turn
  @side = side
  if not is_land? or not tapped?
    @card_type.played(turn)
  end
end

#played?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/manasimu/card.rb', line 37

def played?
  @played.nil?
end

#priceObject



91
92
93
# File 'lib/manasimu/card.rb', line 91

def price
  @card_type.price
end

#resetObject



95
96
97
98
99
100
# File 'lib/manasimu/card.rb', line 95

def reset
  @side = nil
  @played = nil
  @drawed = nil
  @can_play = false
end

#resolve(side = "a", hands, plays, deck) ⇒ Object



34
35
# File 'lib/manasimu/card.rb', line 34

def resolve(side = "a", hands, plays, deck)
end

#set_codeObject



121
122
123
# File 'lib/manasimu/card.rb', line 121

def set_code
  @card_type.set_code
end

#step_in_hands(turn) ⇒ Object



12
13
14
15
# File 'lib/manasimu/card.rb', line 12

def step_in_hands(turn)
  @card_type.step_in_hands(turn, self)
  @can_play = false
end

#step_in_plays(turn) ⇒ Object



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

def step_in_plays(turn)
  @card_type.step_in_plays(turn, self)
end

#tapped?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/manasimu/card.rb', line 41

def tapped?
  false
end

#to_sObject



125
126
127
# File 'lib/manasimu/card.rb', line 125

def to_s
  @card_type.to_s
end

#typeObject



71
72
73
# File 'lib/manasimu/card.rb', line 71

def type
  @card_type.type
end

#typesObject



67
68
69
# File 'lib/manasimu/card.rb', line 67

def types
  @card_type.types
end