载入中...
搜索中...
未找到
src
modules
economy
Collector.h
浏览该文件的文档.
1
#pragma once
2
#include "
common/Export.h
"
3
4
5
#include <string>
6
7
namespace
eve::economy
{
8
9
class
GatherNode;
10
15
class
EVENGINE_API_FOUNDATION
Collector
{
16
public
:
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
55
private
:
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
state
bool state
Definition
ActionTimelineWidget.cpp:33
Export.h
EVENGINE_API_FOUNDATION
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition
Export.h:106
destroy
void(* destroy)(void *)
Definition
JobSystemThreadPool.cpp:91
node
const RoadNode * node
Definition
RoadTraffic.cpp:15
tick
SimulationTick tick
Definition
TacticsPersistence.cpp:158
eve::economy::Collector
采集者:WorkerTrip 基线的状态机 (选目标→接近→采集→载荷判定→运输→卸货入账)。
Definition
Collector.h:15
eve::economy::Collector::State
State
采集状态机的相位。
Definition
Collector.h:18
eve::economy::GatherNode
地图上的资源节点:储量、再生、采集槽位。
Definition
GatherNode.h:12
eve::economy
Definition
IEconomy.h:5