public void SetEditing(bool editing, bool animated) { foreach (var cell in VisibleCells.Where(x => x is IEditable).Cast <IEditable>()) { cell.SetEditing(editing, animated); } _isEditing = editing; }
private void LookForFoodOrMove() { _stateQueue.Clear(); var destination = PositionCell; if (LookForFood()) { return; } var passable = VisibleCells .Where(x => Game.Map.GetObjectFromCell(x)?.IsPassable ?? true) .ToList(); if (passable.Any()) { destination = passable[Game.Random.Next(passable.Count)]; } EnqueueMovingToDestination(destination); }