Ok, I'm probably going about this all wrong, but I can't seem to find a good solution, so any pointers would help. I have the following statement in my code:
foreach (MapGraphItem room in rndOrderRooms)
{
if (!room._flags.IsFlagSet(GlobalValues.MapTileType.start) && !room._flags.IsFlagSet(GlobalValues.MapTileType.exit)
&& ((_thisRoom.Item2 == 'N') ? room._north : (_thisRoom.Item2 == 'S') ? room._south : (_thisRoom.Item2 == 'E') ? room._east : room._west)
&& ((mapOpenings.Count < 4)) ? !room._flags.IsFlagSet(GlobalValues.MapTileType.deadend) : *ignore this section*)
{
roomMGI = room;
earlyRooms.Add(room);
goto Exit;
}
}
Basically, the *ignore this section* area means I want nothing to happen.
In other words, assuming the first two lines of the if are correct, if the .Count is less than four, there's an additional condition. If .Count is four or more, that condition is not needed.
I can't set it to the opposite, just room._flags.IsFlagSet(GlobalValues.MapTileType.deadend) because I don't want it to be forced to be a dead end. I just want to make sure that it's NOT a dead end if there are fewer than four mapOpening left.
Aucun commentaire:
Enregistrer un commentaire