colobot/src/object/auto/auto.h

118 lines
3.4 KiB
C
Raw Normal View History

/*
* This file is part of the Colobot: Gold Edition source code
2018-04-19 23:20:10 +00:00
* Copyright (C) 2001-2018, Daniel Roux, EPSITEC SA & TerranovaTeam
2015-08-22 14:40:02 +00:00
* http://epsitec.ch; http://colobot.info; http://github.com/colobot
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://gnu.org/licenses
*/
#pragma once
2015-08-15 12:02:07 +00:00
#include "common/error.h"
#include "common/event.h"
2015-07-12 09:33:52 +00:00
#include "object/object_type.h"
class CRobotMain;
2012-09-09 12:28:19 +00:00
class CSoundInterface;
2014-11-10 13:16:32 +00:00
class CLevelParserLine;
2015-07-12 09:33:52 +00:00
class COldObject;
2012-09-09 12:28:19 +00:00
2015-08-02 09:40:47 +00:00
namespace Ui
{
2012-09-09 12:28:19 +00:00
class CInterface;
class CWindow;
} // namespace Ui
2015-08-02 09:40:47 +00:00
namespace Gfx
{
2012-09-09 12:28:19 +00:00
class CEngine;
class CParticle;
class CTerrain;
2012-09-09 12:28:19 +00:00
class CWater;
class CCloud;
class CCamera;
class CPlanet;
class CLightning;
} // namespace Gfx
class CAuto
{
public:
2015-07-12 09:33:52 +00:00
CAuto(COldObject* object);
virtual ~CAuto();
virtual void DeleteObject(bool bAll=false);
virtual void Init();
virtual void Start(int param);
virtual bool EventProcess(const Event &event);
virtual Error IsEnded();
virtual bool Abort();
2013-05-18 14:44:22 +00:00
virtual Error StartAction(int param);
virtual bool SetType(ObjectType type);
virtual bool SetValue(int rank, float value);
virtual bool SetString(char *string);
virtual bool CreateInterface(bool bSelect);
2012-09-09 12:28:19 +00:00
virtual Error GetError();
2012-09-09 12:28:19 +00:00
virtual bool GetBusy();
virtual void SetBusy(bool busy);
virtual void InitProgressTotal(float total);
virtual void EventProgress(float rTime);
2012-09-09 12:28:19 +00:00
virtual bool GetMotor();
virtual void SetMotor(bool bMotor);
2014-11-10 13:16:32 +00:00
virtual bool Write(CLevelParserLine* line);
2014-11-10 16:15:34 +00:00
virtual bool Read(CLevelParserLine* line);
protected:
2012-09-09 12:28:19 +00:00
void CheckInterface(Ui::CWindow *pw, EventType event, bool bState);
void EnableInterface(Ui::CWindow *pw, EventType event, bool bState);
void VisibleInterface(Ui::CWindow *pw, EventType event, bool bState);
void DeadInterface(Ui::CWindow *pw, EventType event, bool bState);
void UpdateInterface();
void UpdateInterface(float rTime);
protected:
CEventQueue* m_eventQueue = nullptr;
Gfx::CEngine* m_engine = nullptr;
Gfx::CParticle* m_particle = nullptr;
Gfx::CTerrain* m_terrain = nullptr;
Gfx::CWater* m_water = nullptr;
Gfx::CCloud* m_cloud = nullptr;
Gfx::CPlanet* m_planet = nullptr;
Gfx::CLightning* m_lightning = nullptr;
Gfx::CCamera* m_camera = nullptr;
Ui::CInterface* m_interface = nullptr;
CRobotMain* m_main = nullptr;
COldObject* m_object = nullptr;
CSoundInterface* m_sound = nullptr;
ObjectType m_type = OBJECT_NULL;
bool m_bBusy = false;
bool m_bMotor = false;
float m_time = 0.0f;
float m_lastUpdateTime = 0.0f;
float m_progressTime = 0.0f;
float m_progressTotal = 0.0f;
};