
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. | |
|
||||||||||||||||
|
Definition at line 18 of file MouseControl.cpp. 00020 {
00021 m_controls = controls;
00022 m_view = view;
00023 m_finder = finder;
00024 }
|
|
|
Left button finds shortest path. Right button moves to the cursor.
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 }
|
1.4.2