Exemplo n.º 1
0
 public override void Create(MessageConsole console)
 {
     base.Create(console);
     if (Answers.Count > 0)
     {
         Screen.MessageConsole.PrintMessage(Answers[PointerIndex].Item1.Details());
     }
     else
     {
         Screen.MessageConsole.PrintMessage(""); //will clear MessageConsole when last item is taken
     }
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        private void ComputePositions(MessageConsole console)
        {
            var columns = (int)Math.Ceiling(Answers.Count * 1.0 / Rows);
            var last    = 1;

            for (var i = 0; i < columns; i++)
            {
                for (var j = 0; j < Rows && i * Rows + j < Answers.Count; j++)
                {
                    Positions.Add(console.Position + new Point(last, j + 1 + (Text == null ? 0 : 2)) + ChoicePositionOffset);
                }

                var maxLegth = 0;
                for (var j = 0; j < Rows && i * Rows + j < Answers.Count; j++)
                {
                    maxLegth = Math.Max(maxLegth, Answers[i * Rows + j].Item2.Length);
                }
                last += maxLegth + 2;
            }
        }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 public override void Create(MessageConsole console)
 {
     text          = ConsoleObjects.CreateFromString(message);
     text.Position = console.Position + new Point(1, 1);
 }
Exemplo n.º 6
0
 public override void Create(MessageConsole console)
 {
     Text.Position = console.Position + new Point(1, 1);
     timer.Start();
 }
Exemplo n.º 7
0
 public abstract void Create(MessageConsole console);