public SaveRestoreGameBrowseControl(AgiInterpreter interpreter)
 {
     this.Interpreter  = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.Title        = string.Empty;
     this.descriptions = new string[0];
     this.slotNumbers  = new int[0];
 }
Example #2
0
 public InputBoxControl(AgiInterpreter interpreter)
 {
     this.Interpreter   = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.Title         = string.Empty;
     this.Text          = string.Empty;
     this.MaxTextLength = DefaultMaxTextLength;
     this.Width         = DefaultWindowWidth;
 }
Example #3
0
 public ListBoxControl(AgiInterpreter interpreter)
 {
     this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.Title       = string.Empty;
     this.Width       = 10;
     this.Height      = 10;
     this.items       = new string[0];
 }
Example #4
0
    /*
     * Interpreter.State variables used
     * - TextForeground
     * - TextBackground
     * - TextCombine
     * - Variables (for string formatting)
     * - Strings (for string formatting)
     * - WindowRowMin
     */
    public WindowManager(AgiInterpreter interpreter)
    {
        this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));

        this.MessageState       = new MessageState();
        this.textAttributeStack = new Stack <TextColor>();
        this.textPositionStack  = new Stack <TextPosition>();
        this.textPosition       = new TextPosition(0, 0);
    }
Example #5
0
        void ISavedGameSerializer.LoadFrom(AgiInterpreter interpreter, Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));

            var settings = new XmlReaderSettings
            {
                IgnoreComments = true,
                IgnoreProcessingInstructions = true,
                IgnoreWhitespace             = true,
            };

            var reader = XmlReader.Create(stream, settings);

            this.DeserializeGame(reader);
        }
Example #6
0
        void ISavedGameSerializer.SaveTo(AgiInterpreter interpreter, string description, Stream stream)
        {
            if (description == null)
            {
                throw new ArgumentNullException(nameof(description));
            }

            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));

            var xmlWriter = new XmlTextWriter(stream, Encoding.UTF8)
            {
                Formatting = Formatting.Indented,
            };

            this.SerializeGame(xmlWriter, description);

            xmlWriter.Flush();
        }
Example #7
0
        public GameControl(AgiInterpreter interpreter)
        {
            this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));

            this.TraceControl      = new TraceControl(interpreter);
            this.StatusLineControl = new StatusLineControl(interpreter);

            switch (interpreter.Preferences.InputMode)
            {
            case UserInputMode.Classic:
                this.InputControl = new ClassicInputControl(interpreter);
                break;

            case UserInputMode.WordList:
                this.InputControl = new WordListInputControl(interpreter);
                break;

            case UserInputMode.InputBox:
                this.InputControl = new PopupInputControl(interpreter);
                break;
            }

            this.mouseDownStack = new Stack <MouseDown>();
        }
Example #8
0
 public SoundManager(AgiInterpreter interpreter)
 {
     this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
 }
Example #9
0
 internal void SetInterpreter(AgiInterpreter interpreter)
 {
     this.interpreter = interpreter;
 }
Example #10
0
 public PopupInputControl(AgiInterpreter interpreter)
     : base(interpreter)
 {
 }
Example #11
0
 public WordListInputControl(AgiInterpreter interpreter)
     : base(interpreter)
 {
 }
Example #12
0
 public InventoryControl(AgiInterpreter interpreter)
 {
     this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
 }
Example #13
0
 public TextBoxControl(AgiInterpreter interpreter)
 {
     this.Interpreter   = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.Text          = string.Empty;
     this.MaxTextLength = 10;
 }
Example #14
0
 protected InputControl(AgiInterpreter interpreter)
 {
     this.Interpreter   = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.Input         = string.Empty;
     this.InputPrevious = string.Empty;
 }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScriptManager"/> class.
 /// </summary>
 /// <param name="interpreter">Interpreter.</param>
 /// <param name="error">Error handler.</param>
 public ScriptManager(AgiInterpreter interpreter, AgiError error)
 {
     this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.Error       = error ?? throw new ArgumentNullException(nameof(error));
 }
Example #16
0
 public void CreateKernel()
 {
     this.interpreter = new AgiInterpreter(null, null, null);
     this.interpreter.CreateState();
     this.kernel = this.interpreter;
 }
Example #17
0
 public ClassicInputControl(AgiInterpreter interpreter)
     : base(interpreter)
 {
 }
Example #18
0
 public SavedGameManager(AgiInterpreter interpreter, ISavedGameSerializer gameSerializer)
 {
     this.Interpreter    = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.GameSerializer = gameSerializer ?? throw new ArgumentNullException(nameof(gameSerializer));
     this.AutoSaveName   = string.Empty;
 }
 public SaveRestoreFolderBrowseControl(AgiInterpreter interpreter)
 {
     this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.Title       = string.Empty;
     this.FolderPath  = string.Empty;
 }
Example #20
0
 public TraceControl(AgiInterpreter interpreter)
 {
     this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.TraceState  = TraceState.Uninitialized;
 }
Example #21
0
 public GameSelectionControl(AgiInterpreter interpreter)
 {
     this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
 }
Example #22
0
 public StatusLineControl(AgiInterpreter interpreter)
 {
     this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
 }
 void ISoundPcmDriver.SetInterpreter(AgiInterpreter interpreter)
 {
     this.interpreter = interpreter;
 }
Example #24
0
 public PromptControl(AgiInterpreter interpreter)
 {
     this.Interpreter = interpreter ?? throw new ArgumentNullException(nameof(interpreter));
     this.Text        = string.Empty;
 }
Example #25
0
 public void SetInterpreter(AgiInterpreter interpreter)
 {
     this.interpreter = interpreter;
     this.pcmDriver.SetInterpreter(interpreter);
 }