public QueuedMessage(List<String> messages, int secondsDelay, AbstractEvent abstractEvent) { if (messages != null && messages.Count > 0) { this.messagesBeforeTimeSpan.AddRange(messages); } this.dueTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond + (secondsDelay * 1000); this.abstractEvent = abstractEvent; }
public QueuedMessage(String messageBeforeTimeSpan, String messageAfterTimeSpan, TimeSpan timeSpan, int secondsDelay, AbstractEvent abstractEvent) { if (messageBeforeTimeSpan != null) { this.messagesBeforeTimeSpan.Add(messageBeforeTimeSpan); } if (messageAfterTimeSpan != null) { this.messagesAfterTimeSpan.Add(messageAfterTimeSpan); } this.timeSpan = timeSpan; this.dueTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond + (secondsDelay * 1000); this.abstractEvent = abstractEvent; }
// we pass in the event which triggered this clip so that we can query the event before playing the // clip to check if it's still valid against the latest game state. This is necessary for clips queued // with non-zero delays (e.g. you might have crossed the start / finish line between the clip being // queued and it being played) public void queueClip(String eventName, int secondsDelay, AbstractEvent abstractEvent, PearlsOfWisdom.PearlType pearlType, double pearlMessageProbability) { queueClip(eventName, new QueuedMessage(secondsDelay, abstractEvent), pearlType, pearlMessageProbability); }
public void queueClip(String eventName, int secondsDelay, AbstractEvent abstractEvent) { queueClip(eventName, secondsDelay, abstractEvent, PearlsOfWisdom.PearlType.NONE, 0); }
// used for creating a pearl of wisdom message where we need to copy the dueTime from the original public QueuedMessage(AbstractEvent abstractEvent) { this.abstractEvent = abstractEvent; }
public QueuedMessage(int secondsDelay, AbstractEvent abstractEvent) { this.dueTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond + (secondsDelay * 1000); this.abstractEvent = abstractEvent; }