This... >>>
Code:
class SearchArea
{
public:
int Fscore; // total value to asses select node or not
int Gscore; // movement cost
int Hscore; // heurestic
int Walkstate; // is it valid terrain
int Liststate; // is it available? on open or closed list
bool Nodestate; // is it available for use?
bool STnode; // is it a / the search start point
bool TGnode; // is it a / the search target point
int Xcord; // map node X (across) location
int Ycord; // map node Y (down) location
int ParentPOS; // point to parent node
SearchArea()
{
Fscore = 0;
Gscore = 20;
Hscore = 0;
Walkstate = 1;
Liststate = 2; //Neutral until node is accessed then 0 or 1
Nodestate = true;
STnode = false;
TGnode = false;
Xcord = 0;
Ycord = 0;
ParentPOS = 0;
}
};
means i can get rid of this ! >>
Code:
for(dwn = 0; dwn < dwnMax; dwn++)
{
for(acr = 0; acr < acrMax; acr++)
{
mapnode[dwn][acr].Xcord = acr;
mapnode[dwn][acr].Ycord = dwn;
mapnode[dwn][acr].Walkstate = 1;
mapnode[dwn][acr].Nodestate = true;
mapnode[dwn][acr].STnode = false;
mapnode[dwn][acr].TGnode = false;
// next membervar
// next membervar
// blah
// blah blah
// ad nauseum..
}
}
Magic, i love it! thanks for the advice. i think maybe all the members should be private really.