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