public ChoiceMessage(IEnumerable <Tuple <T, string> > answers, string question = null)
 {
     Answers     = new List <Tuple <T, string> >(answers);
     WaitPointer = ConsoleObjects.CreateFromGlyph(PointerGlyph);
     Other       = new List <GameObject>();
     if (question != null)
     {
         Text = ConsoleObjects.CreateFromString(question);
     }
 }
        public TimeoutMessage(string message, int milliseconds)
        {
            Text        = ConsoleObjects.CreateFromString(message);
            WaitPointer = null;
            Other       = null;

            timer           = new Timer(milliseconds);
            timer.AutoReset = false;
            timer.Elapsed  += (sender, args) => Finished = true;
        }
        public override void Create(MessageConsole console)
        {
            Other.Clear();
            Other.AddRange(Answers.Select(t => ConsoleObjects.CreateFromString(t.Item2)));

            ComputePositions(console);

            for (var i = 0; i < Other.Count; i++)
            {
                Other[i].Position = Positions[i];
            }

            PointerIndex = StartIndex;

            Text.Position = console.Position + new Point(1, 1) + TextPositionOffset;
        }
 public override void Create(MessageConsole console)
 {
     base.Create(console);
     waitPointer          = ConsoleObjects.CreateBlinkingFromGlyph(26, 1);
     waitPointer.Position = console.Position + new Point(console.Width - 2, console.Height - 2);
 }
 public override void Create(MessageConsole console)
 {
     text          = ConsoleObjects.CreateFromString(message);
     text.Position = console.Position + new Point(1, 1);
 }
Exemple #6
0
 public ConsoleRenderable(char symbol, Color color = new Color())
 {
     ConsoleObject = ConsoleObjects.CreateFromChar(symbol, color);
 }
Exemple #7
0
 public ConsoleRenderable(int glyph, Color color = new Color())
 {
     ConsoleObject = ConsoleObjects.CreateFromGlyph(glyph, color);
 }
Exemple #8
0
 /// <summary>
 /// Remove a (root) element from the console
 /// </summary>
 /// <param name="screenObject">ConsoleObject to remove</param>
 public void RemoveObject(ConsoleObjects.ConsoleObject screenObject)
 {
     ScreenObjects.Remove(screenObject);
     screenObject.Clear();
 }
Exemple #9
0
 /// <summary>
 /// Add a (root) element to the console
 /// </summary>
 /// <param name="screenObject">ConsoleObject to add</param>
 public void AddObject(ConsoleObjects.ConsoleObject screenObject)
 {
     ScreenObjects.Add(screenObject);
     screenObject.Parent = this;
     screenObject.Draw();
 }