Ejemplo n.º 1
0
        public Tile(ICase tile, TileFactory tileFactory, List<Unite> listUnite, SolidColorBrush playerBrush)
        {
            InitializeComponent();
            this.tile = tile;
            this.nbUnite = listUnite.Count;
            VisualBrush myBrush = new VisualBrush();
            aPanel = new Grid();

            aPanel.Background = tileFactory.getViewTile(tile);

            // Create some text.
            TextBlock backText = new TextBlock();
            Canvas.SetZIndex(backText, 3);
            if (listUnite != null && listUnite.Count > 0)
            {
                backText.Text = " " + listUnite.Count.ToString() + " ";
                backText.Background = (SolidColorBrush)new BrushConverter().ConvertFromString(listUnite[0].Proprietaire.Couleur);
                backText.Foreground = Brushes.White;
            }
            FontSizeConverter fSizeConverter = new FontSizeConverter();
            backText.FontSize = (double)fSizeConverter.ConvertFromString("10pt");
            backText.Margin = new Thickness(10);
            Grid.SetColumn(backText, 0);
            Grid.SetRow(backText, 0);
            DropShadowEffect myDropShadowEffect  = new DropShadowEffect();
            myDropShadowEffect.BlurRadius = 1;
            myDropShadowEffect.Color = Color.FromRgb(0,0,0);
            myDropShadowEffect.ShadowDepth = 2;
            backText.Effect=myDropShadowEffect;
            aPanel.Children.Add(backText);
            myBrush.Visual = aPanel;
            rect.Fill = myBrush;
            rect1.Stroke = playerBrush;
        }
Ejemplo n.º 2
0
 public EditeurCarte()
 {
     InitializeComponent();
     tileFactory = new ImageFactory();
     terrain = 0;
     release = true;
     saved = true;
     neverSaved = true;
     filename = "carteSmallWorld.card";
     remplirCombo();
     affichePalette();
     nouvelleCarte();
 }
Ejemplo n.º 3
0
 public MainWindow()
 {
     InitializeComponent();
     allowedMouv = new SuggMap();
     sugg = new Suggestion();
     listUnitSelected = new List<Unite>();
     tileFactory = new ImageFactory();
     _pool = new Semaphore(0, 1);
     _poolInit = new Semaphore(0, 1);
     selectionRectangle = new SelectedRect();
     selectionRectangle.Visibility = Visibility.Collapsed;
     filename = "saveSmallWorld";
     saved = true;
     neverSaved = true;
 }
Ejemplo n.º 4
0
        private void tropical_Click(object sender, RoutedEventArgs e)
        {
            tileFactory = new ImageFactory("tropical");
            styleUncheck();
            tropical.IsChecked = true;

            if (partie != null && partie.Carte != null)
                afficheCarte();
            actualiseData();
            e.Handled = true;
        }
Ejemplo n.º 5
0
        private void noStyle_Click(object sender, RoutedEventArgs e)
        {
            tileFactory = new RectangleFactory();
            styleUncheck();
            noStyle.IsChecked = true;

            if (partie != null && partie.Carte != null)
                afficheCarte();
            actualiseData();
            e.Handled = true;
        }
Ejemplo n.º 6
0
 private void affTileCheckbox_Click(object sender, RoutedEventArgs e)
 {
     if (affTileCheckbox.IsChecked)
     {
         tileFactory = new ImageFactory();
     }
     else
     {
         tileFactory = new RectangleFactory();
     }
     if (partie != null && partie.Carte != null)
         afficheCarte();
     e.Handled = true;
 }
Ejemplo n.º 7
0
        private void tropical_Click(object sender, RoutedEventArgs e)
        {
            tileFactory = new ImageFactory("tropical");
            styleUncheck();
            tropical.IsChecked = true;

            affichePalette();
            if (monteur != null && monteur.Carte != null)
                afficheCarte();
            e.Handled = true;
        }
Ejemplo n.º 8
0
        private void noStyle_Click(object sender, RoutedEventArgs e)
        {
            tileFactory = new RectangleFactory();
            styleUncheck();
            noStyle.IsChecked = true;

            affichePalette();
            if (monteur != null && monteur.Carte != null)
                afficheCarte();
            e.Handled = true;
        }