예제 #1
0
파일: base.ctor.cs 프로젝트: yielding/code
 public static DBFile Create(path)
 {
     // var s = new File.OpenRead(path);
     var s = new MemoryStream();
     s.Write();
     return new DBFile(s);
 }
예제 #2
0
 var(path, pathWithPrefix) = CreateLongTempFolder(asNetwork: in asNetwork);
예제 #3
0
 static void Main(string[] args)
 {
     path
         DirectoryInfo =
         FileInfo
 }
예제 #4
0
 foreach (var(path, types) in importedTypes)
예제 #5
0
 IsDirectorySeparator(path[basePath.Length])) &&
예제 #6
0
파일: Factory.cs 프로젝트: TjcJose/Hi
 return (I$ClassName$)Assembly.Load(path).CreateInstance(className);
예제 #7
0
파일: Sdk.cs 프로젝트: Roman-Blinkov/minver
 var(packages, standardOutput, standardError) = await Build(path, envVars).ConfigureAwait(false);
예제 #8
0
 5 => FileList(path, SortFilesBy.Lastwritetime),
예제 #9
0
 6 => FileList(path, SortFilesBy.Random),
예제 #10
0
 3 => FileList(path, SortFilesBy.Extension),
예제 #11
0
 4 => FileList(path, SortFilesBy.Lastaccesstime),
예제 #12
0
 2 => FileList(path, SortFilesBy.Creationtime),
예제 #13
0
 1 => FileList(path, SortFilesBy.FileSize),
예제 #14
0
파일: Move.cs 프로젝트: Wolfie13/RTSAI
	public Move(IVec2 source, IVec2 destination)
	{
		path = (new AStar ()).GetPath (source, destination);
	}
예제 #15
0
 var(path, pathWithPrefix) = CreateLongTempFolder(asNetwork: in asNetwork, withSlash: withSlash);
예제 #16
0
 _ => FileList(path, SortFilesBy.Name),
예제 #17
0
 var(path, pathWithPrefix) = CreateLongTempFile(true, in asNetwork);
예제 #18
0
    //Creates corridors from room to room,and returns the list of corridors. (Rooms tiles are not included in corridors).
    private static List <TileData> defaultConnect(int seed, ref TileData[,] tiles, ref List <Room> rooms)
    {
        //Generate the weight map for A*.
        int[,] weights = generateWeight(seed, tiles);

        List <TileData> corridors = new List <TileData>();

        //Connect first Room to all others.
        for (int i = 1; i < rooms.Count; i++)
        {
            //Get starting point. (middle of start Room)
            Point start = rooms[0].getTopRight();
            start = new Point(start.x - rooms[0].length / 2, start.y - rooms[0].height / 2);

            //Get ending point. (middle of other Room)
            Point end = rooms[i].getTopRight();
            end = new Point(end.x - rooms[i].length / 2, end.y - rooms[i].height / 2);

            //Plan:
            //Add starting point to Open List.
            //Sort Open list by F value, which is the distance from the end (found by heuristic) + currentCost.
            //While Open List is NOT empty
            //Get next Point to calculate, and put it on closed list.
            //foreach neighbor to this nextPoint
            //If neighbor point is the final point, make connections and break.
            //If neighbor point is not walkable, continue.
            //If neighbor point is NOT on the open List, calc ALL it's moveCost values F,G,H, and set the next Point
            //as it's cameFrom point.
            //If neighbor point is ON the open List (and maybe the closed),
            //if this REALcost (G, not heuristic) from this nextPoint is better than
            //the one it already has, replace its cameFrom with next point, and re-calc its F,G,H

            //OpenList sorted by F values.
            PriorityQueue <int, path> openList = new PriorityQueue <int, path>();

            pathMap map = new pathMap(tiles.GetLength(0), tiles.GetLength(1));

            path startPath = map.getPath(start);
            startPath.cameFrom = null;    //Starting point came From null. (this is a flag for later)
            startPath.openList = true;
            startPath.setValues(0, 0, 0); //Start point doesn't need values.

            openList.Enqueue(0, startPath);

            bool isFinished = false;

            while (!openList.IsEmpty && !isFinished)
            {
                path next = openList.DequeueValue();
                next.closedList = true;

                foreach (path neighbor in next.getNeighbors())
                {
                    if (neighbor.position.Equals(end))
                    {
                        //Do ending stuff!
                        isFinished = true;

                        neighbor.cameFrom = next;

                        //Start function to get the path, and put the path into corridors, and put the corridors on the tile map.
                        corridors.AddRange(getFinishedPath(neighbor, ref tiles));

                        break;
                    }

                    //If not walkable, then check for that here. (currently not possible)

                    if (!neighbor.openList)
                    {
                        //PUT on open List.
                        neighbor.openList = true;

                        neighbor.cameFrom = next;
                        neighbor.setValues(next.cost + weights[neighbor.position.x, neighbor.position.y], neighbor.position.tileDiff(end));

                        openList.Enqueue(neighbor.probableCost, neighbor);
                    }
                    else if (!neighbor.closedList)
                    {
                        //Compare its current values, and change em if need be.
                        int newCost = next.cost + weights[neighbor.position.x, neighbor.position.y];
                        if (newCost < neighbor.cost)
                        {
                            //May not actually work...
                            KeyValuePair <int, path> oldPair = new KeyValuePair <int, path>(neighbor.probableCost, neighbor);

                            openList.Remove(oldPair);
                            neighbor.setValues(newCost, neighbor.position.tileDiff(end));

                            openList.Enqueue(neighbor.probableCost, neighbor);
                        }
                    }
                }
            } //End of While Loop
        }     //End of For Loop

        return(corridors);
    }
예제 #19
0
파일: AStar.cs 프로젝트: Wolfie13/RTSAI
    public path GetPath(IVec2 MapPosStart, IVec2 MapPosEnd)
    {
        List<Node> result = new List<Node>();

        List<AStarNodes> openQueue = new List<AStarNodes>();
        
        List<AStarNodes> CloseList = new List<AStarNodes>();

        AStarNodes startNode = new AStarNodes();
        Node EndNode = null;

        startNode.NodeInfo = new Node();
        startNode.NodeInfo.MapPos = MapPosStart;
        startNode.NodeInfo.MapSymbol = Map.CurrentMap.getTile(MapPosStart.x, MapPosStart.y);
        startNode.DistanceGone = 0;
        startNode.Distance2Go = GetDirectDistance2End(MapPosStart, MapPosEnd);
        openQueue.Add(startNode);
        CloseList.Add(startNode);

        while (openQueue.Count > 0)
        {
            var currentNode = openQueue[0];

            openQueue.RemoveAt(0);

			if(currentNode.NodeInfo.MapPos == MapPosEnd)
            {
                EndNode = currentNode.NodeInfo;
                break;
            }

			var newNodes = GetNextPositions(currentNode, MapPosEnd);

            foreach (var item in newNodes)
            {
                if (isValid(item, ref CloseList))
                {
                    openQueue.Add(item);
                    CloseList.Add(item);
                }
            }


            openQueue.Sort((AStarNodes a, AStarNodes b) => (a.Distance2Go + a.DistanceGone).CompareTo(b.Distance2Go + b.DistanceGone));

        }

        while(EndNode != null)
        {
            if(EndNode.PrevNode != null)
                EndNode.PrevNode.NextNode = EndNode;

            result.Insert(0, EndNode);
            
            EndNode = EndNode.PrevNode;
        }

//        Debug.Log("AStarStopped path size: " + result.Count);

        //output
        {
            path theWay = new path();
            theWay.FoundPath = result;
            theWay.isPathFound = result.Count > 0;
			return theWay;
        }
    }
예제 #20
0
파일: Create.cs 프로젝트: chessar/LongPaths
 var(path, _) = CreateLongTempFolder(asNetwork: in asNetwork);
 await System.IO.File.AppendAllTextAsync(path, contents).ConfigureAwait(false);
예제 #22
0
 var(path, pathWithPrefix) = isFolder
예제 #23
0
파일: Delete.cs 프로젝트: chessar/LongPaths
 var(path, pathWithPrefix) = CreateLongTempFile(asNetwork: in asNetwork, withSlash: in withSlash);
예제 #24
0
 => InnerTask = GetDeserializationTask(path, defaultValue);
 _stream = new FileStream(path, FileMode.Open);
예제 #26
0
 select(path, mapped);
예제 #27
0
        //<summary>
        //Open an image and load it into 2D array of colors (size: Height x Width)
        //</summary>
        /// <param name="ImagePath">Image file path</param>
        /// <returns>2D array of colors</returns>
        public static RGBPixel[,] OpenImage(string ImagePath)
        {
            Bitmap original_bm = new Bitmap(ImagePath);
            int    Height      = original_bm.Height;
            int    Width       = original_bm.Width;

            RGBPixel[,] Buffer = new RGBPixel[Height, Width];

            unsafe
            {
                BitmapData bmd = original_bm.LockBits(new Rectangle(0, 0, Width, Height), ImageLockMode.ReadWrite, original_bm.PixelFormat);
                int        x, y;
                int        nWidth   = 0;
                bool       Format32 = false;
                bool       Format24 = false;
                bool       Format8  = false;

                if (original_bm.PixelFormat == PixelFormat.Format24bppRgb)
                {
                    Format24 = true;
                    nWidth   = Width * 3;
                }
                else if (original_bm.PixelFormat == PixelFormat.Format32bppArgb || original_bm.PixelFormat == PixelFormat.Format32bppRgb || original_bm.PixelFormat == PixelFormat.Format32bppPArgb)
                {
                    Format32 = true;
                    nWidth   = Width * 4;
                }
                else if (original_bm.PixelFormat == PixelFormat.Format8bppIndexed)
                {
                    Format8 = true;
                    nWidth  = Width;
                }
                int   nOffset = bmd.Stride - nWidth;
                byte *p       = (byte *)bmd.Scan0;
                for (y = 0; y < Height; y++)
                {
                    for (x = 0; x < Width; x++)
                    {
                        if (Format8)
                        {
                            Buffer[y, x].red = Buffer[y, x].green = Buffer[y, x].blue = p[0];
                            p++;
                        }
                        else
                        {
                            Buffer[y, x].red   = p[2];
                            Buffer[y, x].green = p[1];
                            Buffer[y, x].blue  = p[0];
                            if (Format24)
                            {
                                p += 3;
                            }
                            else if (Format32)
                            {
                                p += 4;
                            }
                        }
                    }
                    p += nOffset;
                }
                original_bm.UnlockBits(bmd);
            }

            return(Buffer);
        }
예제 #28
0
 set => Update(path, value);
예제 #29
0
 /**
  * Make publicpreview_icon available as a simple function
  * Returns the path to the preview of the image.
  *
  * @param string path of file
  * @param string token
  * @return string link to the preview
  * @since 8.0.0
  * @suppress PhanDeprecatedFunction
  */
 public static function publicPreview_icon(path, token)
 {
     return(\ publicPreview_icon(path, token));
 }
예제 #30
0
 var(path, pathWithPrefix) = CreateLongTempFile(!append, in asNetwork);
예제 #31
0
 var(path, _) = CreateLongTempFolder(asNetwork: in asNetwork, withSlash: in withSlash);
예제 #32
0
 var filesWithSuffix = allFiles.Select(path => (path, suffix: suffixFormatter.TryParseSuffix(ExtractSuffixValue(path, basePath, suffixSeparator))));
예제 #33
0
 public web_key(path p, key e)
 {
     this.path = p; this.key = e; this.id_element = this.key.id;
 }
예제 #34
0
 /// <summary>
 /// <see cref="PrivateProfile"/> クラスの新しいインスタンスを初期化して、指定された INI ファイルを読み取り専用で開きます。
 /// </summary>
 /// <param name="path">
 /// INI ファイルのパス
 /// </param>
 /// <param name="readOnly">
 /// INI ファイルを読み取り専用で開くときに <c>true</c> を指定します。
 /// </param>
 /// <param name="ignoreDuplicatedEntry">
 /// <inheritdoc cref="PrivateProfile(bool)"/>
 /// </param>
 /// <exception cref="InvalidOperationException">
 /// 既にファイルが開かれている状態で、書き込み用にファイルを開こうとしました。
 /// </exception>
 public PrivateProfile(string path, bool readOnly = true, bool ignoreDuplicatedEntry = false) : this(ignoreDuplicatedEntry) => this.Read(path, readOnly);
예제 #35
0
 var request = PrepareHammockQuery(path);
        public SimulationDeJeux(path)
        {

        }