本文整理汇总了C++中Ticker::restart方法的典型用法代码示例。如果您正苦于以下问题:C++ Ticker::restart方法的具体用法?C++ Ticker::restart怎么用?C++ Ticker::restart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticker
的用法示例。
在下文中一共展示了Ticker::restart方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OBCTurret
OBCTurret(Entity& mE, OBCPhys& mCPhys, OBCDraw& mCDraw,
OBCKillable& mCKillable, Dir8 mDir, const OBWpnType& mWpn,
float mShootDelay, float mPJDelay, int mShootCount) noexcept
: OBCActor{mE, mCPhys, mCDraw},
cKillable(mCKillable),
direction{mDir},
wpn{game, OBGroup::GFriendlyKillable, mWpn},
shootDelay{mShootDelay},
pjDelay{mPJDelay},
shootCount{mShootCount}
{
cDraw.setRotation(getDegFromDir8(direction));
getEntity().addGroups(OBGroup::GEnemy, OBGroup::GEnemyKillable);
body.setResolve(false);
body.addGroups(OBGroup::GSolidGround, OBGroup::GSolidAir,
OBGroup::GEnemy, OBGroup::GKillable, OBGroup::GEnemyKillable);
tckShoot.restart(shootDelay);
repeat(tlShoot,
[this]
{
shoot();
},
shootCount, pjDelay);
cKillable.onDeath += [this]
{
game.createEShard(5, cPhys.getPosI());
};
}
示例2: setCooldown
inline void setCooldown(FT mValue) noexcept
{
tckCooldown.restart(mValue);
}