8 if (plan_)
return std::unexpected(
"piece idle playback already active");
9 if (!
plan.movingOut && !
plan.movingIn)
10 return std::unexpected(
"piece idle transition has no animations");
11 plan_ = std::move(
plan);
18 std::expected<void, std::string> PieceIdlePlayback::startAnimation(
23 return std::unexpected(
"piece idle animation has an empty DataID");
24 const auto started =
playback.transitionRySTxzDropStayAtEnd(
28 if (!started)
return std::unexpected(started.error());
34 engine::SequencePlayback&
playback)
const noexcept
38 return !info || info->endTime <= info->sequenceClock;
45 if (!plan_)
return update;
51 const auto out = startAnimation(
52 *plan_->movingOut,
playback, movingOutSequence_);
53 if (!
out)
return std::unexpected(
out.error());
57 const auto in = startAnimation(
58 *plan_->movingIn,
playback, movingInSequence_);
65 return std::unexpected(in.error());
77 if (!stopped)
return std::unexpected(stopped.error());
85 if (!stopped)
return std::unexpected(stopped.error());
94 update.completed =
true;
decision::EconomicActionPlan plan
std::atomic< bool > finished
std::expected< void, std::string > begin(PieceIdleTransitionPlan plan)
std::expected< PieceIdlePlaybackUpdate, std::string > tick(engine::SequencePlayback &playback)
constexpr DataId EmptyDataId
constexpr std::uint16_t TokenPriority