Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

MouseControl Class Reference

Collaboration diagram for MouseControl:

Collaboration graph
[legend]

Detailed Description

Mouse controls move.

Definition at line 13 of file MouseControl.h.

Public Member Functions

 MouseControl (Controls *controls, const View *m_view, FinderAlg *finder)
bool mouseDrive (const InputProvider *input) const
 Left button finds shortest path.


Constructor & Destructor Documentation

MouseControl::MouseControl Controls controls,
const View m_view,
FinderAlg finder
 

Definition at line 18 of file MouseControl.cpp.

00020 {
00021     m_controls = controls;
00022     m_view = view;
00023     m_finder = finder;
00024 }


Member Function Documentation

bool MouseControl::mouseDrive const InputProvider input  )  const
 

Left button finds shortest path.

Right button moves to the cursor.

Returns:
whether a move was made

Definition at line 32 of file MouseControl.cpp.

00033 {
00034     bool moved = false;
00035     V2 field = m_view->getFieldPos(input->getMouseLoc());
00036     if (input->isLeftPressed()) {
00037         moved = moveTo(field);
00038     }
00039     else if (input->isRightPressed()) {
00040         moved = moveHardTo(field);
00041     }
00042     return moved;
00043 }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:55:57 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2