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; } } } }
public void setPointValue(Definition.pointEnum aPointValue) { this.pointValue = aPointValue; }
public Point() { this.xPoint = -1; this.yPoint = -1; this.pointValue = Definition.pointEnum.UNDEFINED; }