Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
autofactory.h
1 // * This file is part of the COLOBOT source code
2 // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
3 // * Copyright (C) 2012 Polish Portal of Colobot (PPC)
4 // *
5 // * This program is free software: you can redistribute it and/or modify
6 // * it under the terms of the GNU General Public License as published by
7 // * the Free Software Foundation, either version 3 of the License, or
8 // * (at your option) any later version.
9 // *
10 // * This program is distributed in the hope that it will be useful,
11 // * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // * GNU General Public License for more details.
14 // *
15 // * You should have received a copy of the GNU General Public License
16 // * along with this program. If not, see http://www.gnu.org/licenses/.
17 
18 // autofactory.h
19 
20 #pragma once
21 
22 
23 #include "object/auto/auto.h"
24 
25 
26 
27 enum AutoFactoryPhase
28 {
29  AFP_WAIT = 1, // expected metal
30  AFP_CLOSE_S = 2, // closes doors (shift)
31  AFP_CLOSE_T = 3, // closes doors (turn)
32  AFP_BUILD = 4, // building the vehicle
33  AFP_OPEN_T = 5, // opens the doors (turn)
34  AFP_OPEN_S = 6, // opens the doors (shift)
35  AFP_ADVANCE = 7, // advance at the door
36 };
37 
38 
39 
40 class CAutoFactory : public CAuto
41 {
42 public:
43  CAutoFactory(CObject* object);
44  ~CAutoFactory();
45 
46  void DeleteObject(bool bAll=false);
47 
48  void Init();
49  bool EventProcess(const Event &event);
50 
51  Error StartAction(int param);
52  void SetProgram(const char* program);
53 
54  bool CreateInterface(bool bSelect);
55 
56  bool Write(char *line);
57  bool Read(char *line);
58 
59 protected:
60  void UpdateInterface();
61  void UpdateButton(Ui::CWindow *pw, EventType event, bool bBusy);
62 
63  CObject* SearchFret();
64  bool NearestVehicle();
65  bool CreateVehicle();
66  CObject* SearchVehicle();
67 
68  void SoundManip(float time, float amplitude, float frequency);
69 
70 protected:
71  AutoFactoryPhase m_phase;
72  float m_progress;
73  float m_speed;
74  float m_lastParticle;
75  Math::Vector m_fretPos;
76  int m_channelSound;
77 
78  CObject* m_vehicle;
79  char* m_program;
80 };
81 
Definition: auto.h:49
Definition: autofactory.h:40
Error
Type of error or info message.
Definition: global.h:29
3D (3x1) vector
Definition: vector.h:49
EventType
Type of event message.
Definition: event.h:35
Event sent by system, interface or game.
Definition: event.h:687
Definition: window.h:54
Definition: object.h:372