MCPcopy Create free account
hub / github.com/SimHacker/micropolis / makeTrafficAt

Method makeTrafficAt

MicropolisCore/src/MicropolisEngine/src/traffic.cpp:83–95  ·  view source on GitHub ↗

* Makes traffic starting from the road tile at \x, \y. * @param x Start x position of the attempt * @param y Start y position of the attempt * @param dest Zone type to go to. * @return \c 1 if connection found, \c 0 if not found, * \c -1 if no connection to road found. */

Source from the content-addressed store, hash-verified

81 * \c -1 if no connection to road found.
82 */
83short Micropolis::makeTrafficAt(int x, int y, ZoneType dest)
84{
85 Position pos;
86 pos.posX = x;
87 pos.posY = y;
88
89 if (tryDrive(pos, dest)) { /* attempt to drive somewhere */
90 addToTrafficDensityMap(); /* if sucessful, inc trafdensity */
91 return 1; /* traffic passed */
92 }
93
94 return 0; /* traffic failed */
95}
96
97
98/**

Callers 2

simulateMethod · 0.80
simulateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected