2014-10-14 13:11:37 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the Colobot: Gold Edition source code
|
2015-08-22 14:40:02 +00:00
|
|
|
* Copyright (C) 2001-2015, Daniel Roux, EPSITEC SA & TerranovaTeam
|
|
|
|
* http://epsitec.ch; http://colobot.info; http://github.com/colobot
|
2014-10-14 13:11:37 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2015-08-15 12:02:07 +00:00
|
|
|
#include "common/error.h"
|
2015-10-03 20:05:14 +00:00
|
|
|
#include "common/event.h"
|
2015-07-12 09:33:52 +00:00
|
|
|
|
|
|
|
#include "object/object_type.h"
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
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;
|
2012-06-26 20:23:05 +00:00
|
|
|
class CWindow;
|
2015-09-27 14:28:11 +00:00
|
|
|
} // namespace Ui
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2015-08-02 09:40:47 +00:00
|
|
|
namespace Gfx
|
|
|
|
{
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2012-09-09 12:28:19 +00:00
|
|
|
class CEngine;
|
|
|
|
class CParticle;
|
2015-09-27 14:28:11 +00:00
|
|
|
class CTerrain;
|
2012-09-09 12:28:19 +00:00
|
|
|
class CWater;
|
|
|
|
class CCloud;
|
|
|
|
class CCamera;
|
|
|
|
class CPlanet;
|
|
|
|
class CLightning;
|
2015-09-27 14:28:11 +00:00
|
|
|
} // namespace Gfx
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CAuto
|
|
|
|
{
|
|
|
|
public:
|
2015-07-12 09:33:52 +00:00
|
|
|
CAuto(COldObject* object);
|
2012-06-26 20:23:05 +00:00
|
|
|
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);
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
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-06-26 20:23:05 +00:00
|
|
|
|
2012-09-09 12:28:19 +00:00
|
|
|
virtual bool GetBusy();
|
2015-10-03 20:05:14 +00:00
|
|
|
virtual void SetBusy(bool busy);
|
2012-06-26 20:23:05 +00:00
|
|
|
virtual void InitProgressTotal(float total);
|
|
|
|
virtual void EventProgress(float rTime);
|
|
|
|
|
2012-09-09 12:28:19 +00:00
|
|
|
virtual bool GetMotor();
|
2012-06-26 20:23:05 +00:00
|
|
|
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);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
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);
|
2012-06-26 20:23:05 +00:00
|
|
|
void UpdateInterface();
|
|
|
|
void UpdateInterface(float rTime);
|
|
|
|
|
|
|
|
protected:
|
2015-08-14 21:11:24 +00:00
|
|
|
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;
|
2012-06-26 20:23:05 +00:00
|
|
|
};
|