public List<GameObject> getNearbyFilteredObjects(float radius, AgentClassification classification)
 {
     List<GameObject> objects = new List<GameObject>();
     foreach(SensableObject obj in groupMembers.GetObjectsInRadius(this.getLegs ().myTrans.position, radius)) {
         if(obj.obj == getLegs().gameObject) {
             continue;
         }
         if(obj.classification == classification) {
             objects.Add(obj.obj);
         }
     }
     return objects;
 }
Exemplo n.º 2
0
    //check if there are wolf, sheep or sheperd, unknown object in SensedObject array
    public bool isContainAgent(AgentClassification type)
    {
        foreach (SensedObject obj in GetSensedObjects())
        {
            if (obj.getAgentType().Equals(type))
            {
                return true;
            }
        }

        return false;
    }
Exemplo n.º 3
0
 public SensedObject(GameObject obj, AgentClassification newType)
 {
     sensedObject = obj;
     type = newType;
 }
Exemplo n.º 4
0
 public SensedObject(GameObject obj)
 {
     sensedObject = obj;
     type = AgentClassification.Unknown;
 }