public void AddVillage(int villageId, int[] connectedToVillages)
        {
            Village village = GetOrCreateVillage(villageId);

            foreach (Village connectToVillage in connectedToVillages.Select(GetOrCreateVillage))
            {
                village.AddPipeConnection(connectToVillage);
            }
        }
Esempio n. 2
0
        public void AddPipeConnection(Village toVillage)
        {
            if (!ContainsConnectedVillage(toVillage))
            {
                ConnectedToVillages.Add(toVillage.Id, toVillage);
            }

            if (!toVillage.ContainsConnectedVillage(this))
            {
                toVillage.AddPipeConnection(this);
            }
        }