Esempio n. 1
0
 public bool CanMoveTo(Vector2Int position)
 {
     try {
         MapTile tile = GetTile(position);
         if (tile == null)
         {
             return(false);
         }
         bool          walkable = tile.walkable;
         List <Entity> entities = turnHandler.GetEntitiesAtPosition(position);
         bool          free     = true;
         foreach (Entity entity in entities)
         {
             free &= entity.overlappable;
         }
         return(walkable && free);
     }
     catch (System.IndexOutOfRangeException) {
         return(false);
     }
 }