Exemple #1
0
    public void updateMentalMapEntity()
    {
        int widthIndex, heightIndex;

        for (widthIndex = 0; widthIndex < this.diameter; widthIndex++)
        {
            for (heightIndex = 0; heightIndex < this.diameter; heightIndex++)
            {
                int pointWidth  = this.fieldOfView[widthIndex, heightIndex].getXPoint();
                int pointHeight = this.fieldOfView[widthIndex, heightIndex].getYPoint();
                Definition.pointEnum pointValue = this.fieldOfView[widthIndex, heightIndex].getPointValue();

                if (pointWidth >= 0 && pointWidth < this.width && pointHeight >= 0 && pointHeight < this.height)
                {
                    int mentalMapPoint = this.mentalMap[pointWidth, pointHeight];

                    //Check if the old value of the point was FOG before updating it
                    if (mentalMapPoint == (int)Definition.pointEnum.FOG)
                    {
                        this.mentalMap[pointWidth, pointHeight] = (int)pointValue;
                    }

                    this.mentalMap[this.xEntity, this.yEntity] = (int)Definition.pointEnum.VISITED;
                }
            }
        }
    }
Exemple #2
0
 public void setPointValue(Definition.pointEnum aPointValue)
 {
     this.pointValue = aPointValue;
 }
Exemple #3
0
 public Point()
 {
     this.xPoint     = -1;
     this.yPoint     = -1;
     this.pointValue = Definition.pointEnum.UNDEFINED;
 }