blob: 96648d485c6a24e6ea11d91b721767363469e54c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#pragma once
#include "StarObject.hpp"
namespace Star {
class FarmableObject : public Object {
public:
FarmableObject(ObjectConfigConstPtr config, Json const& parameters);
void update(float dt, uint64_t currentStep) override;
bool damageTiles(List<Vec2I> const& position, Vec2F const& sourcePosition, TileDamage const& tileDamage) override;
InteractAction interact(InteractRequest const& request) override;
bool harvest();
int stage() const;
protected:
void readStoredData(Json const& diskStore) override;
Json writeStoredData() const override;
private:
void enterStage(int newStage);
int m_stage;
int m_stageAlt;
double m_stageEnterTime;
double m_nextStageTime;
SlidingWindow m_immersion;
float m_minImmersion;
float m_maxImmersion;
bool m_consumeSoilMoisture;
JsonArray m_stages;
bool m_finalStage;
};
}
|