载入中...
搜索中...
未找到
Collector.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <string>
6
7namespace eve::economy {
8
9class GatherNode;
10
16public:
18 enum class State { Idle, MovingToNode, Gathering, MovingToDrop, Depositing };
19
25 Collector(int carryCapacity, int gatherRatePerTick, int travelTicks);
26
28 bool assign(GatherNode* node);
30 void clearAssignment();
31
33 void tick(int player);
34
36 bool isIdle() const;
38 State state() const;
40 std::string stateName() const;
42 int cargo() const;
44 int carryCapacity() const;
46 std::string resourceType() const;
48 int totalGathered() const;
50 int trips() const;
51
53 void destroy();
54
55private:
56 void startMoveToNode();
57 void startMoveToDrop();
58 void deposit(int player);
59
60 GatherNode* node_ = nullptr;
61 State state_ = State::Idle;
62 int carryCapacity_ = 0;
63 int gatherRatePerTick_ = 0;
64 int travelTicks_ = 0;
65 int travelRemaining_ = 0;
66 int cargo_ = 0;
67 std::string type_;
68 int totalGathered_ = 0;
69 int trips_ = 0;
70};
71
72} // namespace eve::economy
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
void(* destroy)(void *)
const RoadNode * node
SimulationTick tick
采集者:WorkerTrip 基线的状态机 (选目标→接近→采集→载荷判定→运输→卸货入账)。
Definition Collector.h:15
State
采集状态机的相位。
Definition Collector.h:18
地图上的资源节点:储量、再生、采集槽位。
Definition GatherNode.h:12