MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getRandomMapEdgeCoordinates

Method getRandomMapEdgeCoordinates

game/state/city/vehiclemission.cpp:2992–3018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2990}
2991
2992Vec3<float> VehicleMission::getRandomMapEdgeCoordinates(GameState &state, StateRef<City> city)
2993{
2994 if (randBool(state.rng))
2995 {
2996 std::uniform_int_distribution<int> xPos(0, city->size.x - 1);
2997 if (randBool(state.rng))
2998 {
2999 return {xPos(state.rng), 0, city->size.z - 1};
3000 }
3001 else
3002 {
3003 return {xPos(state.rng), city->size.y - 1, city->size.z - 1};
3004 }
3005 }
3006 else
3007 {
3008 std::uniform_int_distribution<int> yPos(0, city->size.y - 1);
3009 if (randBool(state.rng))
3010 {
3011 return {0, yPos(state.rng), city->size.z - 1};
3012 }
3013 else
3014 {
3015 return {city->size.x - 1, yPos(state.rng), city->size.z - 1};
3016 }
3017 }
3018}
3019
3020bool VehicleMission::acquireTargetBuilding(GameState &state, Vehicle &v)
3021{

Callers

nothing calls this directly

Calls 1

randBoolFunction · 0.85

Tested by

no test coverage detected