MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / lightSources

Method lightSources

source/game/StarToolUser.cpp:110–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110List<LightSource> ToolUser::lightSources() const {
111 if (m_suppress.get() || !m_user)
112 return {};
113
114 List<LightSource> lights;
115 for (auto item : {m_primaryHandItem.get(), m_altHandItem.get()}) {
116 if (auto activeItem = as<ActiveItem>(item))
117 lights.appendAll(activeItem->lights());
118
119 if (auto flashlight = as<Flashlight>(item))
120 lights.appendAll(flashlight->lightSources());
121
122 if (auto inspectionTool = as<InspectionTool>(item))
123 lights.appendAll(inspectionTool->lightSources());
124 }
125
126 return lights;
127}
128
129void ToolUser::effects(EffectEmitter& emitter) const {
130 if (m_suppress.get())

Callers

nothing calls this directly

Calls 3

appendAllMethod · 0.80
lightsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected