public Plateau(int[] parametres, Grid _inGPlateau) { _matrice = new Case[parametres[1], parametres[0]]; _nbRow = parametres[1]; _nbColumn = parametres[0]; for (int i = 0; i < _nbRow; i++) for (int j = 0; j < _nbColumn; j++) _matrice[i, j] = new Case(i, j); _acteurs = new List<Entite>(); _listGrp = new List<Groupe>(); _gPlateau = _inGPlateau; InitActeurs(parametres); }
public void DeplacerActeur(Entite inI, Case inC) { if (inI.MyCase != null) inI.MyCase.Empty(); inI.MyCase = inC; _matrice[inC.Row, inC.Column].Acteur=inI; }
public List<Case> GetCasesAdjacentes(Case inC) { List<Case> cases = new List<Case>(); if (inC.Row > 0) cases.Add(_matrice[inC.Row - 1, inC.Column]); if (inC.Row < _nbRow - 1) cases.Add(_matrice[inC.Row + 1, inC.Column]); if (inC.Column > 0) cases.Add(_matrice[inC.Row, inC.Column - 1]); if (inC.Column < _nbColumn - 1) cases.Add(_matrice[inC.Row, inC.Column + 1]); return cases; }