Beispiel #1
0
    public LoupOmega randomLoupOmegaSeen()
    {
        List <Living> percepts = perceptView.getLiving();
        int           nbOmega  = 0;

        for (int i = 0; i < percepts.Count; ++i)
        {
            if (percepts[i] as LoupOmega != null)
            {
                nbOmega++;
            }
        }
        int       indiceOmega = Random.Range(1, nbOmega);
        LoupOmega result      = null;

        if (nbOmega > 0)
        {
            for (int i = 0; i < percepts.Count; ++i)
            {
                result = percepts[i] as LoupOmega;
                if (result != null)
                {
                    indiceOmega--;
                    if (indiceOmega == 0)
                    {
                        break;
                    }
                }
            }
        }
        return(result);
    }
Beispiel #2
0
    protected override void randomAction()
    {
        LoupOmega random = ((Loup)agent).randomLoupOmegaSeen();

        if (random != null && Random.Range(1, 3) == 1)
        {
            actionList.addAction(new A_TaquinerOmega(random));
        }
        else
        {
            base.randomAction();
        }
    }
Beispiel #3
0
 public A_TaquinerOmega(LoupOmega cible)
     : base("A_TaquinerOmega")
 {
     this.cible = cible;
 }
Beispiel #4
0
 public MindLoupOmega(LoupOmega agent)
     : base(agent)
 {
 }