public string ModuleCommand(IList <string> arguments) { int reactorId = int.Parse(arguments[0]); string moduleType = arguments[1]; int additionalParameter = int.Parse(arguments[2]); string moduleName = string.Empty; switch (moduleType) { case "CryogenRod": IEnergyModule cryogenRod = new CryogenRod(this.currentId, additionalParameter); moduleName = cryogenRod.GetType().Name; this.reactors[reactorId].AddEnergyModule(cryogenRod); this.identifiableObjects.Add(cryogenRod.Id, cryogenRod); this.modules.Add(cryogenRod.Id, cryogenRod); break; case "HeatProcessor": IAbsorbingModule heatProcessor = new HeatProcessor(this.currentId, additionalParameter); moduleName = heatProcessor.GetType().Name; this.reactors[reactorId].AddAbsorbingModule(heatProcessor); this.identifiableObjects.Add(heatProcessor.Id, heatProcessor); this.modules.Add(heatProcessor.Id, heatProcessor); break; case "CooldownSystem": IAbsorbingModule cooldownSystem = new CooldownSystem(this.currentId, additionalParameter); moduleName = cooldownSystem.GetType().Name; this.reactors[reactorId].AddAbsorbingModule(cooldownSystem); this.identifiableObjects.Add(cooldownSystem.Id, cooldownSystem); this.modules.Add(cooldownSystem.Id, cooldownSystem); break; } string result = string.Format(Constants.ModuleCreateMessage, moduleName, this.currentId++, reactorId); return(result); }