2014-10-14 13:11:37 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the Colobot: Gold Edition source code
|
2016-02-13 13:11:30 +00:00
|
|
|
* Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
|
2015-08-22 14:40:02 +00:00
|
|
|
* 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
|
|
|
|
|
|
|
|
|
|
|
|
#include "object/auto/auto.h"
|
|
|
|
|
2015-08-15 12:02:07 +00:00
|
|
|
#include "level/research_type.h"
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
enum AutoResearchPhase
|
|
|
|
{
|
|
|
|
ALP_WAIT = 1,
|
|
|
|
ALP_SEARCH = 2, // research in progress
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CAutoResearch : public CAuto
|
|
|
|
{
|
|
|
|
public:
|
2015-07-12 09:33:52 +00:00
|
|
|
CAutoResearch(COldObject* object);
|
2012-06-26 20:23:05 +00:00
|
|
|
~CAutoResearch();
|
|
|
|
|
2015-08-17 19:53:28 +00:00
|
|
|
void DeleteObject(bool bAll=false) override;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2015-08-17 19:53:28 +00:00
|
|
|
void Init() override;
|
2015-10-03 20:05:14 +00:00
|
|
|
Error StartAction(int param) override;
|
2015-08-17 19:53:28 +00:00
|
|
|
bool EventProcess(const Event &event) override;
|
|
|
|
Error GetError() override;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2015-08-17 19:53:28 +00:00
|
|
|
bool CreateInterface(bool bSelect) override;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2015-08-17 19:53:28 +00:00
|
|
|
bool Write(CLevelParserLine* line) override;
|
|
|
|
bool Read(CLevelParserLine* line) override;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void UpdateInterface();
|
|
|
|
void UpdateInterface(float rTime);
|
2012-09-09 12:28:19 +00:00
|
|
|
void OkayButton(Ui::CWindow *pw, EventType event);
|
|
|
|
bool TestResearch(EventType event);
|
2012-06-26 20:23:05 +00:00
|
|
|
void FireStopUpdate(float progress, bool bLightOn);
|
|
|
|
|
|
|
|
protected:
|
2015-08-14 21:11:24 +00:00
|
|
|
AutoResearchPhase m_phase = ALP_WAIT;
|
|
|
|
float m_progress = 0.0f;
|
|
|
|
float m_speed = 0.0f;
|
|
|
|
float m_timeVirus = 0.0f;
|
|
|
|
float m_lastUpdateTime = 0.0f;
|
|
|
|
float m_lastParticle = 0.0f;
|
|
|
|
ResearchType m_research = {};
|
|
|
|
int m_partiStop[6] = {};
|
|
|
|
int m_channelSound = 0;
|
2012-06-26 20:23:05 +00:00
|
|
|
};
|