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 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 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) { text = ConsoleObjects.CreateFromString(message); text.Position = console.Position + new Point(1, 1); }