Colobot
autoderrick.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 // autoderrick.h
21 
22 #pragma once
23 
24 
25 #include "object/auto/auto.h"
26 
27 
28 
29 enum AutoDerrickPhase
30 {
31  ADP_WAIT = 1,
32  ADP_EXCAVATE = 2, // down the drill
33  ADP_ASCEND = 3, // up the drill
34  ADP_EXPORT = 4, // exports matter
35  ADP_ISFREE = 5, // expected material loss
36 };
37 
38 
39 
40 class CAutoDerrick : public CAuto
41 {
42 public:
43  CAutoDerrick(CObject* object);
44  ~CAutoDerrick();
45 
46  void DeleteObject(bool bAll=false);
47 
48  void Init();
49  bool EventProcess(const Event &event);
50  Error GetError();
51 
52  bool CreateInterface(bool bSelect);
53 
54  bool Write(CLevelParserLine* line);
55  bool Read(CLevelParserLine* line);
56 
57 protected:
58  CObject* SearchFret();
59  bool SearchFree(Math::Vector pos);
60  void CreateFret(Math::Vector pos, float angle, ObjectType type, float height);
61  bool ExistKey();
62 
63 protected:
64  AutoDerrickPhase m_phase;
65  float m_progress;
66  float m_speed;
67  float m_timeVirus;
68  float m_lastParticle;
69  float m_lastTrack;
70  Math::Vector m_fretPos;
71  int m_soundChannel;
72  bool m_bSoundFall;
73 };
74 
Definition: autoderrick.h:40
Definition: auto.h:52
Definition: parserline.h:33
ObjectType
Type of game object.
Definition: object.h:51
Error
Type of error or info message.
Definition: global.h:32
3D (3x1) vector
Definition: vector.h:52
Event sent by system, interface or game.
Definition: event.h:678
Definition: object.h:357