Class: Sc2::UnitGroup::UnitGroupNotSelector

Inherits:
Sc2::UnitGroup show all
Defined in:
lib/sc2ai/unit_group/filter_ext.rb

Overview

Negative selector allowing unit group “ug.not.” filter

Constant Summary

Constants inherited from Sc2::UnitGroup

TYPE_BASES, TYPE_GAS_STRUCTURE, TYPE_GEYSER, TYPE_MINERAL, TYPE_REACTOR, TYPE_REJECT_DEBRIS, TYPE_TECHLAB, TYPE_WORKER

Instance Attribute Summary collapse

Attributes inherited from Sc2::UnitGroup

#units, #use_kdtree

Instance Method Summary collapse

Methods inherited from Sc2::UnitGroup

#:@units, #[]=, #ability_available?, #action, #add, #army, #at, #attack, #bases, #bot, #build, #clear, #completed, #contains?, #creep_tumors, #creep_tumors_burrowed, #debris, #delete_if, #detect, #each, #each_with_tag, #eggs, #empty?, #eql?, #except, #filter!, #first, #gas, #geysers, #hold, #idle, #incomplete, #intersection, #is_performing_ability?, #kdtree, #keep_if, #keys, #larva, #last, #length, #merge, #merge!, #minerals, #move, #nearest_to, #non_army_unit_type_ids, #not, #overlords, #overseers, #owned, #pos_centroid, #pylons, #queens, #reject!, #reject_attribute, #reject_type, #remove, #repair, #replace, #research, #sample, #select!, #select_attribute, #select_in_circle, #select_type, #shift, #size, #slice, #smart, #stop, #structures, #subtract, #tags, #to_a, #to_h, #to_hash, #to_proc, #values, #values_at, #warp, #warpables, #warpgates, #watchtowers, #workers

Constructor Details

#initialize(unit_group) ⇒ UnitGroupNotSelector

Returns a new instance of UnitGroupNotSelector.



131
132
133
134
# File 'lib/sc2ai/unit_group/filter_ext.rb', line 131

def initialize(unit_group)
  @parent = unit_group
  super
end

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



129
130
131
# File 'lib/sc2ai/unit_group/filter_ext.rb', line 129

def parent
  @parent
end

Instance Method Details

#rejectObject

Does the opposite of selector and returns those values for parent



144
145
146
# File 'lib/sc2ai/unit_group/filter_ext.rb', line 144

def reject(...)
  @parent.select(...)
end

#selectObject

Does the opposite of selector and returns those values for parent



138
139
140
# File 'lib/sc2ai/unit_group/filter_ext.rb', line 138

def select(...)
  @parent.reject(...)
end