public Critter[] GetSelection(int row, int col, int width, int height) { Critter[] selected = new Critter[width * height]; int i = 0; for (int c = col; c < col + width; c++) { for (int r = row; r < row + height; r++) { if (grid[r, c] != null) { selected[i] = grid[r, c]; grid[r, c] = null; } i++; } } return selected; }
public void RemovePlagued(Critter c) { string ct = c.GetType().Name; if (ct == "Female") { mFemales.Remove(c); } if (ct == "Doctor") { mDoctors.Remove(c); } if (ct == "Male") { mMales.Remove(c); } }
public void MoveCritters(Critter[] critters) { for (int i = 0; i < critters.Length; i++) { if (critters[i] != null) { Critter c = critters[i]; grid[c.GetRow(), c.GetCol()] = c; } } }