/// <summary>Creates a searcher which searches <i>searchers</i>. </summary> public MultiSearcher(Searchable[] searchables) { this.searchables = searchables; starts = new int[searchables.Length + 1]; // build starts array for (int i = 0; i < searchables.Length; i++) { starts[i] = maxDoc; maxDoc += searchables[i].MaxDoc(); // compute maxDocs } starts[searchables.Length] = maxDoc; }
public void ShouldAddAndGetLaw() { Searchable _shab = new Searchable(); _shab.LawId = 123; _shab.SolrId = "Law123"; _shab.Title = "Money for everybody."; _shab.DocType = "Law"; solr_searchable.Add(_shab).Commit(); var results = solr_searchable.Query("solr_id:Law123"); Assert.AreEqual(1, results.Count); Assert.AreEqual("Money for everybody.", results.First().Title); }
public IntersectionCollector(Searchable indexSearcher, IEnumerable<ScoreDoc> scoreDocs) { foreach (var scoreDoc in scoreDocs) { var document = indexSearcher.Doc(scoreDoc.Doc); var subQueryResult = new SubQueryResult { LuceneId = scoreDoc.Doc, RavenDocId = document.Get(Constants.DocumentIdFieldName) ?? document.Get(Constants.ReduceKeyFieldName), Score = float.IsNaN(scoreDoc.Score) ? 0.0f : scoreDoc.Score, Count = 1 }; results[subQueryResult.RavenDocId] = subQueryResult; } }
public SearchResult<UserMaster> Search(Searchable<UserMasterSearcher> criteria) { var result = new SearchResult<UserMaster>(); result.Items = new List<UserMaster>() { new UserMaster { UserIdentifier = "b55", UserNumber = 55, Name = "Billy", EmailAddress = "*****@*****.**", Fax = "N/A", Mobile = "N/A", Phone = "N/A", PrimaryBranchNumber = 123, }, new UserMaster { UserIdentifier = "c22", UserNumber = 22, Name = "Charles Carmichael", EmailAddress = "*****@*****.**", Fax = "N/A", Mobile = "N/A", Phone = "N/A", PrimaryBranchNumber = 007, } }; result.TotalRecords = result.Items.Count; result.ResultOffset = Helper.GetOffset(0, result.TotalRecords); result.TotalRecords = Helper.ClampCount(criteria.searchRange.Offset, criteria.searchRange.Size, result.TotalRecords); HttpUtils.Response.setupCurrentWebResponseNoCache(); return result; //return QueryHelper.ApplyGenericSearch(PowerScopeDataStores.UserMaster, Logger, SearchMethodName, criteria, "UserIdentifier", this.ConstructQueryConditions); }
public BagTypeTagsTests() { BagType = new BagType(System.Guid.NewGuid().ToString(), "Paper"); SearchableBagType = new Searchable(BagType); }
public override bool open(Searchable config) { bool ret = yarpPINVOKE.DeviceDriver_open(swigCPtr, Searchable.getCPtr(config)); if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve(); return ret; }
public override List <Searchable> getPathToDataControl(Searchable dataControl) { return(getPathFromChild(dataControl, globalStatesDataControlList.Cast <Searchable>().ToList())); }
public DeerAttackState(Enemy enemy, Searchable searchable) : base(enemy, searchable) { _deer = enemy as Deer; }
public override List <Searchable> getPathToDataControl(Searchable dataControl) { return(dataControl == this ? new List <Searchable> { this } : null); }
public SearchResult<Customer> Search(Searchable<CustomerSearcher> searchData) { return QueryHelper.ApplyGenericSearch(HDSMobileAppDataStores.Customer, Logger, SearchMethodName, searchData.searchRange, searchData.searchCriteria, "customerId", this.ConstructQueryConditions); }
public override List <Searchable> getPathToDataControl(Searchable dataControl) { return(null); }
public ChaseState(Enemy enemy, Searchable searchable) : base(enemy, searchable) { CurrentState = "Chase"; }
public BrandTagsTests() { Brand = new Brand(System.Guid.NewGuid().ToString(), "Twinning"); SearchableBrand = new Searchable(Brand); }
public IdleState(Enemy enemy, Searchable searchable) : base(enemy, searchable) { CurrentState = "Idle"; }
//Collect Pickups and search and attack things public void OnTriggerEnter2D(Collider2D collision) { //Debug.Log("Enter Trigger with" + collision.transform.gameObject); if (_wantToAttack && _AttackTarget != null) { if (collision.gameObject.transform.parent) { print("ATTACK$44?"); if (collision.gameObject.transform.parent.gameObject == _AttackTarget) { Attack(); } } } else if (_MoveLocation == collision.gameObject) { _horizontalMove = 0; } if (collision.transform.GetComponent <DiggableTile>()) { // Debug.Log("Collider w diggable tile"); if (!_InGround) // only keep track of top soil tiles { _CurrentSoilTile = collision.transform.GetComponent <DiggableTile>(); } } else if (collision.transform.parent) { // handle if collider is agro range or base range if (collision.transform.GetComponent <BaseHitBox>()) { //print("Collided with a base hitbox"); if (collision.transform.parent.GetComponent <BuildableObject>()) { // print("collded with a buildng hitbox"); //Add to our list of interactable things in range _InRange.Add(collision.transform.parent.gameObject); //print("Added: " + collision.transform.parent.gameObject); //Can we search it? if (collision.transform.parent.GetComponent <Searchable>()) { Searchable s = collision.transform.parent.GetComponent <Searchable>(); { s.setActive(true); // Debug.LogWarning("Players in range"); } } } else if (collision.transform.parent.GetComponent <Rodent>()) { //Add to our list of interactable things in range Rodent r = collision.transform.parent.GetComponent <Rodent>(); if (r.getTeam() == 2 && _InRange.Contains(collision.transform.parent.gameObject) == false) { _InRange.Add(collision.transform.parent.gameObject); } } } } ///Old Game Jam code, could be reused for pickups else if (collision.transform.GetComponent <CoinResource>()) { // if (collision.transform.GetComponent<CoinResource>().isActive()) { ResourceManagerScript.Instance.incrementResource(ResourceManagerScript.ResourceType.Trash, 1); Destroy(collision.gameObject); } } }
private static IEnumerable <SearchResult> MapLuceneToDataList(IEnumerable <ScoreDoc> hits, Searchable searcher) { return(hits.Select(hit => ToSearchResult(searcher.Doc(hit.Doc))).ToList()); }
public RestState(Enemy enemy, Searchable searchable) : base(enemy, searchable) { CurrentState = "Rest"; }
public DeerMoveState(Enemy enemy, Searchable searchable) : base(enemy, searchable) { }
public virtual bool open(Searchable config) { return true; }
public virtual bool open(Searchable config) { if(initialised) { return true;} else{ return false;} }
private static IEnumerable <Guid> _mapLuceneToDataList(IEnumerable <ScoreDoc> hits, Searchable searcher) { return(hits.Select(hit => _mapLuceneDocumentToData(searcher.Doc(hit.Doc))).ToList()); }
public MoveState(Enemy enemy, Searchable searchable) : base(enemy, searchable) { CurrentState = "Move"; }
public MultiSearcherThread(Searchable searchable, Weight weight, Filter filter, int nDocs, FieldDocSortedHitQueue hq, Sort sort, int i, int[] starts, System.String name) : base(name) { this.searchable = searchable; this.weight = weight; this.filter = filter; this.nDocs = nDocs; this.hq = hq; this.i = i; this.starts = starts; this.sort = sort; }
public override string ToString() { var sb = new StringBuilder("Square("); bool __first = true; if (Mid != null && __isset.mid) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Mid: "); Mid.ToString(sb); } if (Name != null && __isset.name) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Name: "); Name.ToString(sb); } if (WelcomeMessage != null && __isset.welcomeMessage) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("WelcomeMessage: "); WelcomeMessage.ToString(sb); } if (ProfileImageObsHash != null && __isset.profileImageObsHash) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("ProfileImageObsHash: "); ProfileImageObsHash.ToString(sb); } if (Desc != null && __isset.desc) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Desc: "); Desc.ToString(sb); } if (__isset.searchable) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Searchable: "); Searchable.ToString(sb); } if (__isset.type) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Type: "); Type.ToString(sb); } if (__isset.categoryID) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("CategoryID: "); CategoryID.ToString(sb); } if (InvitationURL != null && __isset.invitationURL) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("InvitationURL: "); InvitationURL.ToString(sb); } if (__isset.revision) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Revision: "); Revision.ToString(sb); } if (__isset.ableToUseInvitationTicket) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("AbleToUseInvitationTicket: "); AbleToUseInvitationTicket.ToString(sb); } if (__isset.state) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("State: "); State.ToString(sb); } sb.Append(")"); return(sb.ToString()); }
public CountryTagsTests() { Country = new Country(System.Guid.NewGuid().ToString(), "Norway"); SearchableCountry = new Searchable(Country); }
internal static HandleRef getCPtr(Searchable obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Searchable obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
public PolyDriver(Searchable config) : this(yarpPINVOKE.new_PolyDriver__SWIG_2(Searchable.getCPtr(config)), true) { if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve(); }
public virtual DeviceDriver open(Searchable config) { IntPtr cPtr = yarpPINVOKE.Drivers_open__SWIG_1(swigCPtr, Searchable.getCPtr(config)); DeviceDriver ret = (cPtr == IntPtr.Zero) ? null : new DeviceDriver(cPtr, false); if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve(); return ret; }
public SearchResult<Product> Search(Searchable<ProductSearcher> searchData) { return QueryHelper.ApplyGenericSearch(HDSMobileAppDataStores.Product, Logger, SearchMethodName, searchData.searchRange, searchData.searchCriteria, "productId", this.ConstructQueryConditions); }
public virtual bool open(Searchable config) { bool ret = yarpPINVOKE.IConfig_open(swigCPtr, Searchable.getCPtr(config)); if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve(); return ret; }
public void fromConfig(string txt, Searchable env) { yarpPINVOKE.Property_fromConfig__SWIG_3(swigCPtr, txt, Searchable.getCPtr(env)); if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve(); }
private IEnumerable <T> EnumerateHits <T>(TopDocs hits, QueryExecutionContext executionContext, Searchable searcher, IRetrievedDocumentTracker <TDocument> tracker, ItemHolder itemHolder, int skipResults, Func <TDocument, T> projector) { for (var i = skipResults; i < hits.ScoreDocs.Length; i++) { executionContext.CurrentHit = i; executionContext.CurrentScoreDoc = hits.ScoreDocs[i]; var docNum = hits.ScoreDocs[i].Doc; var document = searcher.Doc(docNum); if (tracker == null) { itemHolder.Current = ConvertDocument(document, executionContext); yield return(projector(itemHolder.Current)); continue; } var key = GetDocumentKey(document, executionContext); if (tracker.IsMarkedForDeletion(key)) { continue; } TDocument item; if (!tracker.TryGetTrackedDocument(key, out item)) { item = ConvertDocument(document, executionContext); tracker.TrackDocument(key, item, document); } itemHolder.Current = item; yield return(projector(itemHolder.Current)); } }
public bool fromConfigFile(string fname, Searchable env) { bool ret = yarpPINVOKE.Property_fromConfigFile__SWIG_3(swigCPtr, fname, Searchable.getCPtr(env)); if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve(); return ret; }
public SearchResult<SalesTerritory> Search(Searchable<SalesTerritorySearcher> searchData) { return QueryHelper.ApplyGenericSearch(HDSMobileAppDataStores.SalesTerritory, Logger, SearchMethodName, searchData.searchRange, searchData.searchCriteria, "territoryId", this.ConstructQueryConditions); }
// used to be from MVC controller to let the building know its been clicked public void imClicked() { if (_Team == 2) { return; } // Debug.Log("Building is Clicked state is" + eState); if (eState == BuildingState.Built) { //Create a new menu interaction on a built object, downgrade? Demolish? Show resource output etc. Needs Something if (eType == BuildingType.GarbageCan || eType == BuildingType.WoodPile || eType == BuildingType.StonePile) { if (getEmployeeCount() == 0) // if someone is working here, player cant gather { //Debug.Log("I am gathering!"); Searchable s = GetComponent <Searchable>(); if (s) { // s.GatherAction(20); s.ImClicked(); // should use ImClicked instead of GatherAction and encapsulate gather action into searchables functionality } } } else if (eType == BuildingType.Outpost && _cameraController.getOverrideMode()) { bOutpost outpost = GetComponent <bOutpost>(); if (outpost.getSelected()) { setOutlineSelected(); UITroopSelection.Instance.addTroops(getEmployeeCount()); } else { setOutlineAvailable(); UITroopSelection.Instance.addTroops(0 - getEmployeeCount()); } } else { StartCoroutine(ClickDelay(true, _DestroyMenu)); StartCoroutine(ClickDelay(false, _BuildMenu)); StartCoroutine(ClickDelay(false, _BuildingCapMenu)); } } else if (eState == BuildingState.Available || eState == BuildingState.Idle) { // Turns off the "notification exclamation mark" as the player is now aware of obj eState = BuildingState.Idle; //check if we can afford a building slot if (ResourceManagerScript.Instance.getNoBuildingSlots() < GameManager.Instance.GetBuildingCap()) { StartCoroutine(ClickDelay(true, _BuildMenu)); } else { //TO-DO: Show new menu that tells player at cap and to upgrade TC StartCoroutine(ClickDelay(true, _BuildingCapMenu)); } StartCoroutine(ClickDelay(false, _DestroyMenu)); //Disconnect here, MVC controller is now responsible for talking to UI } else if (eState == BuildingState.Building) { //IncrementConstruction(1); //Show a menu that asks to spend a shiny to increment _InstanceConstructionButton.SetActive(true); MVCController.Instance.setLastInstantConstruction(_InstanceConstructionButton); } if (!_cameraController.getOverrideMode()) { UpdateState(); } }
public override List <Searchable> getPathToDataControl(Searchable dataControl) { return(getPathFromChild(dataControl, exitsDataControlList.Cast <System.Object>().ToList())); }
public SearchForm(Searchable searchable) { InitializeComponent(); this.searchable = searchable; }
public AttackState(Enemy enemy, Searchable searchable) : base(enemy, searchable) { CurrentState = "Attack"; }
public override List <Searchable> getPathToDataControl(Searchable dataControl) { List <Searchable> path = getPathFromSearchableChild(dataControl, exitLookDataControl); return(path); }
public override List <Searchable> getPathToDataControl(Searchable dataControl) { return(getPathFromChild(dataControl, conversationsDataControlList.Cast <Searchable>().ToList())); }
public HitState(Enemy enemy, float keepTime, float delay, Searchable searchable) : base(enemy, searchable) { CurrentState = "Hit"; _keepTime = keepTime; _delay = delay; }
/// <summary>Creates a searchable which searches <i>searchables</i>. </summary> public ParallelMultiSearcher(Searchable[] searchables) : base(searchables) { this.searchables = searchables; this.starts = GetStarts(); }
public SearchResult<Person> Search(Searchable<PersonSearcher> searchData) { return QueryHelper.ApplyGenericSearch(HDSMobileAppDataStores.Person, Logger, SearchMethodName, searchData.searchRange, searchData.searchCriteria, "businessEntityId", this.ConstructQueryConditions); }
public EnemyState(Enemy enemy, Searchable searchable = null) : base(enemy) { _enemy = enemy; _searchable = searchable; }
public DuplicateDocumentRecorder(Searchable indexSearcher, Index parent, HashSet<string> documentsAlreadySeenInPreviousPage, HashSet<RavenJObject> alreadyReturned, FieldsToFetch fieldsToFetch, bool isProjectionOrMapReduce) { this.indexSearcher = indexSearcher; this.parent = parent; this.isProjectionOrMapReduce = isProjectionOrMapReduce; this.alreadyReturned = alreadyReturned; this.fieldsToFetch = fieldsToFetch; this.documentsAlreadySeenInPreviousPage = documentsAlreadySeenInPreviousPage; }
private IList<int> BuildSearchResult(TopDocs topDocs, Searchable indexSearcher) { var total = topDocs.TotalHits; var result = new List<int>(); for (int i = 0; i < total; i++) { if (i == this.configuracoesDaAplicacao.ResultadoMaximoConsulta) { break; } var docIndex = topDocs.ScoreDocs[i].Doc; var doc = indexSearcher.Doc(docIndex); result.Add(doc.Get("documentoId").ToInt()); } return result; }
/* Open the device driver and start communication with the hardware. @param config is a Searchable object containing the list of parameters. @return true on success/failure. */ bool open(Searchable config) { Searchable p = config; if (!p.check ("GENERAL", "section for general motor control parameters")) { Debug.Log ("Cannot understand configuration parameters"); return false; } //int TypeArm = p.findGroup("GENERAL").check("Type",Value(1),"what did the user select?").asInt(); //Debug.Log (TypeArm); return true; }
private static IEnumerable<Guid> _mapLuceneToDataList(IEnumerable<ScoreDoc> hits, Searchable searcher) { return hits.Select(hit => _mapLuceneDocumentToData(searcher.Doc(hit.Doc))).ToList(); }
public virtual Searchable getConnectionModifiers() { Searchable ret = new Searchable(yarpPINVOKE.ConnectionReader_getConnectionModifiers(swigCPtr), false); return(ret); }
public override List <Searchable> getPathToDataControl(Searchable dataControl) { throw new NotImplementedException(); }
public CinematicState(Enemy enemy, Searchable searchable) : base(enemy, searchable) { }
public override void SetUp() { base.SetUp(); // create MultiSearcher from two seperate searchers Directory d1 = new RAMDirectory(); IndexWriter iw1 = new IndexWriter(d1, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED); AddCollection1(iw1); iw1.Close(); Directory d2 = new RAMDirectory(); IndexWriter iw2 = new IndexWriter(d2, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED); AddCollection2(iw2); iw2.Close(); Searchable[] s = new Searchable[2]; s[0] = new IndexSearcher(d1); s[1] = new IndexSearcher(d2); multiSearcher = new MultiSearcher(s); // create IndexSearcher which contains all documents Directory d = new RAMDirectory(); IndexWriter iw = new IndexWriter(d, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED); AddCollection1(iw); AddCollection2(iw); iw.Close(); singleSearcher = new IndexSearcher(d); }
public abstract List <Searchable> getPathToDataControl(Searchable dataControl);