• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ILocation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ILocation的典型用法代码示例。如果您正苦于以下问题:C# ILocation类的具体用法?C# ILocation怎么用?C# ILocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ILocation类属于命名空间,在下文中一共展示了ILocation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DepartFrom

		public override VoyageState DepartFrom (ILocation location)
		{
			if(LastKnownLocation.Equals(location.UnLocode))
				return this;
			string message = string.Format("The voyage departed from {0}.", LastKnownLocation);
			throw new ArgumentException(message, "location");
		}
开发者ID:hungdluit,项目名称:Epic.NET,代码行数:7,代码来源:MovingVoyage.cs


示例2: LeaveSystem

 /// <summary>Make the object leave the solar system</summary>
 /// <param name="obj"></param>
 public void LeaveSystem(ILocation @obj)
 {
     lock (objects)
     {
         this.objects.Remove(obj);
     }
 }
开发者ID:andy-uq,项目名称:Echo,代码行数:9,代码来源:SolarSystem.cs


示例3: CircleReport

 public CircleReport(double time, ILocation loc, double size, GraphicsPath gradientPath)
 {
     this.time = time;
     loc1 = loc;
     this.size = size;
     this.gradientPath = gradientPath;
 }
开发者ID:malweth,项目名称:Modular-Network-Simulator,代码行数:7,代码来源:CircleReport.cs


示例4: GetFaces

        public IEnumerable<Face> GetFaces(ILocation location)
        {
            if (this.contacts.Count == 0) // contacts.xml not loaded for some reason
                yield break;

            var ini = this.iniFileFinder.FindIn(location);
            if (ini == null)
                yield break;

            var parsed = this.parser.Parse(ini);
            var rawFaces = from pair in parsed.Items
                           from face in pair.Value.Faces
                           select new { FileName = pair.Key, face.ContactHash };

            var contactsIndex = parsed.Contacts.ToDictionary(c => c.Hash);

            foreach (var rawFace in rawFaces) {
                var contact = contactsIndex.GetValueOrDefault(rawFace.ContactHash);
                if (contact == null)
                    continue;

                var file = location.GetFile(rawFace.FileName);
                if (file == null)
                    continue;

                var key = new ContactKey(contact.UserCode, contact.ID);
                var person = this.contacts.GetValueOrDefault(key);
                if (person == null)
                    continue;

                yield return new Face(person, file);
            }
        }
开发者ID:ashmind,项目名称:gallery,代码行数:33,代码来源:PicasaFaceProvider.cs


示例5: GetPiece

        public IPiece GetPiece(ILocation location)
        {
            if (location == null)
                throw new ArgumentNullException("Location must not be null");

            return GetPiece(location.X, location.Y);
        }
开发者ID:thebuchanan3,项目名称:ChessCs,代码行数:7,代码来源:Board.cs


示例6: JavaDebugCodeContext

 public JavaDebugCodeContext(JavaDebugProgram program, ILocation location)
 {
     Contract.Requires<ArgumentNullException>(program != null, "program");
     Contract.Requires<ArgumentNullException>(location != null, "location");
     _program = program;
     _location = location;
 }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:7,代码来源:JavaDebugCodeContext.cs


示例7: Copy

        public bool Copy(ILocation sourceLocation, ILocation destinationLocation, ReplaceMode replaceMode)
        {
            if (replaceMode == ReplaceMode.UserAsking)
                throw new Exception ("Use Copy(ILocation,ILocation,Func<ReplaceMode>) call.");

            return Copy (sourceLocation, destinationLocation, replaceMode, null);
        }
开发者ID:DrOuSS,项目名称:CnDCopy,代码行数:7,代码来源:Copier.cs


示例8: CompareByParts

        public static int CompareByParts(this ILocation location1, ILocation location2)
        {
            var location1Parts = (location1 == null) ? (new string[0]) : (location1.GetParts().ToArray());
            var location2Parts = (location2 == null) ? (new string[0]) : (location2.GetParts().ToArray());

            for (var i = 0; i < location1Parts.Length && i < location2Parts.Length; i++)
            {
                var location1Part = location1Parts[i];
                var location2Part = location2Parts[i];

                var result = string.Compare(location1Part, location2Part, StringComparison.InvariantCultureIgnoreCase);

                if (result != 0)
                {
                    return result;
                }
            }

            if (location1Parts.Length < location2Parts.Length)
            {
                return -1;
            }
            else if (location1Parts.Length > location2Parts.Length)
            {
                return 1;
            }

            return 0;
        }
开发者ID:Mavtak,项目名称:roomie,代码行数:29,代码来源:LocationModelExtensions.cs


示例9: MigrationEvent

        public MigrationEvent(ILocation originLocation, ILocation destinationLocation, int cost, int generation)
            : base(destinationLocation, cost, generation)
        {
            if (originLocation == null) throw new ArgumentNullException("originLocation");

            this.OriginLocation = originLocation;
        }
开发者ID:andrewanderson,项目名称:Web-Critters,代码行数:7,代码来源:MigrationEvent.cs


示例10: GetWalkPoints

		public IEnumerable<ILocation> GetWalkPoints(ILocation from, ILocation to)
		{
			if (_mask == null || _mask [0] == null)
				return new List<ILocation> ();
			var grid = CreateGrid(_mask);
			return getWalkPoints(grid, from, to);
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:EPPathFinder.cs


示例11: getWalkPoints

		private IEnumerable<ILocation> getWalkPoints(BaseGrid grid, ILocation from, ILocation to)
		{
			JumpPointParam input = new JumpPointParam (grid, getPos(from), getPos(to), AllowEndNodeUnwalkable, CrossCorner, CrossAdjacentPoint, Heuristics) { UseRecursive = UseRecursive };
			var cells = JumpPointFinder.FindPath (input);
			if (!SmoothPath) cells = JumpPointFinder.GetFullPath(cells);
			return cells.Select (c => getLocation (c, to.Z));
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:EPPathFinder.cs


示例12: StopOverAt

		public void StopOverAt (ILocation location)
		{
			if(null == location)
				throw new ArgumentNullException("location");
			
			// Thread safe, lock free sincronization
	        VoyageState stateBeforeTransition;
	        VoyageState previousState = CurrentState;
	        do
	        {
	            stateBeforeTransition = previousState;
	            VoyageState newValue = stateBeforeTransition.StopOverAt(location);
	            previousState = Interlocked.CompareExchange<VoyageState>(ref this.CurrentState, newValue, stateBeforeTransition);
	        }
	        while (previousState != stateBeforeTransition);

			if(!previousState.Equals(this.CurrentState))
			{
				VoyageEventArgs args = new VoyageEventArgs(previousState.LastKnownLocation, previousState.NextExpectedLocation);
				
				EventHandler<VoyageEventArgs> handler = Stopped;
				if(null != handler)
					handler(this, args);
			}
		}
开发者ID:hungdluit,项目名称:Epic.NET,代码行数:25,代码来源:Voyage.cs


示例13: Leg

		public Leg (IVoyage voyage, ILocation loadLocation, DateTime loadTime, ILocation unloadLocation, DateTime unloadTime)
		{
			if(null == voyage)
				throw new ArgumentNullException("voyage");
			if(null == loadLocation)
				throw new ArgumentNullException("loadLocation");
			if(null == unloadLocation)
				throw new ArgumentNullException("unloadLocation");
			if(loadTime >= unloadTime)
				throw new ArgumentException("Unload time must follow the load time.","unloadTime");
			if(loadLocation.UnLocode.Equals(unloadLocation.UnLocode))
				throw new ArgumentException("The locations must not be differents.", "unloadLocation");
			if(!voyage.WillStopOverAt(loadLocation))
			{
				string message = string.Format("The voyage {0} will not stop over the load location {1}.", voyage.Number, loadLocation.UnLocode);
				throw new ArgumentException(message, "loadLocation");
			}
			if(!voyage.WillStopOverAt(unloadLocation))
			{
				string message = string.Format("The voyage {0} will not stop over the unload location {1}.", voyage.Number, unloadLocation.UnLocode);
				throw new ArgumentException(message, "unloadLocation");
			}
			
			_voyage = voyage.Number;
			_loadLocation = loadLocation.UnLocode;
			_unloadLocation = unloadLocation.UnLocode;
			_loadTime = loadTime;
			_unloadTime = unloadTime;
		}
开发者ID:hungdluit,项目名称:Epic.NET,代码行数:29,代码来源:Leg.cs


示例14: ResolveSourceLocations

        internal virtual IEnumerable<CopyOperation> ResolveSourceLocations(SourceSet[] sourceSet, ILocation destinationLocation)
        {
            bool copyContainer = this.Container;

            foreach (var src in sourceSet) {
                var resolver = GetLocationResolver(src.ProviderInfo);
                foreach (var path in src.SourcePaths) {
                    var location = resolver.GetLocation(path);
                    var absolutePath = location.AbsolutePath;

                    if (!location.IsFile) {
                        // if this is not a file, then it should be a container.
                        if (!location.IsItemContainer) {
                            throw new ClrPlusException("Unable to resolve path '{0}' to a file or folder.".format(path));
                        }

                        // if it's a container, get all the files in the container
                        var files = location.GetFiles(Recurse);
                        foreach (var f in files) {
                            var relativePath = (copyContainer ? location.Name + @"\\" : "") + absolutePath.GetRelativePath(f.AbsolutePath);
                            yield return new CopyOperation {
                                Destination = destinationLocation.IsFileContainer ? destinationLocation.GetChildLocation(relativePath) : destinationLocation,
                                Source = f
                            };
                        }
                        continue;
                    }

                    yield return new CopyOperation {
                        Destination = destinationLocation.IsFileContainer ?  destinationLocation.GetChildLocation(location.Name) : destinationLocation,
                        Source = location
                    };
                }
            }
        }
开发者ID:virmitio,项目名称:clrplus,代码行数:35,代码来源:CopyItemExCmdlet.cs


示例15: MarkedLocation

 public MarkedLocation(ILocation location)
     : base(location)
 {
     MarkColor = new Marker();
     //if location are marked white, it means they haven't yet being visited
     MarkColor.Mark = Color.White;
 }
开发者ID:akrem1st,项目名称:Assignment2c-git,代码行数:7,代码来源:MarkedLocation.cs


示例16: LineReport

 public LineReport(double time, ILocation loc1, ILocation loc2, bool isStatic, int id)
     : this(time, loc1, loc2)
 {
     this.isStatic = isStatic;
     this.id = id;
     if (isStatic) layer = DrawLayer.Static;
 }
开发者ID:malweth,项目名称:Modular-Network-Simulator,代码行数:7,代码来源:LineReport.cs


示例17: Explore

        private void Explore(IActor actor, ILocation location)
        {
            //If an exit location is found, print the path and continue to find another exit
            if (location is ExitLocation)
            {
                if ((location as ExitLocation).ExitPreviouslyFound)
                    return;
                (location as ExitLocation).ExitPreviouslyFound = true;
                NumberOfExits++;
                TripRecorder.Instance.PrintTrip();
                terrain.PathToExit();
                terrain.TerrainPrinter(terrain.StartLocation);
                str= String.Format("{0} Number Of Exit(s) Found!", NumberOfExits);
                   Console.WriteLine(str);
                Console.WriteLine("*****************************************************************");
                return;
            }

            //When the location is dead end
            if (location.ListOfNeighbors().Count == 0)
            {
                (location as MarkedLocation).MarkRed();
                return;
            }

            //traverses to all the neigbors of a location
            foreach (var neighbor in location.ListOfNeighbors())
            {
                location.MoveToNeighbor(actor, neighbor.Key);
                Explore(actor, neighbor.Value);
            }
            //The location will be marked red when it backtracks
            (location as MarkedLocation).MarkRed();
        }
开发者ID:akrem1st,项目名称:Assignment2c-git,代码行数:34,代码来源:TerrainAutoExploration.cs


示例18: GetIsVisible

        public bool GetIsVisible(ILocation location)
        {
            Contract.Requires<ArgumentNullException>(location != null, "location");
            Contract.Requires<VirtualMachineMismatchException>(this.GetVirtualMachine().Equals(location.GetVirtualMachine()));

            throw new NotImplementedException();
        }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:7,代码来源:ILocalVariableContracts.cs


示例19: Player

        public Player(ILocation playerLocation, int startingBalance = DEFAULT_STARTING_BALANCE)
        {
            getOutOfJailFreeCards = new Stack<ICard>();

            PlayerLocation = playerLocation;
            Balance = startingBalance;
        }
开发者ID:jonsavage,项目名称:Monopoly-Kata,代码行数:7,代码来源:Player.cs


示例20: CalculateCloseness

        public static int? CalculateCloseness(this ILocation locationA, ILocation locationB, StringComparison comparisonType = StringComparison.InvariantCultureIgnoreCase)
        {
            var sequenceA = locationA.GetParts();
            var sequenceB = locationB.GetParts();

            return sequenceA.CalculateCloseness(sequenceB, comparisonType);
        }
开发者ID:Mavtak,项目名称:roomie,代码行数:7,代码来源:LocationExtensions.cs



注:本文中的ILocation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ILocator类代码示例发布时间:2022-05-24
下一篇:
C# ILocatable类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap