Class: PoorPokemon::PokedexPokemon
- Inherits:
-
Object
- Object
- PoorPokemon::PokedexPokemon
- Defined in:
- lib/poor-pokemon/pokedexPokemon.rb
Instance Attribute Summary collapse
-
#att ⇒ Object
Returns the value of attribute att.
-
#def ⇒ Object
Returns the value of attribute def.
-
#hp ⇒ Object
Returns the value of attribute hp.
-
#name ⇒ Object
Returns the value of attribute name.
-
#num ⇒ Object
Returns the value of attribute num.
-
#spAtt ⇒ Object
Returns the value of attribute spAtt.
-
#spd ⇒ Object
Returns the value of attribute spd.
-
#spDef ⇒ Object
Returns the value of attribute spDef.
-
#totalStats ⇒ Object
Returns the value of attribute totalStats.
-
#type1 ⇒ Object
Returns the value of attribute type1.
-
#type2 ⇒ Object
Returns the value of attribute type2.
Instance Method Summary collapse
- #clone(flag = false) ⇒ Object
-
#initialize(arr) ⇒ PokedexPokemon
constructor
A new instance of PokedexPokemon.
Constructor Details
#initialize(arr) ⇒ PokedexPokemon
4 5 6 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 4 def initialize(arr) @name, @num, @type1, @type2, @hp, @att, @def, @spAtt, @spDef, @spd, @totalStats = arr end |
Instance Attribute Details
#att ⇒ Object
Returns the value of attribute att.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def att @att end |
#def ⇒ Object
Returns the value of attribute def.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def def @def end |
#hp ⇒ Object
Returns the value of attribute hp.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def hp @hp end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def name @name end |
#num ⇒ Object
Returns the value of attribute num.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def num @num end |
#spAtt ⇒ Object
Returns the value of attribute spAtt.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def spAtt @spAtt end |
#spd ⇒ Object
Returns the value of attribute spd.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def spd @spd end |
#spDef ⇒ Object
Returns the value of attribute spDef.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def spDef @spDef end |
#totalStats ⇒ Object
Returns the value of attribute totalStats.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def totalStats @totalStats end |
#type1 ⇒ Object
Returns the value of attribute type1.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def type1 @type1 end |
#type2 ⇒ Object
Returns the value of attribute type2.
2 3 4 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2 def type2 @type2 end |
Instance Method Details
#clone(flag = false) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 8 def clone (flag=false) # creates a copy of this pokedexPokemon object as a pokemon object # moves is an array of moves #flag is for enemy to have perfect stats return PoorPokemon::Pokemon.new([@name, @type1, @type2, @hp.to_i, @att.to_i, @def.to_i, @spAtt.to_i, @spDef.to_i, @spd.to_i], flag) end |