| 108 | } |
| 109 | |
| 110 | List<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 | |
| 129 | void ToolUser::effects(EffectEmitter& emitter) const { |
| 130 | if (m_suppress.get()) |