Class: Mgmg::ELItem

Inherits:
Object
  • Object
show all
Defined in:
lib/mgmg/search.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(recipe = nil, sc = nil) ⇒ ELItem

Returns a new instance of ELItem.



691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
# File 'lib/mgmg/search.rb', line 691

def initialize(recipe=nil, sc=nil)
	if recipe.nil?
		@para = -Float::INFINITY
		@exp = Float::INFINITY
	else
		@recipe = recipe
		if sc.size == 3
			@smith, @armor, @comp = *sc
		else
			if recipe.option.irep.kind < 8
				@smith, @comp = *sc
				@armor = -1
			else
				@armor, @comp = *sc
				@smith = -1
			end
		end
		@para = recipe.para_call(*sc)
		@exp = Mgmg.exp(*sc)
		@name = recipe.name
	end
end

Instance Attribute Details

#armorObject (readonly)

Returns the value of attribute armor.



713
714
715
# File 'lib/mgmg/search.rb', line 713

def armor
  @armor
end

#compObject (readonly)

Returns the value of attribute comp.



713
714
715
# File 'lib/mgmg/search.rb', line 713

def comp
  @comp
end

#expObject (readonly)

Returns the value of attribute exp.



713
714
715
# File 'lib/mgmg/search.rb', line 713

def exp
  @exp
end

#nameObject (readonly)

Returns the value of attribute name.



713
714
715
# File 'lib/mgmg/search.rb', line 713

def name
  @name
end

#paraObject (readonly)

Returns the value of attribute para.



713
714
715
# File 'lib/mgmg/search.rb', line 713

def para
  @para
end

#recipeObject (readonly)

Returns the value of attribute recipe.



713
714
715
# File 'lib/mgmg/search.rb', line 713

def recipe
  @recipe
end

#smithObject (readonly)

Returns the value of attribute smith.



713
714
715
# File 'lib/mgmg/search.rb', line 713

def smith
  @smith
end

Instance Method Details

#weightObject



719
720
721
# File 'lib/mgmg/search.rb', line 719

def weight
	@recipe.build(@smith, @armor, @comp).weight
end