This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Node : IComparable<Node> | |
| { | |
| public int H | |
| { | |
| get | |
| { | |
| return Math.Abs(X - TargetNode.Position.X) + | |
| Math.Abs(Y - TargetNode.Position.Y); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AStar | |
| { | |
| private static bool InBounds(int x, int y, bool[,] map) | |
| { | |
| if (x >= 0 && y >= 0 && y < map.GetLength(0) && x < map.GetLength(1)) | |
| return true; | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma warning disable 0618 | |
| using System; | |
| using System.Text; | |
| using System.Runtime.InteropServices; | |
| using System.Security.Permissions; | |
| [assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] | |
| namespace System.Windows.Forms | |
| { | |
| public class MessageBoxManager |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // source code orginaly from http://www.dotnettips.info/post/1244/ | |
| /* | |
| Use as extension method: | |
| var date1 = DateTime.Now.ToPesianDateString("yyyy/MM/dd"); | |
| var date2 = DateTime.Now.ToPeianDateString("dddd, dd MMMM,yyyy"); | |
| //Output: | |
| //1391/12/13 | |
| //یکشنبه, 13 اسفند,1391 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics.Contracts; | |
| using System.Web.Http.Dependencies; | |
| using Ninject; | |
| using Ninject.Syntax; | |
| public class NinjectDependencyScope : IDependencyScope | |
| { | |
| private IResolutionRoot resolver; |
NewerOlder