载入中...
搜索中...
未找到

Signed, fixed-resolution simulation duration in nanoseconds. 更多...

#include <Time.h>

Public 成员函数

constexpr Duration () noexcept=default
 Construct a zero duration.
 
constexpr Duration (std::int64_t nanoseconds) noexcept
 Construct a duration from exact nanoseconds.
 
constexpr std::int64_t nanoseconds () const noexcept
 Return the exact signed nanosecond representation.
 
double seconds () const noexcept
 Return this duration as seconds for legacy/presentation APIs.
 
constexpr bool isZero () const noexcept
 Whether this duration is exactly zero.
 
Result< Duration > tryAdd (Duration other) const
 Add two durations with overflow validation.
 
Result< Duration > scaled (double rate) const
 Scale a duration by a finite non-negative rate.
 

静态 Public 成员函数

static constexpr Duration fromNanoseconds (std::int64_t nanoseconds) noexcept
 Construct an exact duration from nanoseconds.
 
static constexpr Duration zero () noexcept
 Return zero duration.
 
static Result< Duration > fromSeconds (double seconds)
 Convert finite seconds to the nearest nanosecond.
 

友元

constexpr bool operator== (Duration, Duration) noexcept=default
 
constexpr auto operator<=> (Duration, Duration) noexcept=default
 Operator <=>.
 

详细描述

Signed, fixed-resolution simulation duration in nanoseconds.

The integer representation avoids accumulating binary floating-point frame error in deterministic state. Conversion from seconds validates finiteness and range and returns a checked Result.

在文件 Time.h 第 43 行定义.

构造及析构函数说明

◆ Duration() [1/2]

constexpr eve::Duration::Duration ( )
constexprdefaultnoexcept

Construct a zero duration.

被这些函数引用 fromSeconds(), scaled() , 以及 tryAdd().

◆ Duration() [2/2]

constexpr eve::Duration::Duration ( std::int64_t  nanoseconds)
inlineexplicitconstexprnoexcept

Construct a duration from exact nanoseconds.

参数
nanosecondsSigned nanosecond value in this duration domain.

在文件 Time.h 第 52 行定义.

成员函数说明

◆ fromNanoseconds()

static constexpr Duration eve::Duration::fromNanoseconds ( std::int64_t  nanoseconds)
inlinestaticconstexprnoexcept

◆ fromSeconds()

Result< Duration > eve::Duration::fromSeconds ( double  seconds)
static

Convert finite seconds to the nearest nanosecond.

返回
A checked duration, or Rejected for non-finite/out-of-range input.

在文件 Time.cpp 第 17 行定义.

引用了 Duration(), eve::Result< T >::failure(), maximum, minimum, nanoseconds(), seconds() , 以及 eve::Result< T >::success().

被这些函数引用 eve::crowd::Crowd::advance(), eve::logistics::Logistics::advance(), eve::action::ScriptActionRuntime::advanceAbilities(), eve::action::ScriptActionRuntime::advanceAction(), eve::particles_graphics_editing::ParticleEmitterOffscreenPresenter::draw(), eve::production::WorkQueue::enqueue(), eve::climbing::exposeClimbingMotionBindings(), eve::daynight::exposeSkyScriptBindings(), eve::editor::ActionTimelinePayloadEditor::fitBlockToClip(), eve::editor::ActionTimelineEditor::frameStepTarget(), eve::action::ActionCameraCueBinding::fromPayload(), eve::action::ActionPrefabSpawnBinding::fromPayload(), eve::editor::ActionTimelineWidget::inspectSelection(), eve::rts::RTSProjectileSystem::launch(), eve::animation::detail::legacyStep(), eve::editor::ActionTimelineTarget::makeSet(), eve::particles::ParticleEffect::naturalDuration(), eve::rts::RTS::prepareScriptUnit(), eve::rts::RTS::queueScriptResearch(), eve::rts::RTSLockstep::RTSLockstep(), eve::scene_editor::ScenePhysicsPlacementBackend::step(), eve::rts::RTS::stepScript(), eve::growth::Growth::stepSeconds(), eve::vehicle::VehiclePhysics::tryWheelMove(), eve::effects::EffectContainer::update(), eve::animation::Animation::update(), eve::animation::AnimPlayer::update(), eve::animation::AnimStateMachine::update(), eve::particles::ParticleSimSystem::update() , 以及 eve::particles::ParticleEffect::updateTimeline().

◆ isZero()

◆ nanoseconds()

◆ scaled()

Result< Duration > eve::Duration::scaled ( double  rate) const

Scale a duration by a finite non-negative rate.

返回
A checked rounded duration, or Rejected for invalid/range input.

在文件 Time.cpp 第 38 行定义.

引用了 Duration(), eve::Result< T >::failure(), maximum, minimum, nanoseconds(), rate , 以及 eve::Result< T >::success().

被这些函数引用 eve::SimulationClock::advance().

◆ seconds()

◆ tryAdd()

Result< Duration > eve::Duration::tryAdd ( Duration  other) const

◆ zero()

static constexpr Duration eve::Duration::zero ( )
inlinestaticconstexprnoexcept

Return zero duration.

在文件 Time.h 第 60 行定义.

被这些函数引用 eve::action::AbilityRuntime::activate(), eve::action::ActionTimeline::activeBlocks(), eve::editor::ActionTimelineEditor::addSectionSplit(), eve::editor::ActionTimelineWidget::addStateAtCursor(), eve::rts::MissionScriptSystem::addTimer(), eve::action::ActionRuntime::advance(), eve::combat::CombatCharacterRuntime::advance(), eve::combat::CombatLocomotionRuntime::advance(), eve::combat::HitFeelRuntime::advance(), eve::combat::CombatAttributeRuntime::advance(), eve::animation::MontagePlayer::advanceBlendOut(), eve::action::AbilityRuntime::advanceCooldowns(), eve::combat::HitFeelRuntime::apply(), eve::combat::CombatCharacterRuntime::applyStun(), eve::animation::MontagePlayer::beginBlendOut(), eve::editor::ActionTimelineEditor::boxSelect(), eve::action::ActionRuntime::cancel(), eve::climbing::ClimbingRuntime::climbUp(), eve::rts::MissionScriptSystem::controlTimer(), eve::editor::ActionTimelineEditor::editItem(), eve::weapon::encodeCarrierRecipe(), eve::action::ActionTimeline::fromValue(), eve::timer::Timer::getDeltaDuration(), eve::action::AbilityRuntime::grant(), eve::combat::HitFeelRuntime::isFrozen(), eve::combat::HitFeelRuntime::isStunned(), eve::animation::MontagePlayer::jumpToTime(), eve::editor::ActionTimelineWidget::pan(), eve::editor::ActionTimelineEditor::planPreview(), eve::animation::MontagePlayer::play(), eve::animation::MontagePlayer::prepare(), eve::editor::ActionTimelineEditor::reloadDocument(), eve::SimulationClock::reset(), eve::editor::ActionTimelineEditor::resizeState(), eve::weapon::CombatCarrierRuntime::restore(), eve::SimulationClock::sample(), eve::action::ActionTimeline::sample(), eve::editor::AnimationRootMotionPreviewSource::sampleRootMotion(), eve::editor::ActionTimelineEditor::scaleSelection(), eve::action::ActionTimeline::sectionRange(), eve::editor::ActionPreviewController::seek(), eve::editor::ActionTimelineEditor::seek(), eve::editor::ActionTimelineEditor::setSectionSplit(), eve::action::ActionRuntime::setSectionTimingOverride(), eve::editor::ActionTimelineWidget::setSnapInterval(), eve::editor::ActionTimelineWidget::setVisibleRange(), eve::rts::MatchSystem::start(), eve::combat::HitFeelRuntime::state(), eve::action::AbilityRuntime::step(), eve::editor::ActionPreviewController::stop(), eve::editor::ActionTimelineEditor::stop(), eve::animation::MontagePlayer::stop(), eve::climbing::ClimbingRuntime::transitionAnchor(), eve::weapon::ProjectileRuntime::update(), eve::action::AbilityDefinition::validate(), eve::action::ActionTimeline::validate(), eve::combat::HitFeelRequest::validate(), eve::weapon::CarrierRecipe::validate(), eve::weapon::CarrierSimulationSettings::validate(), eve::weapon::ProjectileDefinition::validate() , 以及 eve::editor::ActionTimelineWidget::zoom().

友元及相关函数文档

◆ operator<=>

constexpr auto operator<=> ( Duration  ,
Duration   
)
friend

Operator <=>.

◆ operator==

constexpr bool operator== ( Duration  ,
Duration   
)
friend

该类的文档由以下文件生成: