Agent.Program.listContainsByReferenceEquals C# (CSharp) Метод

listContainsByReferenceEquals() приватный статический Метод

private static listContainsByReferenceEquals ( AgentType agent, ISpatialCollection neighbors ) : bool
agent AgentType
neighbors ISpatialCollection
Результат bool
    private static bool listContainsByReferenceEquals(AgentType agent, ISpatialCollection<AgentType> neighbors)
    {
      foreach(AgentType neighbor in neighbors) {
          if(Object.ReferenceEquals(agent, neighbor)) {
            return true;
          }
      }
      return false;
      
    }
  }