public bool Contain(GridCell gCell) { if (gCell == null) { return(false); } return(Cells.Contains(gCell)); }
private void CheckMissedColumns(Table table) { var missed = table.Columns.Required.Where(col => !Cells.Contains(col.Name)); if (missed.Any()) { throw new MissedCellsException(missed, Resources.RequiredCellsMissed.FormatExt(table.Name)); } }
public IEnumerable <Fighter> GetAffecteds(Fight fight) { foreach (var fighter in fight.GetAllFighters()) { if (Cells.Contains(fighter.CellId)) { yield return(fighter); } } }
public IEnumerable <Cell> GetCellsVisibleTo(Cell cell) { if (Cells.Contains(cell)) { return(Cells.Where(other => other != cell)); } else { return(Enumerable.Empty <Cell>()); } }
public void AfterMove(Fighter source, object arg1, object arg2, object arg3) { List <short> path = (List <short>)arg2; foreach (var cell in path) { if (Cells.Contains(cell)) { Explode(source); break; } } }
public Cell NextCell(Cell cell) { if (Cells.Contains(cell) == false) { return(null); } int index = Cells.IndexOf(cell); if (index + 1 < Cells.Count) { return(Cells [index + 1]); } return(null); }
public Cell PreviousCell(Cell cell) { if (Cells.Contains(cell) == false) { return(null); } int index = Cells.IndexOf(cell); if (index - 1 >= 0) { return(Cells [index - 1]); } return(null); }
/// <summary> /// Fusion the specified other path. /// </summary> /// <param name="otherPath">Other path.</param> public void Fusion(Path otherPath) { // The otherPath is the loser // We transfer its data // Then we kill it // Dequeue cells for (int i = otherPath.Cells.Count - 1; i >= 0; i--) { Cell cell = otherPath.Cells [i]; if (Cells.Contains(cell) == false) { AddCell(cell); } } otherPath.Cells.Clear(); }
public Grid Next(IEnumerable <IRule> rules) { var newCells = new List <Point>(); for (var x = 0; x < Size; x++) { for (var y = 0; y < Size; y++) { var point = new Point(x, y); var lives = rules.Any(r => r.Apply(point, Cells.Contains(point), point.LivingNeighbors(Cells))); if (lives) { newCells.Add(point); } } } return(new Grid(newCells, Size)); }
public bool CanBuildTowerIn(TowerCell towerCell, ITower tower, int cost) => Cells.Contains(towerCell) && (towerCell?.Buildable ?? false) && cost <= Gold;
public bool Contains(ITableCellViewModel cell) { return(Cells.Contains(cell)); }
/// <summary> /// Determines if the file contains a Cell /// </summary> /// <param name="item">Cell to check for</param> /// <returns>True if it does, false otherwise</returns> public bool Contains(Cell item) { return(Cells.Contains(item)); }