Esempio n. 1
0
        private static ObservableCollection <string> GetByType(BuildingComponentType type, string prefix)
        {
            var oc    = new ObservableCollection <string>();
            var count = NodesCreationData.Count(n => n.Type == type);

            for (int i = 1; i <= count; i++)
            {
                oc.Add($"{prefix}{i}");
            }

            return(oc);
        }
        private void BuildingComponent_Click(object sender, RoutedEventArgs e)
        {
            var componentName = (sender as Button)?.Name;

            if (componentName == null)
            {
                return;
            }

            _currentBuildingComponentType  = (BuildingComponentType)Enum.Parse(typeof(BuildingComponentType), componentName, true);
            _currentBuildingComponentImage = BuildingComponentsHelper.GetBuildingComponentImage(_currentBuildingComponentType);

            buildingComponentClicked(_currentBuildingComponentType);
        }
Esempio n. 3
0
 public MultipleCellComponent(BuildingComponentType type, (int, int) cell) : base(type, cell)
 public SingleCellBuildingComponent(BuildingComponentType type, (int, int) cell)
 protected GenericBuildingComponent(BuildingComponentType type, (int, int) cell) : base(cell)
 public GenericBuildingComponent CreateComponent(BuildingComponentType type, (int, int) cell)
 public static BitmapImage GetBuildingComponentImage(BuildingComponentType type) =>
 GetComponentImage(_buildingComponentsImages[type]);
 public static List <BuildingComponentType> GetAllowedComponents(BuildingComponentType predecessorType)
 {
     return(_allowedSingleCellComponentsPerComponent[predecessorType]);
 }