Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
tasksearch.h
1 // * This file is part of the COLOBOT source code
2 // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
3 // *
4 // * This program is free software: you can redistribute it and/or modify
5 // * it under the terms of the GNU General Public License as published by
6 // * the Free Software Foundation, either version 3 of the License, or
7 // * (at your option) any later version.
8 // *
9 // * This program is distributed in the hope that it will be useful,
10 // * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // * GNU General Public License for more details.
13 // *
14 // * You should have received a copy of the GNU General Public License
15 // * along with this program. If not, see http://www.gnu.org/licenses/.
16 
17 // tasksearch.h
18 
19 #pragma once
20 
21 
22 #include "object/task/task.h"
23 #include "object/object.h"
24 
25 
26 
27 enum TaskSearchHand
28 {
29  TSH_UP = 1, // sensor at the top
30  TSH_DOWN = 2, // sensor at the bottom
31 };
32 
33 enum TaskSearchPhase
34 {
35  TSP_DOWN = 1, // descends
36  TSP_SEARCH = 2, // seeks
37  TSP_UP = 3, // rises
38 };
39 
40 
41 
42 class CTaskSearch : public CTask
43 {
44 public:
45  CTaskSearch(CObject* object);
46  ~CTaskSearch();
47 
48  bool EventProcess(const Event &event);
49 
50  Error Start();
51  Error IsEnded();
52  bool Abort();
53 
54 protected:
55  void InitAngle();
56  bool CreateMark();
57  void DeleteMark(ObjectType type);
58 
59 protected:
60  TaskSearchHand m_hand;
61  TaskSearchPhase m_phase;
62  float m_progress;
63  float m_speed;
64  float m_time;
65  float m_lastParticle;
66  float m_initialAngle[3];
67  float m_finalAngle[3];
68  bool m_bError;
69 };
70 
Definition: tasksearch.h:42
ObjectType
Type of game object.
Definition: object.h:46
CObject - base class for all game objects.
Definition: task.h:61
Error
Type of error or info message.
Definition: global.h:29
Event sent by system, interface or game.
Definition: event.h:687
Definition: object.h:372