Class: Card
- Inherits:
-
Object
show all
- Defined in:
- lib/manasimu/card.rb
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_type ⇒ Object
Returns the value of attribute card_type.
2
3
4
|
# File 'lib/manasimu/card.rb', line 2
def card_type
@card_type
end
|
#id ⇒ Object
Returns the value of attribute id.
2
3
4
|
# File 'lib/manasimu/card.rb', line 2
def id
@id
end
|
#side ⇒ Object
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
63
64
65
|
# File 'lib/manasimu/card.rb', line 63
def can_play?
@can_play
end
|
#color_identity ⇒ Object
75
76
77
|
# File 'lib/manasimu/card.rb', line 75
def color_identity
@card_type.color_identity
end
|
#color_identity_size ⇒ Object
83
84
85
|
# File 'lib/manasimu/card.rb', line 83
def color_identity_size
@card_type.color_identity_size
end
|
9
10
|
# File 'lib/manasimu/card.rb', line 9
def configure
end
|
#converted_mana_cost ⇒ Object
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
102
103
104
|
# File 'lib/manasimu/card.rb', line 102
def is_land?
@card_type.is_land? @side
end
|
#mana_cost ⇒ Object
87
88
89
|
# File 'lib/manasimu/card.rb', line 87
def mana_cost
@card_type.mana_cost
end
|
#mana_produced? ⇒ Boolean
114
115
116
|
# File 'lib/manasimu/card.rb', line 114
def mana_produced?
@side
end
|
#mana_source ⇒ Object
45
46
47
|
# File 'lib/manasimu/card.rb', line 45
def mana_source
@card_type.mana_source
end
|
#mana_source? ⇒ Boolean
53
54
55
|
# File 'lib/manasimu/card.rb', line 53
def mana_source?
@card_type.mana_source?
end
|
#mana_source_size ⇒ Object
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
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
37
38
39
|
# File 'lib/manasimu/card.rb', line 37
def played?
@played.nil?
end
|
#price ⇒ Object
91
92
93
|
# File 'lib/manasimu/card.rb', line 91
def price
@card_type.price
end
|
#reset ⇒ Object
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_code ⇒ Object
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
41
42
43
|
# File 'lib/manasimu/card.rb', line 41
def tapped?
false
end
|
#to_s ⇒ Object
125
126
127
|
# File 'lib/manasimu/card.rb', line 125
def to_s
@card_type.to_s
end
|
#type ⇒ Object
71
72
73
|
# File 'lib/manasimu/card.rb', line 71
def type
@card_type.type
end
|
#types ⇒ Object
67
68
69
|
# File 'lib/manasimu/card.rb', line 67
def types
@card_type.types
end
|