Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
taskrecover.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 // taskrecover.h
18 
19 #pragma once
20 
21 
22 #include "object/task/task.h"
23 
24 #include "math/vector.h"
25 
26 
27 
28 enum TaskRecoverPhase
29 {
30  TRP_TURN = 1, // turns
31  TRP_MOVE = 2, // advance
32  TRP_DOWN = 3, // descends
33  TRP_OPER = 4, // operates
34  TRP_UP = 5, // back
35 };
36 
37 
38 
39 class CTaskRecover : public CTask
40 {
41 public:
42  CTaskRecover(CObject* object);
43  ~CTaskRecover();
44 
45  bool EventProcess(const Event &event);
46 
47  Error Start();
48  Error IsEnded();
49  bool Abort();
50 
51 protected:
52  CObject* SearchRuin();
53 
54 protected:
55  TaskRecoverPhase m_phase;
56  float m_progress;
57  float m_speed;
58  float m_time;
59  float m_angle;
60  float m_lastParticle;
61  bool m_bError;
62  CObject* m_ruin;
63  CObject* m_metal;
64  Math::Vector m_recoverPos;
65  int m_soundChannel;
66 };
67 
Definition: taskrecover.h:39
Vector struct and related functions.
Definition: task.h:61
Error
Type of error or info message.
Definition: global.h:29
3D (3x1) vector
Definition: vector.h:49
Event sent by system, interface or game.
Definition: event.h:687
Definition: object.h:372