Esempio n. 1
0
    //Get positive stimuli from the level
    public List <PositiveStimuli> GetStimuli(flockMember member, float radius)
    {
        List <PositiveStimuli> returnStimuli = new List <PositiveStimuli>();

        foreach (var stimuli in pstimulis)
        {
            if (Vector3.Distance(member.position, stimuli.position) <= radius)
            {
                returnStimuli.Add(stimuli);
            }
        }
        return(returnStimuli);
    }
Esempio n. 2
0
    //Get enemies from the level inside the radius defined
    public List <InvisibleNegativeStimuli> GetEnemies(flockMember member, float radius)
    {
        List <InvisibleNegativeStimuli> returnEnemies = new List <InvisibleNegativeStimuli>();

        foreach (var enemy in enemies)
        {
            if (Vector3.Distance(member.position, enemy.position) <= radius)
            {
                returnEnemies.Add(enemy);
            }
        }
        return(returnEnemies);
    }
Esempio n. 3
0
    //Get the neighbours (birds) that are inside the redius defined
    public List <flockMember> GetNeighbours(flockMember member, float radius)
    {
        List <flockMember> neighboursFound = new List <flockMember>();

        foreach (var otherMember in members)
        {
            if (otherMember == member)
            {
                continue;
            }
            //check if they are within the defined distance
            if (Vector3.Distance(member.position, otherMember.position) <= radius)
            {
                neighboursFound.Add(otherMember);
            }
        }
        //returns list of birds within the radious defined
        return(neighboursFound);
    }