本文整理匯總了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);
}