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

Parameters:



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

def initialize(unit_group)
  @parent = unit_group
  super
end

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



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

def parent
  @parent
end

Instance Method Details

#rejectObject

Does the opposite of selector and returns those values for parent



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

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

#selectObject

Does the opposite of selector and returns those values for parent



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

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