private void drawCase(Coordonnee c, Brush couleur, double opacity, DrawingContext dc) { int x = c.getX(); int y = c.getY(); Brush sugg = couleur; sugg.Opacity = opacity; dc.DrawRectangle(sugg, null, new Rect((x - 1) * imgSize, (y - 1) * imgSize, imgSize, imgSize)); }
public bool bordEau(Coordonnee coords) { return ((coords.getX() > 1 && getCase(coords.decaler(-1, 0)).getTypeCase() == TypeCases.EAU) || (coords.getY() > 1 && getCase(coords.decaler(0, -1)).getTypeCase() == TypeCases.EAU) || (coords.getX() < taille && getCase(coords.decaler(1, 0)).getTypeCase() == TypeCases.EAU) || (coords.getY() < taille && getCase(coords.decaler(0, 1)).getTypeCase() == TypeCases.EAU)); }
public void clone(Coordonnee coords) { X = coords.getX(); Y = coords.getY(); }
public Case getCase(Coordonnee coord) { int type = grid[coord.getX() - 1, coord.getY() - 1]; switch (type) { case (int)TypeCases.DESERT: return FabriqueCase.obtenirCase(TypeCases.DESERT); case (int)TypeCases.EAU: return FabriqueCase.obtenirCase(TypeCases.EAU); case (int)TypeCases.FORET: return FabriqueCase.obtenirCase(TypeCases.FORET); case (int)TypeCases.MONTAGNE: return FabriqueCase.obtenirCase(TypeCases.MONTAGNE); case (int)TypeCases.VORTEX: return FabriqueCase.obtenirCase(TypeCases.VORTEX); case (int)TypeCases.PLAINE: default: return FabriqueCase.obtenirCase(TypeCases.PLAINE); } }