docs: 更新 containers 和 threading 模块文档

- containers: 更新 string 类的多个方法文档
- threading: 更新 mutex 和 task-group 方法文档
This commit is contained in:
2026-03-26 01:59:14 +08:00
parent 8df04c120f
commit 5c3566774b
42 changed files with 714 additions and 96 deletions

View File

@@ -18,7 +18,7 @@ public:
return dynamic_cast<::XCEngine::Components::LightComponent*>(component) != nullptr;
}
bool Render(::XCEngine::Components::Component* component) override {
bool Render(::XCEngine::Components::Component* component, IUndoManager* undoManager) override {
auto* light = dynamic_cast<::XCEngine::Components::LightComponent*>(component);
if (!light) {
return false;
@@ -28,6 +28,9 @@ public:
const char* lightTypeLabels[] = { "Directional", "Point", "Spot" };
bool changed = false;
if (ImGui::Combo("Type", &lightType, lightTypeLabels, 3)) {
if (undoManager) {
undoManager->BeginInteractiveChange("Modify Light");
}
light->SetLightType(static_cast<::XCEngine::Components::LightType>(lightType));
changed = true;
}
@@ -39,12 +42,18 @@ public:
light->GetColor().a
};
if (UI::DrawColor4("Color", color)) {
if (undoManager) {
undoManager->BeginInteractiveChange("Modify Light");
}
light->SetColor(::XCEngine::Math::Color(color[0], color[1], color[2], color[3]));
changed = true;
}
float intensity = light->GetIntensity();
if (UI::DrawFloat("Intensity", intensity, 100.0f, 0.1f, 0.0f)) {
if (undoManager) {
undoManager->BeginInteractiveChange("Modify Light");
}
light->SetIntensity(intensity);
changed = true;
}
@@ -52,6 +61,9 @@ public:
if (light->GetLightType() != ::XCEngine::Components::LightType::Directional) {
float range = light->GetRange();
if (UI::DrawFloat("Range", range, 100.0f, 0.1f, 0.001f)) {
if (undoManager) {
undoManager->BeginInteractiveChange("Modify Light");
}
light->SetRange(range);
changed = true;
}
@@ -60,6 +72,9 @@ public:
if (light->GetLightType() == ::XCEngine::Components::LightType::Spot) {
float spotAngle = light->GetSpotAngle();
if (UI::DrawSliderFloat("Spot Angle", spotAngle, 1.0f, 179.0f, 100.0f, "%.1f")) {
if (undoManager) {
undoManager->BeginInteractiveChange("Modify Light");
}
light->SetSpotAngle(spotAngle);
changed = true;
}
@@ -67,6 +82,9 @@ public:
bool castsShadows = light->GetCastsShadows();
if (UI::DrawBool("Cast Shadows", castsShadows)) {
if (undoManager) {
undoManager->BeginInteractiveChange("Modify Light");
}
light->SetCastsShadows(castsShadows);
changed = true;
}