/// <summary> /// Create a context sensitive rotating tip module that displays on death /// </summary> /// <param name="context">The game's context</param> public GameTips(GameContext context) { this.context = context; tips = TipLoader.GetTips(context); mode = TipMode.OnDeath; Scramble(new List<string>(tips.ToArray())); Initialize(); }
/// <summary> /// Get context sensitive tips /// </summary> /// <param name="context">The game's context</param> /// <returns>Queue of tips matching matching the given context</returns> public static Queue<string> GetTips(GameContext context) { Queue<string> tipQueue = new Queue<string>(); foreach (Tip tip in tips) { if (context.Contains(tip.Context)) tipQueue.Enqueue(tip.Message); } return tipQueue; }
/// <summary> /// Create a tip module with the specified tip display mode /// </summary> /// <param name="context">The game's context</param> /// <param name="mode">The mode to display tips with</param> public GameTips(GameContext context, TipMode mode) { this.context = context; if (mode == TipMode.FullRotating) tips = TipLoader.GetTips(); else tips = TipLoader.GetTips(context); this.mode = mode; Scramble(new List<string>(tips.ToArray())); Initialize(); }