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

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()

◆ fromSeconds()

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

◆ 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 第 37 行定义.

引用了 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

Add two durations with overflow validation.

返回
A checked sum, or Rejected if the signed range would overflow.

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

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

被这些函数引用 eve::SimulationClock::advance(), eve::animation::MontagePlayer::advanceBlendOut(), eve::weapon::CombatCarrierRuntime::update() , 以及 eve::action::ActionDefinition::validate().

◆ 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::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::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::animation::MontagePlayer::present(), eve::editor::ActionTimelineEditor::reloadDocument(), eve::SimulationClock::reset(), eve::editor::ActionTimelineEditor::resizeState(), 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::editor::ActionTimelineWidget::setSnapInterval(), eve::editor::ActionTimelineWidget::setVisibleRange(), eve::combat::HitFeelRuntime::state(), eve::editor::ActionPreviewController::stop(), eve::editor::ActionTimelineEditor::stop(), eve::animation::MontagePlayer::stop(), eve::climbing::ClimbingRuntime::transitionAnchor(), eve::weapon::ProjectileRuntime::update(), eve::weapon::CombatCarrierRuntime::update(), eve::action::AbilityDefinition::validate(), eve::action::ActionTimeline::validate(), eve::combat::HitFeelRequest::validate(), eve::weapon::CarrierRecipe::validate(), eve::weapon::ProjectileDefinition::validate() , 以及 eve::editor::ActionTimelineWidget::zoom().

友元及相关函数文档

◆ operator<=>

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

Operator <=>.

◆ operator==

constexpr bool operator== ( Duration  ,
Duration   
)
friend

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