Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
auto.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 // auto.h
18 
19 #pragma once
20 
21 
22 #include "common/global.h"
23 #include "object/object.h"
24 
25 
26 class CInstanceManager;
27 class CRobotMain;
28 class CSoundInterface;
29 
30 namespace Ui {
31 class CInterface;
32 class CWindow;
33 } /* Ui */
34 
35 namespace Gfx {
36 
37 class CEngine;
38 class CParticle;
39 class CLightManager;
40 class CTarrain;
41 class CWater;
42 class CCloud;
43 class CCamera;
44 class CPlanet;
45 class CLightning;
46 } /* Gfx */
47 
48 
49 class CAuto
50 {
51 public:
52  CAuto(CObject* object);
53  virtual ~CAuto();
54 
55  virtual void DeleteObject(bool bAll=false);
56 
57  virtual void Init();
58  virtual void Start(int param);
59  virtual bool EventProcess(const Event &event);
60  virtual Error IsEnded();
61  virtual bool Abort();
62 
63  virtual Error StartAction(int param);
64 
65  virtual bool SetType(ObjectType type);
66  virtual bool SetValue(int rank, float value);
67  virtual bool SetString(char *string);
68 
69  virtual bool CreateInterface(bool bSelect);
70  virtual Error GetError();
71 
72  virtual bool GetBusy();
73  virtual void SetBusy(bool bBuse);
74  virtual void InitProgressTotal(float total);
75  virtual void EventProgress(float rTime);
76 
77  virtual bool GetMotor();
78  virtual void SetMotor(bool bMotor);
79 
80  virtual bool Write(char *line);
81  virtual bool Read(char *line);
82 
83 protected:
84  void CheckInterface(Ui::CWindow *pw, EventType event, bool bState);
85  void EnableInterface(Ui::CWindow *pw, EventType event, bool bState);
86  void VisibleInterface(Ui::CWindow *pw, EventType event, bool bState);
87  void DeadInterface(Ui::CWindow *pw, EventType event, bool bState);
88  void UpdateInterface();
89  void UpdateInterface(float rTime);
90 
91 protected:
92  CInstanceManager* m_iMan; // TODO: to be removed
93  CEventQueue* m_eventQueue;
94  Gfx::CEngine* m_engine;
95  Gfx::CParticle* m_particle;
96  Gfx::CTerrain* m_terrain;
97  Gfx::CWater* m_water;
98  Gfx::CCloud* m_cloud;
99  Gfx::CPlanet* m_planet;
100  Gfx::CLightning* m_lightning;
101  Gfx::CCamera* m_camera;
102  Ui::CInterface* m_interface;
103  CRobotMain* m_main;
104  CObject* m_object;
105  CSoundInterface* m_sound;
106 
107  ObjectType m_type;
108  bool m_bBusy;
109  bool m_bMotor;
110  float m_time;
111  float m_lastUpdateTime;
112  float m_progressTime;
113  float m_progressTotal;
114 };
115