public string ReactorCommand(IList <string> arguments)
        {
            string reactorType         = arguments[0];
            int    additionalParameter = int.Parse(arguments[1]);
            int    moduleCapacity      = int.Parse(arguments[2]);

            IContainer container = new ModuleContainer(moduleCapacity);

            IReactor reactor = null;

            switch (reactorType)
            {
            case "Cryo":
                //reactor = new CryoReactor(this.currentId, container, additionalParameter);
                reactor = reactorFactory.CreateReactor(reactorType, this.currentId, container, additionalParameter);
                break;

            case "Heat":
                //reactor = new HeatReactor(this.currentId, container, additionalParameter);
                reactor = reactorFactory.CreateReactor(reactorType, this.currentId, container, additionalParameter);
                break;
            }

            this.currentId++;

            this.reactors.Add(reactor.Id, reactor);
            this.identifiableObjects.Add(reactor.Id, reactor);

            string result = string.Format(Constants.ReactorCreateMessage, reactorType, reactor.Id);

            return(result);
        }
Esempio n. 2
0
        public string ReactorCommand(IList <string> arguments)
        {
            string reactorType         = arguments[0];
            int    additionalParameter = int.Parse(arguments[1]);
            int    moduleCapacity      = int.Parse(arguments[2]);

            IContainer container = new ModuleContainer(moduleCapacity);

            IReactor reactor = reactorFactory.CreateReactor(reactorType, currentId++, container, additionalParameter);

            this.reactors.Add(reactor.Id, reactor);


            string result = string.Format(Constants.ReactorCreateMessage, reactor.Id, reactorType);

            return(result);
        }