Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
auto.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 // auto.h
21 
22 #pragma once
23 
24 
25 #include "common/global.h"
26 #include "object/object.h"
27 
28 
29 class CRobotMain;
30 class CSoundInterface;
31 class CLevelParserLine;
32 
33 namespace Ui {
34 class CInterface;
35 class CWindow;
36 } /* Ui */
37 
38 namespace Gfx {
39 
40 class CEngine;
41 class CParticle;
42 class CLightManager;
43 class CTarrain;
44 class CWater;
45 class CCloud;
46 class CCamera;
47 class CPlanet;
48 class CLightning;
49 } /* Gfx */
50 
51 
52 class CAuto
53 {
54 public:
55  CAuto(CObject* object);
56  virtual ~CAuto();
57 
58  virtual void DeleteObject(bool bAll=false);
59 
60  virtual void Init();
61  virtual void Start(int param);
62  virtual bool EventProcess(const Event &event);
63  virtual Error IsEnded();
64  virtual bool Abort();
65 
66  virtual Error StartAction(int param);
67 
68  virtual bool SetType(ObjectType type);
69  virtual bool SetValue(int rank, float value);
70  virtual bool SetString(char *string);
71 
72  virtual bool CreateInterface(bool bSelect);
73  virtual Error GetError();
74 
75  virtual bool GetBusy();
76  virtual void SetBusy(bool bBuse);
77  virtual void InitProgressTotal(float total);
78  virtual void EventProgress(float rTime);
79 
80  virtual bool GetMotor();
81  virtual void SetMotor(bool bMotor);
82 
83  virtual bool Write(CLevelParserLine* line);
84  virtual bool Read(CLevelParserLine* line);
85 
86 protected:
87  void CheckInterface(Ui::CWindow *pw, EventType event, bool bState);
88  void EnableInterface(Ui::CWindow *pw, EventType event, bool bState);
89  void VisibleInterface(Ui::CWindow *pw, EventType event, bool bState);
90  void DeadInterface(Ui::CWindow *pw, EventType event, bool bState);
91  void UpdateInterface();
92  void UpdateInterface(float rTime);
93 
94 protected:
95  CEventQueue* m_eventQueue;
96  Gfx::CEngine* m_engine;
97  Gfx::CParticle* m_particle;
98  Gfx::CTerrain* m_terrain;
99  Gfx::CWater* m_water;
100  Gfx::CCloud* m_cloud;
101  Gfx::CPlanet* m_planet;
102  Gfx::CLightning* m_lightning;
103  Gfx::CCamera* m_camera;
104  Ui::CInterface* m_interface;
105  CRobotMain* m_main;
106  CObject* m_object;
107  CSoundInterface* m_sound;
108 
109  ObjectType m_type;
110  bool m_bBusy;
111  bool m_bMotor;
112  float m_time;
113  float m_lastUpdateTime;
114  float m_progressTime;
115  float m_progressTotal;
116 };
117 
Definition: controller.h:32
Some common, global definitions.
Definition: auto.h:52
Global event queue.
Definition: event.h:751
Definition: parserline.h:33
Definition: robotmain.h:172
Cloud layer renderer.
Definition: cloud.h:78
Lightning effect renderer.
Definition: lightning.h:54
Particle engine.
Definition: particle.h:268
Planet manager.
Definition: planet.h:82
ObjectType
Type of game object.
Definition: object.h:51
Camera moving in 3D scene.
Definition: camera.h:133
Terrain loader/generator and manager.
Definition: terrain.h:222
Namespace for (new) graphics code.
Definition: app.h:49
CObject - base class for all game objects.
The graphics engine.
Definition: engine.h:684
Error
Type of error or info message.
Definition: global.h:32
Water manager/renderer.
Definition: water.h:118
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: interface.h:58
Definition: object.h:357
Sound plugin interface.
Definition: sound.h:151