public ReproductionEvent(ILocation location, int generation, Type reproductionType, ISpecies mate, params ISpecies[] children) : base(location, generation) { this.Mate = mate; this.Offspring = new List<ISpecies>(children); this.ReproductionType = reproductionType; }
public Player(ILocation playerLocation, int startingBalance = DEFAULT_STARTING_BALANCE) { getOutOfJailFreeCards = new Stack<ICard>(); PlayerLocation = playerLocation; Balance = startingBalance; }
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); }
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"); }
public bool GetIsVisible(ILocation location) { Contract.Requires<ArgumentNullException>(location != null, "location"); Contract.Requires<VirtualMachineMismatchException>(this.GetVirtualMachine().Equals(location.GetVirtualMachine())); throw new NotImplementedException(); }
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; }
private void ChangeUnitLocation(IPath pathToTheTargetPlanet, IUnit unitToTeleport, ILocation targetLocation) { pathToTheTargetPlanet.TargetLocation.Planet.Units.Add(unitToTeleport); unitToTeleport.CurrentLocation.Planet.Units.Remove(unitToTeleport); unitToTeleport.PreviousLocation = unitToTeleport.CurrentLocation; unitToTeleport.CurrentLocation = targetLocation; }
public IPiece GetPiece(ILocation location) { if (location == null) throw new ArgumentNullException("Location must not be null"); return GetPiece(location.X, location.Y); }
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); }
public ALListener(IAudioErrors errors, IAudioBackend backend) { _errors = errors; _backend = backend; Volume = 0.5f; _location = new AGSLocation (); }
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; }
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; }
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(); }
public JavaDebugCodeContext(JavaDebugProgram program, ILocation location) { Contract.Requires<ArgumentNullException>(program != null, "program"); Contract.Requires<ArgumentNullException>(location != null, "location"); _program = program; _location = location; }
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); }
public bool Copy(ILocation sourceLocation, ILocation destinationLocation, Func<ReplaceMode> userAskHandler) { if (userAskHandler == null) throw new Exception ("Use Copy(ILocation,ILocation, ReplaceMode) call."); return Copy (sourceLocation, destinationLocation, ReplaceMode.UserAsking, userAskHandler); }
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); } }
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 }; } } }
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; }
public MigrationEvent(ILocation originLocation, ILocation destinationLocation, int cost, int generation) : base(destinationLocation, cost, generation) { if (originLocation == null) throw new ArgumentNullException("originLocation"); this.OriginLocation = originLocation; }
public Window() { _eventModel = new EventModel(this); //by default window is a parent control for all other controls, canvases, etc. Visible = true; Paint += Window_Paint; _innerWidth = ClientRectangle.Width; _innerHeight = ClientRectangle.Height; //BackColor = Color.Empty; UpdateClientRect(); Initialize(); //ConfigureHook(); Name = "window"; _location = new Location(); _location.OnSaveFile += location_OnSaveFile; // // dlgSaveFile // _dlgSaveFile = new SaveFileDialog(); _dlgSaveFile.Title = "Save PDF File"; _dlgSaveFile.Filter = "PDF|*.pdf"; // // document // _document = new Document(this); _document.Width = _innerWidth; _document.Height = _innerHeight; Controls.Add(_document); _childNodes = new List<INode>(); _childNodes.Add(_document); // // Events //); this.Resize += new EventHandler(Window_Resize); }
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)); }
public CircleReport(double time, ILocation loc, double size, GraphicsPath gradientPath) { this.time = time; loc1 = loc; this.size = size; this.gradientPath = gradientPath; }
static ProxyTestHelper() { _person = new Person(PersonId); _business = new Business(BusinessId); _location = new Location(LocationId); _phone = new Phone(PhoneId); }
/// <summary>Make the object leave the solar system</summary> /// <param name="obj"></param> public void LeaveSystem(ILocation @obj) { lock (objects) { this.objects.Remove(obj); } }
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); } }
public TeleportStation(IBusinessOwner owner, IEnumerable<IPath> galacticMap, ILocation location) { this.owner = owner; this.galacticMap = galacticMap; this.location = location; this.resources = new Resources(); }
public SectionRangeToken(ILocation location, ISection section, int idx, int length, TokenEnum code) { _location = location; _code = code; _section = section; _idx = idx; _length = length; }
public CodeBuilder (string code, bool isAssign, ILocation location) { this.code = code; this.isAssign = isAssign; this.line = location.BeginLine; this.fileName = location.Filename; this.location = location; }
/// <summary> /// Return zero or more locations in primary source documents that correspond to the given derived (non primary) document location. /// </summary> /// <param name="location">A location in a document that have been derived from one or more source documents.</param> public IEnumerable<IPrimarySourceLocation> GetPrimarySourceLocationsFor(ILocation location) { var psloc = location as IPrimarySourceLocation; if (psloc != null) return IteratorHelper.GetSingletonEnumerable(psloc); else { return this.MapLocationToSourceLocations(location); } }
public MockedTeleportStation(IBusinessOwner owner, IEnumerable <IPath> galacticMap, ILocation location) : base(owner, galacticMap, location) { }
public bool ContainsLocation(ILocation location) { return(ContainsLocation(location.Coordinate1, location.Coordinate2)); }
public void MoveSouth() { CurrentLocation = new Location(Id, CurrentLocation.X, CurrentLocation.Y + 1); }
public void SetInitialLocation(int x, int y) { CurrentLocation = new Location(Id, x, y); }
public Employee(ILocation location, uint hoursWorked, decimal hourlyRate) { Location = location; HourlyRate = hourlyRate; HoursWorked = hoursWorked; }
public Assignment CreateAssignmentFromDb(int id, ITribe tribe, uint x, uint y, ILocation target, AttackMode mode, DateTime targetTime, uint dispatchCount, string description, bool isAttack) { return(new Assignment(id, tribe, x, y, target, mode, targetTime, dispatchCount, description, isAttack, kernel.Get <Formula>(), kernel.Get <IDbManager>(), kernel.Get <IGameObjectLocator>(), kernel.Get <IScheduler>(), kernel.Get <Procedure>(), kernel.Get <ITileLocator>(), kernel.Get <IActionFactory>(), kernel.Get <ILocker>(), kernel.Get <ITroopObjectInitializerFactory>())); }
public void SaveLocation(ILocation location) { this.locationManager.UpdateLocation(location); }
/// <summary> /// Creates new Exon feature item from the specified location. /// </summary> /// <param name="location">Location of the Exon.</param> public Exon(ILocation location) : base(StandardFeatureKeys.Exon, location) { }
public NormalLocation() { Directions = new ILocation[] { null, null, null, null }; Items = new List <InventoryItem>(); }
/// <summary> /// 添加查找面板 /// </summary> /// <typeparam name="TModel"></typeparam> /// <param name="source"></param> /// <param name="location"></param> /// <param name="key"></param> /// <param name="value"></param> /// <param name="placeHolder"></param> public static void AddSearchPanel <TModel>(this DynamicTable <TModel> source, ILocation location, string key, string value, string placeHolder = null) where TModel : class { if (source == null) { return; } if (location == null) { throw new ArgumentNullException("location"); } if (key == null) { throw new ArgumentNullException("key"); } var connector = "?"; if (location.Path.IndexOf("?") > -1) { connector = "&"; } var script = string.Format("$app.same('{0}{1}{2}=' + encodeURIComponent($.trim($(this).parent().parent().find('input[name={2}]').val())))", location.Path, connector, key); var form = new HtmlElement(HtmlTag.Form); form.OnClient(HtmlEvent.Submit, string.Format("$app.same('{0}{1}{2}=' + encodeURIComponent($.trim($(this).find('input[name={2}]').val()))); return false;", location.Path, connector, key)); form.PrependTo(source); var search = new HtmlElement(HtmlTag.Div); search.AddClass("form-group"); search.AppendTo(form); var group = new HtmlElement(HtmlTag.Div); group.AppendTo(search); group.AddClass(Column.Sm5); group.AddClass("input-group"); var input = new HtmlElement(HtmlTag.Input); input.AppendTo(group); input.Attribute(HtmlAttribute.Name, key); input.Attribute(HtmlAttribute.Value, value); input.Attribute(HtmlAttribute.PlaceHolder, placeHolder); input.AddClass("form-control"); var span = new HtmlElement(HtmlTag.Span); span.AddClass("input-group-addon"); span.AppendTo(group); var button = new HtmlElement(HtmlTag.Input); button.AppendTo(span); button.Attribute(HtmlAttribute.Value, "查找"); button.Attribute(HtmlAttribute.Type, "submit"); }
private void SetCommodities(ILocation location) => location.SetCommodities(Commodities.OrderBy(Random).Take(5));
public void MoveWest() { CurrentLocation = new Location(Id, CurrentLocation.X - 1, CurrentLocation.Y); }
protected Entity(int lives, ILocation location) { Location = location; Lives = lives; }
private ILocation CreateLocation(ILocation location) { var locationRepo = dataService.GetRepository <ILocationRepository, ILocation>(); return(locationRepo.Add(location)); }
public string GetLocationDescription(ILocation loc) { return(string.IsNullOrWhiteSpace(loc.Description) ? loc.LocationCode : loc.Description); }
public void Update(ILocation entity) { Context.SetModified(entity); }
public static bool CoordinatesLocatedIn( ICoordinates coordinates, ILocation location) { return(CoordinatesLocatedIn(coordinates, location.Coordinate1, location.Coordinate2)); }
public void Deactivate(ILocation entity) { entity.Active = false; Update(entity); }
public TemporalLocation(ILocation location, IFuzzyDateTimeRange dateTimeRange, ICitation citation, IAudit audit) : base(dateTimeRange.StartDateTime, dateTimeRange.EndDateTime, citation, audit) { Location = location; }
public void Remove(ILocation entity) { Context.Locations.Remove((Location)entity); }
public void MoveNorth() { CurrentLocation = new Location(Id, CurrentLocation.X, CurrentLocation.Y - 1); }
public void Add(ILocation entity) { Context.Locations.Add((Location)entity); }
public override CargoState Recieve(ILocation location, DateTime date) { throw new InvalidOperationException("Already recieved."); }
public bool Equals(ILocation other) { return(Name == other.Name && Token == other.Token); }
public IEnumerable <CheckResult> VerifyVCEncounter(PKM pkm, IEncounterable encounter, ILocation transfer, IList <CheckMoveResult> Moves) { // Check existing EncounterMatch if (encounter is EncounterInvalid || transfer == null) { yield break; // Avoid duplicate invaild message } if (encounter is EncounterStatic v && (GameVersion.GBCartEraOnly.Contains(v.Version) || v.Version == GameVersion.VCEvents)) { bool exceptions = false; exceptions |= v.Version == GameVersion.VCEvents && encounter.Species == 151 && pkm.TID == 22796; if (!exceptions) { yield return(GetInvalid(LG1GBEncounter)); } } if (pkm.Met_Location != transfer.Location) { yield return(GetInvalid(LTransferMetLocation)); } if (pkm.Egg_Location != transfer.EggLocation) { yield return(GetInvalid(LEggLocationNone)); } // Flag Moves that cannot be transferred if (encounter is EncounterStatic s && s.Version == GameVersion.C && s.EggLocation == 256) // Dizzy Punch Gifts { FlagIncompatibleTransferMove(pkm, Moves, 146, 2); // can't have Dizzy Punch at all } bool checkShiny = pkm.VC2 || (pkm.TradebackStatus == TradebackType.WasTradeback && pkm.VC1); if (!checkShiny) { yield break; } if (pkm.Gender == 1) // female { if (pkm.PersonalInfo.Gender == 31 && pkm.IsShiny) // impossible gender-shiny { yield return(GetInvalid(LEncStaticPIDShiny, CheckIdentifier.PID)); } } else if (pkm.Species == 201) // unown { if (pkm.AltForm != 8 && pkm.AltForm != 21 && pkm.IsShiny) // impossibly form-shiny (not I or V) { yield return(GetInvalid(LEncStaticPIDShiny, CheckIdentifier.PID)); } } }
public void RemoveLocation(ILocation location) { RemoveLocation(location.Coordinate1, location.Coordinate2); }
protected static void Setup() { StartLocation = new Domain.Location(XCoordinate, YCoordinate); RobotCleaner = new RobotCleaner(StartLocation, Commands); }
public void MoveEast() { CurrentLocation = new Location(Id, CurrentLocation.X + 1, CurrentLocation.Y); }
/// <summary> /// Constructor /// </summary> /// <param name="location"> /// The location to be cleared. /// </param> /// <param name="force"> /// A boolean representing whether to override logic and clear the location. /// </param> public ClearLocation(ILocation location, bool force = false) { _location = location; _force = force; }
public Boat As(IRace race, ILocation favour) { return(new Boat(Number, Name, Category, false)); // , race, favour); }