/// <summary>
        /// Creates a MainViewModel and needed Models for it.
        /// </summary>
        /// <returns></returns>
        public MainViewModel Load()
        {
            // build models
            var memory = new Memory();

            var interpreter       = new Interpreter();
            var Parser            = new Parser(memory);
            var bitCommands       = new BitCommands(memory);
            var byteCommands      = new ByteCommands(memory);
            var literalCommands   = new LiteralCommands(memory);
            var commandSet        = new CommandSet(bitCommands, literalCommands, byteCommands);
            var operationSelector = new OperationSelector(commandSet);
            var controlUnit       = new ControlUnit(interpreter, operationSelector, memory);

            return(new MainViewModel(/* inject models for easier testing*/ memory, controlUnit, Parser));
        }
示例#2
0
 public CommandSet(BitCommands bitCommands, LiteralCommands literalCommands, ByteCommands byteCommands)
 {
     _bitCommands     = bitCommands;
     _literalCommands = literalCommands;
     _byteCommands    = byteCommands;
 }