/// <summary> /// Add new entity to bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='body'> /// New entity /// </param> /// <param name='prefer'> /// Required in order for the service to return a JSON representation of the /// object. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <MicrosoftDynamicsCRMbcgovLocation> CreateAsync(this ILocations operations, MicrosoftDynamicsCRMbcgovLocation body, string prefer = "return=representation", CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateWithHttpMessagesAsync(body, prefer, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public override string ManageLocations() { try { ILocationsData locationsData = dataFactory.CreateLocationsData(); ILocations locations = locationsData.GetLocationsAll(); IFlagImageData flagImageData = dataFactory.CreateFlagImageData(); flagImageData.AddFlagsToCountries(locations.countries); IBackupData backupData = dataFactory.CreateBackupData(); backupData.SetBackup(locations); List <IEntity> entities = entityFactory.CreateEntities(); entities.Add(locations); return(responseFactory.CreateResponse("", entities)); } catch (Exception ex) { string message = String.Format("Exception caught: {0}", ex); logger.LogMessage(message); return(responseFactory.CreateResponse(message, null)); } }
/// <summary> /// Get entities from bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='top'> /// </param> /// <param name='skip'> /// </param> /// <param name='search'> /// </param> /// <param name='filter'> /// </param> /// <param name='count'> /// </param> /// <param name='orderby'> /// Order items by property values /// </param> /// <param name='select'> /// Select properties to be returned /// </param> /// <param name='expand'> /// Expand related entities /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <LocationsGetResponseModel> GetAsync(this ILocations operations, int?top = default(int?), int?skip = default(int?), string search = default(string), string filter = default(string), bool?count = default(bool?), IList <string> orderby = default(IList <string>), IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(top, skip, search, filter, count, orderby, select, expand, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get entity from bcgov_locations by key /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='bcgovLocationid'> /// key: bcgov_locationid /// </param> /// <param name='select'> /// Select properties to be returned /// </param> /// <param name='expand'> /// Expand related entities /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <MicrosoftDynamicsCRMbcgovLocation> GetByKeyAsync(this ILocations operations, string bcgovLocationid, IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetByKeyWithHttpMessagesAsync(bcgovLocationid, select, expand, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public void AddNeighbor(ILocations to, Directions direction) { if (FindNeighbor(to, direction) == false) { _neighbors.Add(direction,to); } throw new Exception(); }
public bool Explore(IActor player, ILocations locations, int count) { var j = locations.GetEnumerator(); if (locations as ExitLocations != null) { if (count > 0) { while (j.MoveNext()) { Explore(player, j.Current as ILocations, count--); } } else { locations.EnterLocation(player); locations.ExitLocation(player); return false; } } var t = (locations as ContainerLocation).GetPlayerMarker(player); if (t.Equals(null)) { locations.EnterLocation(player); locations.ExitLocation(player); while (j.MoveNext()) { Explore(player, j.Current as ILocations, count--); } } if(t.Equals(Marker._green)) { locations.EnterLocation(player); locations.ExitLocation(player); while (j.MoveNext()) { Explore(player, j.Current as ILocations, count); } } return false; }
public void GameStart() { _game1.BuildTerrian(); _start = _game1.Start; (log as TripRecorder).Subscribe(_start as LocationDecorator); (_first as Algorithm1).Explore(player, _start, count); (_start as LocationDecorator).EndUpdate(); Console.WriteLine(log.GetRecordLog()); }
static LocationHelper() { if (PlatformDetection.IsWindows) { locations = new LocationHelperWindows(); } else { locations = new LocationHelperUnix(); } }
public ClashOfClansDIClient(IClans clans, ILocations locations, ILeagues leagues, IPlayers players, ILabels labels, IGoldPass goldPass) { Clans = clans; Locations = locations; Leagues = leagues; Players = players; Labels = labels; GoldPass = goldPass; }
///<summary> /// Builds the logs ///</summary> private void BuildLog(ILocations location) { var j = (location as ILocationDecorator).GetNeighbors; _log.Append(location.ToString()); _log.Append(":"); GetValue(location); _log.AppendLine(); foreach (KeyValuePair<Directions,ILocations> p in j) { _log.Append(" "); _log.Append(p.Key.ToString()); _log.Append("-->"); _log.Append(p.Value.ToString()); GetValue(p.Value); _log.AppendLine(); } }
///<summary> /// allows the exploration and adds to the build log ///</summary> private void Explore(ILocations location) { if((_set.Contains(location) ) == false) { BuildLog(location); _set.Add(location); var j = location.GetEnumerator(); while (j.MoveNext()) { if (j.Current != null) { Explore(j.Current as ILocations); } } } return; }
/// <summary> /// Update entity in bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='bcgovLocationid'> /// key: bcgov_locationid /// </param> /// <param name='body'> /// New property values /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task UpdateAsync(this ILocations operations, string bcgovLocationid, MicrosoftDynamicsCRMbcgovLocation body, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.UpdateWithHttpMessagesAsync(bcgovLocationid, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Update entity in bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='bcgovLocationid'> /// key: bcgov_locationid /// </param> /// <param name='body'> /// New property values /// </param> public static void Update(this ILocations operations, string bcgovLocationid, MicrosoftDynamicsCRMbcgovLocation body) { operations.UpdateAsync(bcgovLocationid, body).GetAwaiter().GetResult(); }
private bool FindNeighbor(ILocations from, Directions to) { foreach (KeyValuePair<Directions,ILocations> loc in _neighbors) { if (loc.Value.Equals(from.Name) && loc.Key.Equals(to)) return true; } return false; }
/// <summary> /// Add reference to adoxio_workers /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='locationId'> /// key: locationId /// </param> /// <param name='fieldname'> /// key: fieldname /// </param> /// <param name='odataid'> /// reference value /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task AddReferenceAsync(this ILocations operations, string locationId, string fieldname, OdataId odataid = default(OdataId), CancellationToken cancellationToken = default(CancellationToken)) { (await operations.AddReferenceWithHttpMessagesAsync(locationId, fieldname, odataid, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
public ContainerLocation(ILocations location) { _location = location; _saveState = new Dictionary<IActor,Marker>(); _check = new Flag(); }
/// <summary> /// checks if it is a deadend /// </summary> public bool DeadEndCheck(ILocations location) { return (_location as ContainerLocation).DeadEndCheck(location); }
public abstract void ExploreTerrain(ILocations startingLocations);
/// <summary> /// checks to see see if its a dead end. /// </summary> public bool DeadEndCheck(ILocations location) { if (location != null) return DeadEnd(location); else return false; }
/// <summary> /// Get entities from bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='top'> /// </param> /// <param name='skip'> /// </param> /// <param name='search'> /// </param> /// <param name='filter'> /// </param> /// <param name='count'> /// </param> /// <param name='orderby'> /// Order items by property values /// </param> /// <param name='select'> /// Select properties to be returned /// </param> /// <param name='expand'> /// Expand related entities /// </param> public static GetOKResponseModelModelModelModelModelModelModelModelModelModelModel Get(this ILocations operations, int?top = default(int?), int?skip = default(int?), string search = default(string), string filter = default(string), bool?count = default(bool?), IList <string> orderby = default(IList <string>), IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>)) { return(operations.GetAsync(top, skip, search, filter, count, orderby, select, expand).GetAwaiter().GetResult()); }
public void RemoveMember(ILocations location) { _bucket.Remove(location.Name); }
public void AddMember(ILocations location) { _bucket.Add(location.Name,location); }
public MyController(ILocations myLocations) { this.myLocations = myLocations; }
public void Explore(IActor player, ILocations locations, Control flag) { if (flag.Flag == true) { var j = locations.GetEnumerator(); var t = ((ILocationDecorator) locations).GetPlayerMarker(player); if (locations as IExit != null && flag.Flag == true) { locations.EnterLocation(player); locations.ExitLocation(player); flag.Flag = false; //if ((flag.Count > 0 && t == null)) // { // locations.EnterLocation(player); // locations.ExitLocation(player); // var i = flag.Count; // flag.Count = (i - 1); // return; /* while (j.MoveNext()) { if (j.Current != null) { if (((LocationDecorator) j.Current).GetPlayerMarker(player) != null) { if (!((LocationDecorator) j.Current).GetPlayerMarker(player).Equals(Marker._red)) { Explore(player, j.Current as ILocations, flag); } } else if (((LocationDecorator) j.Current).GetPlayerMarker(player) == null) { Explore(player, j.Current as ILocations, flag); } } */ } // if (t != null && flag.Count < 1) // { //locations.EnterLocation(player); // locations.ExitLocation(player); // flag.Flag = false; // return; /* while (j.MoveNext()) { if (j.Current != null) { if (((LocationDecorator) j.Current).GetPlayerMarker(player) != null) { if (!((LocationDecorator) j.Current).GetPlayerMarker(player).Equals(Marker._red)) { Explore(player, j.Current as ILocations, count, flag); } } else if (((LocationDecorator) j.Current).GetPlayerMarker(player) == null) { Explore(player, j.Current as ILocations, count, flag); } } } */ // } // } if (t == null && flag.Flag == true) { goto Loop; } else if (((ILocationDecorator) locations).GetPlayerMarker(player).Equals(Marker._green) && flag.Flag == true) { goto Loop; } //Goto comes here Loop: locations.EnterLocation(player); locations.ExitLocation(player); while (j.MoveNext()) { if (j.Current != null) { if (((ILocationDecorator)j.Current).GetPlayerMarker(player) != null) { if (((ILocationDecorator)j.Current).GetPlayerMarker(player).Equals(Marker._green)) { Explore(player, j.Current as ILocations, flag); } } else if (((ILocationDecorator)j.Current).GetPlayerMarker(player) == null) { Explore(player, j.Current as ILocations, flag); } } } return; } }
/// <summary> /// Add new entity to bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='body'> /// New entity /// </param> /// <param name='prefer'> /// Required in order for the service to return a JSON representation of the /// object. /// </param> public static MicrosoftDynamicsCRMbcgovLocation Create(this ILocations operations, MicrosoftDynamicsCRMbcgovLocation body, string prefer = "return=representation") { return(operations.CreateAsync(body, prefer).GetAwaiter().GetResult()); }
/// <summary> /// Get entities from bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='top'> /// </param> /// <param name='filter'> /// </param> /// <param name='count'> /// </param> /// <param name='orderby'> /// Order items by property values /// </param> /// <param name='select'> /// Select properties to be returned /// </param> /// <param name='expand'> /// Expand related entities /// </param> public static MicrosoftDynamicsCRMbcgovLocationCollection Get(this ILocations operations, int?top = default(int?), string filter = default(string), bool?count = default(bool?), IList <string> orderby = default(IList <string>), IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>)) { return(operations.GetAsync(top, filter, count, orderby, select, expand).GetAwaiter().GetResult()); }
//returns true if there is a neighbor in a particular direction for a given location private bool FindNeighbor(ILocations from, Directions to) { return _neighbors.Any(loc => loc.Value.Equals(from.Name) && loc.Key.Equals(to)); }
/// <summary> /// Get entities from bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='top'> /// </param> /// <param name='filter'> /// </param> /// <param name='count'> /// </param> /// <param name='orderby'> /// Order items by property values /// </param> /// <param name='select'> /// Select properties to be returned /// </param> /// <param name='expand'> /// Expand related entities /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <MicrosoftDynamicsCRMbcgovLocationCollection> GetAsync(this ILocations operations, int?top = default(int?), string filter = default(string), bool?count = default(bool?), IList <string> orderby = default(IList <string>), IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(top, filter, count, orderby, select, expand, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
private bool DeadEnd(ILocations location) { if(_check.GreenFlag == true) { if (location.Count < 1) { _check.GreenFlag = false; _check.RedFlag = true; return true; } } else { _check.GreenFlag = true; } return false; }
public UpdateRequest(IActor player, ILocations location, Flag flag) { _player = player; _location = location; _flag = flag; }
public bool DeadEndCheck(ILocations location) { if(location != null) return DeadEnd(location); throw new ArgumentNullException(); }
/// <summary> /// Add reference to adoxio_workers /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='locationId'> /// key: adoxio_workerid /// </param> /// <param name='fieldname'> /// key: fieldname /// </param> /// <param name='odataid'> /// reference value /// </param> public static void AddReference(this ILocations operations, string locationId, string fieldname, OdataId odataid = default(OdataId)) { operations.AddReferenceAsync(locationId, fieldname, odataid).GetAwaiter().GetResult(); }
public override void AddNeighbor(ILocations to, Directions direction) { _location.AddNeighbor(to, direction); }
///<summary> /// appends the markers to the log ///</summary> private void GetValue(ILocations location) { if (location as IExit != null) { _log.Append(" Exit "); } var t = (location as ILocationDecorator).GetPlayerMarker(_player); if (t != null) { if (t.Equals(Marker._green)) { _log.Append(" Green Marker"); } else { _log.Append(" Red Marker"); } } }
public ExitLocations(ILocations location) { _location = location; }
/// <summary> /// Get entity from bcgov_locations by key /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='bcgovLocationid'> /// key: bcgov_locationid /// </param> /// <param name='select'> /// Select properties to be returned /// </param> /// <param name='expand'> /// Expand related entities /// </param> public static MicrosoftDynamicsCRMbcgovLocation GetByKey(this ILocations operations, string bcgovLocationid, IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>)) { return(operations.GetByKeyAsync(bcgovLocationid, select, expand).GetAwaiter().GetResult()); }
/// <summary> /// Do not need this /// </summary> public override void ExploreTerrain(ILocations startingLocations) { throw new NotImplementedException(); }
/// <summary> /// Delete entity from bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='bcgovLocationid'> /// key: bcgov_locationid /// </param> /// <param name='ifMatch'> /// ETag /// </param> public static void Delete(this ILocations operations, string bcgovLocationid, string ifMatch = default(string)) { operations.DeleteAsync(bcgovLocationid, ifMatch).GetAwaiter().GetResult(); }
/// <summary> /// Remove reference to adoxio_workers /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='locationId'> /// key: adoxio_workerid /// </param> /// <param name='fieldname'> /// key: fieldname /// </param> /// <param name='odataid'> /// reference value /// </param> public static void RemoveReference(this ILocations operations, string locationId, string fieldname, string removeId) { operations.RemoveReferenceAsync(locationId, fieldname, removeId).GetAwaiter().GetResult(); }
/// <summary> /// Delete entity from bcgov_locations /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='bcgovLocationid'> /// key: bcgov_locationid /// </param> /// <param name='ifMatch'> /// ETag /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this ILocations operations, string bcgovLocationid, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(bcgovLocationid, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Remove reference to adoxio_workers /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='locationId'> /// key: locationId /// </param> /// <param name='fieldname'> /// key: fieldname /// </param> /// <param name='odataid'> /// reference value /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task RemoveReferenceAsync(this ILocations operations, string locationId, string fieldname, string removeId, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.RemoveReferenceWithHttpMessagesAsync(locationId, fieldname, removeId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
public JsonArticlesService(ILocations locations) { this.locations = locations; }