public void ScanAll(int deltaCount, FastList<LSAgent> outputAgents,
		                      bool CheckAllegiance = false,
		                      AllegianceType allegianceType = AllegianceType.Neutral)
        {
            for (i = 0; i < deltaCount; i++) {
                tempNode = GridManager.GetNode (
                    LocatedNode.gridX + DeltaCache.CacheX[i],
                    LocatedNode.gridY + DeltaCache.CacheY[i]);

                if (tempNode != null && tempNode.LocatedAgents != null) {
                    tempBucket = tempNode.LocatedAgents;
                    for (j = 0; j < tempBucket.PeakCount; j++) {
                        if (LSUtility.GetBitTrue (tempBucket.arrayAllocation, j)) {
                            tempAgent = tempBucket.innerArray [j].Agent;
                            if (System.Object.ReferenceEquals (tempAgent, Agent) == false) {
                                if (CheckAllegiance)
                                {
                                    if (Agent.MyAgentController.DiplomacyFlags
                                        [tempAgent.MyAgentController.ControllerID] != allegianceType) continue;
                                }
                                outputAgents.Add (tempAgent);
                            }
                        }
                    }
                }
            }
        }
 public InfluenceBucketEnumerator(InfluencerBucket bucket)
 {
     _bucket = bucket;
 }
Exemplo n.º 3
0
 public bool Add(LSInfluencer influencer)
 {
     if (System.Object.ReferenceEquals (LocatedAgents,null))
     {
         LocatedAgents = new InfluencerBucket();
     }
     return LocatedAgents.Add(influencer);
 }