Ejemplo n.º 1
0
 public IEnumerable <UsePortal> GetAvailablePortalActions(LocationId atLocationId, Models.World world)
 {
     foreach (var paths in AvailablePathsFactory.GetAvailablePaths(atLocationId, world))
     {
         foreach (var path in paths)
         {
             if (path.Type == Models.PathType.Portal)
             {
                 yield return(new UsePortal(path.Id));
             }
         }
     }
 }
Ejemplo n.º 2
0
        public IEnumerable <Move> GetAvailableMovementActions(LocationId atLocationId, Models.World world)
        {
            foreach (var paths in AvailablePathsFactory.GetAvailablePaths(atLocationId, world))
            {
                var pathDistance = 1;
                foreach (var path in paths)
                {
                    if (path.Type == Models.PathType.West ||
                        path.Type == Models.PathType.East ||
                        path.Type == Models.PathType.North ||
                        path.Type == Models.PathType.South)
                    {
                        yield return(new Move(Convert(path.Type), pathDistance));
                    }

                    pathDistance++;
                }
            }
        }