本文整理汇总了C#中WCell.Core.Timers.TimerEntry类的典型用法代码示例。如果您正苦于以下问题:C# TimerEntry类的具体用法?C# TimerEntry怎么用?C# TimerEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimerEntry类属于WCell.Core.Timers命名空间,在下文中一共展示了TimerEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SpawnPoint
public SpawnPoint(SpawnEntry entry, Region region)
{
m_spawns = new List<Unit>();
m_timer = new TimerEntry { Action = Spawn };
m_timer.Stop();
Region = region;
SpawnEntry = entry;
}
示例2: InitRegion
protected internal override void InitRegion()
{
base.InitRegion();
m_lastReset = DateTime.Now;
m_timeoutTimer = new TimerEntry(OnTimeout);
RegisterUpdatableLater(this);
}
示例3: Battleground
public Battleground()
{
if (HasQueue)
{
_queueTimer = new TimerEntry(dt => ProcessPendingPlayers());
RegisterUpdatable(_queueTimer);
}
_status = BattlegroundStatus.None;
AddPlayersToBiggerTeam = AddPlayersToBiggerTeamDefault;
_teams = new BattlegroundTeam[2];
_shutdownTimer = new TimerEntry(dt => Delete());
RegisterUpdatable(_shutdownTimer);
}
示例4: InitMap
protected internal override void InitMap()
{
base.InitMap();
var secs = difficulty.ResetTime;
if (secs > 0)
{
// TODO: Set expiry time correctly
//m_expiryTime = InstanceMgr.
}
m_lastReset = DateTime.Now;
m_timeoutTimer = new TimerEntry(OnTimeout);
RegisterUpdatableLater(this);
// create InstanceSettings object
settings = CreateSettings();
}
示例5: ArathiBase
protected ArathiBase(ArathiBasin instance, GOEntry flagstand)
{
Instance = instance;
// init timers
CaptureTimer = new TimerEntry(dt =>
{
Capture();
});
StartScoreTimer = new TimerEntry(dt =>
{
GivesScore = true;
});
Instance.RegisterUpdatableLater(StartScoreTimer);
Instance.RegisterUpdatableLater(CaptureTimer);
// TODO: flagstand?
SpawnNeutral();
}
示例6: ArathiBase
protected ArathiBase(ArathiBasin instance)
{
Instance = instance;
// init timers
CaptureTimer = new TimerEntry(dt =>
{
Capture();
});
StartScoreTimer = new TimerEntry(dt =>
{
GivesScore = true;
});
Instance.RegisterUpdatableLater(StartScoreTimer);
Instance.RegisterUpdatableLater(CaptureTimer);
Names = new string[(int)ClientLocale.End];
AddSpawns();
SpawnNeutral();
}
示例7: DeleteNow
protected internal override void DeleteNow()
{
if (m_linkedTrap != null)
{
m_linkedTrap.DeleteNow();
}
if (Respawns)
{
// TODO: Finish respawning
OnDeleted();
m_respawnTimer = new TimerEntry();
}
else
{
base.DeleteNow();
}
}
示例8: OnDeath
protected override void OnDeath()
{
m_record.LastDeathTime = DateTime.Now;
MarkDead();
Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.DeathAtMap, (uint)MapId, 1);
Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.DeathInDungeon, (uint)MapId, 1);
// start release timer
m_corpseReleaseTimer = new TimerEntry(dt => ReleaseCorpse());
m_corpseReleaseTimer.Start(Corpse.AutoReleaseDelay, 0);
}
示例9: NetworkStatistics
protected NetworkStatistics()
{
m_consumerTimer = new TimerEntry(0f, 0f, ConsumerCallback);
m_queuedStats = new SynchronizedQueue<PacketInfo>();
}
示例10: Unit
protected Unit()
{
Type |= ObjectTypes.Unit;
// combat
m_isInCombat = false;
m_attackTimer = new TimerEntry(0.0f, 0.0f, CombatTick);
CastSpeedFactor = 1f;
ResetMechanicDefaults();
m_flying = m_waterWalk = m_hovering = m_featherFalling = 0;
m_canMove = m_canInteract = m_canHarm = m_canCastSpells = true;
}
示例11: LoadDeathState
private void LoadDeathState()
{
if (m_record.CorpseX != null)
{
// we were dead and released the corpse
var map = World.GetMap(m_record.CorpseMap);
if (map != null)
{
m_corpse = SpawnCorpse(false, false, map,
new Vector3(m_record.CorpseX.Value, m_record.CorpseY, m_record.CorpseZ), m_record.CorpseO);
BecomeGhost();
}
else
{
// can't spawn corpse -> revive
if (log.IsWarnEnabled)
{
log.Warn("Player {0}'s Corpse was spawned in invalid map: {1}", this, m_record.CorpseMap);
}
}
}
else if (m_record.Health == 0)
{
// we were dead and did not release yet
var diff = DateTime.Now.Subtract(m_record.LastDeathTime).ToMilliSecondsInt() + Corpse.AutoReleaseDelay;
m_corpseReleaseTimer = new TimerEntry(dt => ReleaseCorpse());
if (diff > 0)
{
// mark dead and start release timer
MarkDead();
m_corpseReleaseTimer.Start(diff, 0);
}
else
{
// auto release
ReleaseCorpse();
}
}
else
{
// we are alive and kicking
}
}
示例12: SpellCast
/// <summary>
/// Creates a recyclable SpellCast.
/// </summary>
private SpellCast()
{
m_castTimer = new TimerEntry(Perform);
Targets = new HashSet<WorldObject>();
}
示例13: Equals
public bool Equals(TimerEntry obj)
{
// needs to be improved
return obj.Interval == Interval && Equals(obj.Action, Action);
}
示例14: SpellCast
/// <summary>
/// Creates a recyclable SpellCast.
/// </summary>
/// <param name="caster">The GameObject (in case of traps etc) or Unit casting</param>
private SpellCast()
{
m_castTimer = new TimerEntry(Perform);
}
示例15: SpellChannel
/// <summary>
/// Can only work with unit casters
/// </summary>
private SpellChannel()
{
m_timer = new TimerEntry(Tick);
}