Beispiel #1
0
        private void UpdateWallConnectorsInSelection(bool alreadyLifted)
        {
            if (this.buildingSelector.AdditionalSelectedBuildings.Count == 0)
            {
                return;
            }
            WallConnector wallConnector = Service.EntityViewManager.WallConnector;

            wallConnector.ConnectWallsInExclusiveSet(new List <SmartEntity>(this.buildingSelector.AdditionalSelectedBuildings)
            {
                this.buildingSelector.SelectedBuilding
            }, alreadyLifted);
        }
Beispiel #2
0
        public void SelectAdjacentWalls(SmartEntity building)
        {
            WallConnector      wallConnector = Service.EntityViewManager.WallConnector;
            List <SmartEntity> wallChains    = wallConnector.GetWallChains(building, -1, 0);
            List <SmartEntity> wallChains2   = wallConnector.GetWallChains(building, 1, 0);
            List <SmartEntity> wallChains3   = wallConnector.GetWallChains(building, 0, -1);
            List <SmartEntity> wallChains4   = wallConnector.GetWallChains(building, 0, 1);
            List <SmartEntity> list          = new List <SmartEntity>();

            if (wallChains.Count + wallChains2.Count > wallChains3.Count + wallChains4.Count)
            {
                list.AddRange(wallChains);
                list.AddRange(wallChains2);
            }
            else
            {
                list.AddRange(wallChains4);
                list.AddRange(wallChains3);
            }
            for (int i = 0; i < list.Count; i++)
            {
                this.AddBuildingToSelection(list[i]);
            }
        }