Colobot
autofactory.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 // autofactory.h
21 
22 #pragma once
23 
24 
25 #include "object/auto/auto.h"
26 
27 
28 
29 enum AutoFactoryPhase
30 {
31  AFP_WAIT = 1, // expected metal
32  AFP_CLOSE_S = 2, // closes doors (shift)
33  AFP_CLOSE_T = 3, // closes doors (turn)
34  AFP_BUILD = 4, // building the vehicle
35  AFP_OPEN_T = 5, // opens the doors (turn)
36  AFP_OPEN_S = 6, // opens the doors (shift)
37  AFP_ADVANCE = 7, // advance at the door
38 };
39 
40 
41 
42 class CAutoFactory : public CAuto
43 {
44 public:
45  CAutoFactory(CObject* object);
46  ~CAutoFactory();
47 
48  void DeleteObject(bool bAll=false);
49 
50  void Init();
51  bool EventProcess(const Event &event);
52 
53  Error StartAction(int param);
54  void SetProgram(const char* program);
55 
56  bool CreateInterface(bool bSelect);
57 
58  bool Write(CLevelParserLine* line);
59  bool Read(CLevelParserLine* line);
60 
61 protected:
62  void UpdateInterface();
63  void UpdateButton(Ui::CWindow *pw, EventType event, bool bBusy);
64 
65  CObject* SearchFret();
66  bool NearestVehicle();
67  bool CreateVehicle();
68  CObject* SearchVehicle();
69 
70  void SoundManip(float time, float amplitude, float frequency);
71 
72 protected:
73  AutoFactoryPhase m_phase;
74  float m_progress;
75  float m_speed;
76  float m_lastParticle;
77  Math::Vector m_fretPos;
78  int m_channelSound;
79 
80  CObject* m_vehicle;
81  char* m_program;
82 };
83 
Definition: auto.h:52
Definition: parserline.h:33
Definition: autofactory.h:42
Error
Type of error or info message.
Definition: global.h:32
3D (3x1) vector
Definition: vector.h:52
EventType
Type of event message.
Definition: event.h:38
Event sent by system, interface or game.
Definition: event.h:678
Definition: window.h:56
Definition: object.h:357