/// <summary> /// Construit une case pour le canvas, et affiche l nombre d'unités présente sur la case /// </summary> /// <param name="c">la colonne</param> /// <param name="l">la ligne</param> /// <param name="tile">la case</param> /// <param name="listUnite">la liste d'unités présentent</param> /// <returns></returns> private Tile creerTile(int c, int l, ICase tile, List<Unite> listUnite) { var rectangle = new Tile(tile, tileFactory, listUnite, (SolidColorBrush)new BrushConverter().ConvertFromString(partie.joueurActuel().Couleur)); Canvas.SetLeft(rectangle, c * 50); Canvas.SetTop(rectangle, l * 50); Canvas.SetZIndex(rectangle,1); rectangle.MouseLeftButtonDown += new MouseButtonEventHandler(Rectangle_MouseDown); return rectangle; }
private Tile creerTile(int c, int l, ICase tile, List<Unite> listUnite) { var rectangle = new Tile(tile, tileFactory, listUnite, Brushes.White); Canvas.SetLeft(rectangle, c * 50); Canvas.SetTop(rectangle, l * 50); Canvas.SetZIndex(rectangle, 5); rectangle.MouseLeftButtonDown += new MouseButtonEventHandler(Rectangle_MouseDown); rectangle.MouseMove += new MouseEventHandler(Rectangle_MouseMove); rectangle.MouseLeftButtonUp += new MouseButtonEventHandler(Map_MouseUp); scrollMap.MouseLeave += new MouseEventHandler(ScrollMap_MouseLeave); scrollMap.MouseLeftButtonUp += new MouseButtonEventHandler(Map_MouseUp); return rectangle; }