コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: Animal.cs プロジェクト: alex-fomin/Game
        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);
        }