예제 #1
0
        public void RegenerateValidatedPaths(LocatedItem <TEntity> locatedItem)
        {
            Guard.NotNull(locatedItem, $"Null item found!");

            var paths = _pathsValidator.GetValidatedPaths(this, locatedItem.Item, locatedItem.Location);

            locatedItem.UpdatePaths(paths);
        }
예제 #2
0
 public void PlaceEntity(BoardLocation loc, TEntity entity)
 => _items[loc] = new LocatedItem <TEntity>(loc, entity, null);
예제 #3
0
 public static BoardMove FindMoveTo <TEntity>(this LocatedItem <TEntity> item, BoardLocation destination)
     where TEntity : class, IBoardEntity
 {
     return(item.Paths.FlattenMoves()
            .SingleOrDefault(m => m.To.Equals(destination)));
 }