|
Britbot
|
00001 using System; 00002 using System.Collections.Generic; 00003 using System.Linq; 00004 using System.Text; 00005 using System.Threading.Tasks; 00006 00007 namespace Britbot 00008 { 00009 internal class ZoneConfigs 00010 { 00011 public int Capacity { get; private set; } 00012 public List<int> Groups { get; private set; } 00013 00014 public ZoneConfigs(int capacity) 00015 { 00016 this.Capacity = capacity; 00017 this.Groups = new List<int>(); 00018 } 00019 00020 public void AddGroup(int count) 00021 { 00022 if (this.Capacity >= count) 00023 { 00024 this.Capacity -= count; 00025 this.Groups.Add(count); 00026 } 00027 else 00028 { 00029 throw new Exception("Not enough space in the zone"); 00030 } 00031 } 00032 } 00033 }
1.7.6.1