public void RegisterSoftwareComponent(SoftwareComponent component) { string componentName = component.Name; string componentType = component.Type; this.softwareComonents.Add(componentName, component); this.CountTypes(componentType, 1); }
public void RegisterSoftware(string hardwareName, SoftwareComponent software) { string softwareName = software.Name; if (this.hardwareComponents.ContainsKey(hardwareName)) { if (this.hardwareComponents[hardwareName].HasCapacityAndMemoryForGivenSoftware(software)) { this.hardwareComponents[hardwareName].RegisterSoftwareComponent(software); } } }
public bool HasCapacityAndMemoryForGivenSoftware(SoftwareComponent software) { return this.AvailableCapacity >= software.Capacity && this.AvailableMemory >= software.Memory; }