public void Wash() { this.name = Name.Blank; this.pCommand = null; this.triggerTime = 0.0f; this.deltaTime = 0.0f; }
public TimerEvent() : base() { this.name = Name.Blank; this.pCommand = null; this.triggerTime = 0.0f; this.deltaTime = 0.0f; }
public void Set(TimerEvent.Name name, Command pCommand, float deltaTimeToTrigger, float currTime, bool repeat = true) { Debug.Assert(pCommand != null); this.name = name; this.pCommand = pCommand; this.deltaTime = deltaTimeToTrigger; this.triggerTime = currTime + deltaTimeToTrigger; this.repeat = repeat; }
public void Set(Name eventName, Command pCommand, float deltaTimeToTrigger) { Debug.Assert(pCommand != null); this.name = eventName; this.pCommand = pCommand; this.deltaTime = deltaTimeToTrigger; // set the trigger time this.triggerTime = TimerEventManager.GetCurrTime() + deltaTimeToTrigger; }
// PA2: Factory method, create and add image into actives public TimerEvent Add(TimerEvent.Name name, Command cmd, float deltaTimeToTrigger) { // Create a new image TimerEvent ret = (TimerEvent)this.PullFromReserved(); ret.name = name; ret.pCommand = cmd; ret.deltaTime = deltaTimeToTrigger; ret.triggerTime = this.currentTime + deltaTimeToTrigger; // Add it to the list this.AddAndSort(ref this.poActiveHead, ref this.pActiveEnd, ret); return(ret); }
public static TimerEvent Find(TimerEvent.Name name) { TimerEventManager pMan = TimerEventManager.privGetInstance(); Debug.Assert(pMan != null); // Compare functions only compares two Nodes // So: Use a reference node // fill in the needed data // use in the Compare() function Debug.Assert(pTimerEventRef != null); pTimerEventRef.Wash(); pTimerEventRef.SetName(name); TimerEvent pData = (TimerEvent)pMan.baseFindNode(pTimerEventRef); return(pData); }
public static TimerEvent Add(TimerEvent.Name timeName, Command pCommand, float deltaTimeToTrigger, bool repeat = true) { Debug.Assert(pCommand != null); Debug.Assert(deltaTimeToTrigger >= 0.0f); TimerMan pTimerMan = TimerMan.PrivGetInstance(); Debug.Assert(pTimerMan != null); float triggerTime = deltaTimeToTrigger + pTimerMan.mCurrTime; TimerEvent pPreNode = PrivLocateNode(triggerTime); TimerEvent pNode = (TimerEvent)pTimerMan.BaseAddToPosition(pPreNode); Debug.Assert(pNode != null); pNode.Set(timeName, pCommand, deltaTimeToTrigger, pTimerMan.mCurrTime, repeat); return(pNode); }
//---------------------------------------------------------------------- // Methods //---------------------------------------------------------------------- public static TimerEvent Add(TimerEvent.Name timeName, Command pCommand, float deltaTimeToTrigger) { TimerEventManager pMan = TimerEventManager.privGetInstance(); Debug.Assert(pMan != null); //pull a resereved node TimerEvent pNode = (TimerEvent)pMan.basePopReserve(); Debug.Assert(pNode != null); Debug.Assert(pCommand != null); Debug.Assert(deltaTimeToTrigger >= 0.0f); //set the data pNode.Set(timeName, pCommand, deltaTimeToTrigger); //add the newly set timer event node to the list in sorted order pMan.baseAddSorted(pNode); return(pNode); }
public void SetName(Name inName) { this.name = inName; }