Package horizons :: Package gui :: Package mousetools :: Module attackingtool :: Class AttackingTool
[hide private]
[frames] | no frames]

Class AttackingTool

source code

fife.fife.IMouseListener --+            
                           |            
       cursortool.CursorTool --+        
                               |        
   navigationtool.NavigationTool --+    
                                   |    
         selectiontool.SelectionTool --+
                                       |
                                      AttackingTool

This will be used when attacking units are selected it will have to respond on right click and change cursor image when hovering enemy units

Instance Methods [hide private]
 
__init__(self, session) source code
 
mousePressed(self, evt) source code
 
mouseMoved(self, evt) source code
 
_get_attackable_instance(self, evt)
Returns target instance if mouse is over an attackable instance Returns None if mouse is not over an attackable instance
source code
    Inherited from selectiontool.SelectionTool
 
_draw_rect_line(self, start, end) source code
 
_update_selection(self, instances, do_multi=False)
self.select_old are old instances still relevant now (esp.
source code
 
apply_select(self)
Called when selected instances changes.
source code
 
fife_instance_to_uh_instance(self, instance)
Visual fife instance to uh game logic object or None
source code
 
filter_component(self, component, instances)
Only get specific component from a list of world objects
source code
 
filter_owner(self, instances)
Only keep instances belonging to the user.
source code
 
filter_selectable(self, instances)
Only keeps selectables from a list of world objects
source code
 
is_owned_by_player(self, instance)
Returns boolean if single world object is owned by local player
source code
 
is_selectable(self, entity) source code
 
mouseDragged(self, evt) source code
 
mouseReleased(self, evt) source code
 
remove(self) source code
    Inherited from navigationtool.NavigationTool
 
_schedule_hover_instance_update(self)
Hover instances have potentially changed, do an update in a timely fashion (but not right away)
source code
 
_send_hover_instance_upate(self)
Broadcast update with new instances below mouse (hovered).
source code
 
end(self) source code
 
get_hover_instances(self, where, layers=None)
Utility method, returns the instances under the cursor
source code
 
mouseWheelMovedDown(self, evt) source code
 
mouseWheelMovedUp(self, evt) source code
 
onCommand(self, command)
Called when some kind of command-event happens.
source code
    Inherited from cursortool.CursorTool
 
_get_screenpoint(self, arg)
Python lacks polymorphism.
source code
 
_round_map_coords(self, map_x, map_y)
Returns the coordinates of an event at the map.
source code
 
disable(self)
Call this to not get events.
source code
 
enable(self)
Call this to get events.
source code
 
get_exact_world_location(self, evt)
Returns the coordinates of an event at the map.
source code
 
get_world_location(self, evt) source code
 
mouseClicked(self, evt) source code
 
mouseEntered(self, evt) source code
 
mouseExited(self, evt) source code
Class Variables [hide private]
  send_hover_instances_update = False
    Inherited from selectiontool.SelectionTool
  _SELECTION_RECTANGLE_NAME = "_select"
    Inherited from navigationtool.NavigationTool
  HOVER_INSTANCES_UPDATE_DELAY = 1
  last_event_pos = fife.ScreenPoint(0, 0)
  last_hover_instances = WeakList()
    Inherited from cursortool.CursorTool
  log = logging.getLogger("gui.mousetools")
Method Details [hide private]

__init__(self, session)
(Constructor)

source code 
Overrides: cursortool.CursorTool.__init__

mousePressed(self, evt)

source code 
Overrides: cursortool.CursorTool.mousePressed

mouseMoved(self, evt)

source code 
Overrides: cursortool.CursorTool.mouseMoved