Micropolis
emscripten.cpp
Go to the documentation of this file.
1/* emscripten.cpp
2 *
3 * Micropolis, Unix Version. This game was released for the Unix platform
4 * in or about 1990 and has been modified for inclusion in the One Laptop
5 * Per Child program. Copyright (C) 1989 - 2007 Electronic Arts Inc. If
6 * you need assistance with this program, you may contact:
7 * http://wiki.laptop.org/go/Micropolis or email micropolis@laptop.org.
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or (at
12 * your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details. You should have received a
18 * copy of the GNU General Public License along with this program. If
19 * not, see <http://www.gnu.org/licenses/>.
20 *
21 * ADDITIONAL TERMS per GNU GPL Section 7
22 *
23 * No trademark or publicity rights are granted. This license does NOT
24 * give you any right, title or interest in the trademark SimCity or any
25 * other Electronic Arts trademark. You may not distribute any
26 * modification of this program using the trademark SimCity or claim any
27 * affliation or association with Electronic Arts Inc. or its employees.
28 *
29 * Any propagation or conveyance of this program must include this
30 * copyright notice and these terms.
31 *
32 * If you convey this program (or any modifications of it) and assume
33 * contractual liability for the program to recipients of it, you agree
34 * to indemnify Electronic Arts for any liability that those contractual
35 * assumptions impose on Electronic Arts.
36 *
37 * You may not misrepresent the origins of this program; modified
38 * versions of the program must be marked as such and not identified as
39 * the original program.
40 *
41 * This disclaimer supplements the one included in the General Public
42 * License. TO THE FULLEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW, THIS
43 * PROGRAM IS PROVIDED TO YOU "AS IS," WITH ALL FAULTS, WITHOUT WARRANTY
44 * OF ANY KIND, AND YOUR USE IS AT YOUR SOLE RISK. THE ENTIRE RISK OF
45 * SATISFACTORY QUALITY AND PERFORMANCE RESIDES WITH YOU. ELECTRONIC ARTS
46 * DISCLAIMS ANY AND ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES,
47 * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY,
48 * FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY
49 * RIGHTS, AND WARRANTIES (IF ANY) ARISING FROM A COURSE OF DEALING,
50 * USAGE, OR TRADE PRACTICE. ELECTRONIC ARTS DOES NOT WARRANT AGAINST
51 * INTERFERENCE WITH YOUR ENJOYMENT OF THE PROGRAM; THAT THE PROGRAM WILL
52 * MEET YOUR REQUIREMENTS; THAT OPERATION OF THE PROGRAM WILL BE
53 * UNINTERRUPTED OR ERROR-FREE, OR THAT THE PROGRAM WILL BE COMPATIBLE
54 * WITH THIRD PARTY SOFTWARE OR THAT ANY ERRORS IN THE PROGRAM WILL BE
55 * CORRECTED. NO ORAL OR WRITTEN ADVICE PROVIDED BY ELECTRONIC ARTS OR
56 * ANY AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY. SOME
57 * JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF OR LIMITATIONS ON IMPLIED
58 * WARRANTIES OR THE LIMITATIONS ON THE APPLICABLE STATUTORY RIGHTS OF A
59 * CONSUMER, SO SOME OR ALL OF THE ABOVE EXCLUSIONS AND LIMITATIONS MAY
60 * NOT APPLY TO YOU.
61 */
62
81
82
83#include <emscripten/bind.h>
84#include "micropolis.h"
85#include "js_callback.h"
86
87
89
90
91using namespace emscripten;
92
93
95// This file uses emscripten's embind to bind C++ classes,
96// C structures, functions, enums, and contents into JavaScript,
97// so you can even subclass C++ classes in JavaScript,
98// for implementing plugins and user interfaces.
99//
100// Wrapping the entire Micropolis class from the Micropolis (open-source
101// version of SimCity) code into Emscripten for JavaScript access is a
102// large and complex task, mainly due to the size and complexity of the
103// class. The class encompasses almost every aspect of the simulation,
104// including map generation, simulation logic, user interface
105// interactions, and more.
106//
107// Strategy for Wrapping
108//
109// 1. Core Simulation Logic: Focus on the core simulation aspects, such
110// as the methods to run the simulation, update game states, and handle
111// user inputs (like building tools and disaster simulations). This is
112// crucial for any gameplay functionality.
113//
114// 2. Memory and Performance Considerations: JavaScript and WebAssembly
115// run in a browser context, which can have memory limitations and
116// performance constraints. Carefully manage memory allocation,
117// especially when dealing with the game's map and various buffers.
118//
119// 3. Direct Memory Access: Provide JavaScript access to critical game
120// data structures like the map buffer for efficient reading and
121// writing. This can be done using Emscripten's heap access functions
122// (HEAP8, HEAP16, HEAP32, etc.).
123//
124// 4. User Interface and Rendering: This part might not be necessary to
125// wrap, as modern web technologies (HTML, CSS, WebGL) can be used for
126// UI. However, providing some hooks for game state (like score, budget,
127// etc.) to JavaScript might be helpful.
128//
129// 5. Callbacks and Interactivity: Ensure that key game events and
130// callbacks are exposed to JavaScript, allowing for interactive and
131// responsive gameplay.
132//
133// 6. Optimizations: Where possible, optimize C++ code for WebAssembly,
134// focusing on critical paths in the simulation loop.
135//
136// Decisions and Explanations
137//
138// - Excluded Elements:
139//
140// - Low-level rendering or platform-specific code, as this can be
141// handled more efficiently with web technologies.
142//
143// - Parts of the code that handle file I/O directly, as file access
144// in a web context is typically handled differently (e.g., using
145// browser APIs or server-side support).
146//
147// - Any networking or multiplayer code, as web-based
148// implementations would differ significantly from desktop-based
149// network code.
150//
151// - Included Elements:
152//
153// - Core game mechanics, such as map generation, zone simulation
154// (residential, commercial, industrial), disaster simulation, and
155// basic utilities.
156//
157// - Game state management, including budgeting, scoring, and city
158// evaluation.
159//
160// - Direct memory access to critical structures like the map
161// buffer, allowing efficient manipulation from JavaScript.
162//
163// - Essential callbacks and event handling mechanisms to ensure
164// interactivity.
165//
166// Conclusion
167//
168// Given the complexity and size of the Micropolis class, wrapping the
169// entire class directly is impractical. However, focusing on key areas
170// essential for gameplay and providing efficient interfaces for
171// critical data structures can create a functional and interactive city
172// simulation in a web context. Further optimizations and adjustments
173// would likely be needed based on testing and specific requirements of
174// the web implementation.
175//
176// Implementation Notes
177//
178// The enum_, class_, constructor, function, and property functions
179// from the emscripten namespace are used to specify how C++
180// constructs should be exposed to JavaScript. You can use these to
181// control which parts of your code are accessible and how they should
182// be used from JavaScript.
183//
184// I've made some assumptions here:
185//
186// The types MapValue and MapTile are simple types (like integers or
187// floats). If they are complex types, they would need their own
188// bindings.
189//
190// I'm assuming that the copy constructor and copy assignment
191// operator for the Position class are correctly implemented. If
192// they aren't, then the Position object may not behave as expected
193// in JavaScript.
194//
195// Micropolis Binding Design
196//
197// The Micropolis interface organizes the Micropolis class header into
198// categories of functions that are relevant for interaction with the
199// JavaScript user interface, scripts, or plugins. The aim is to expose
200// functions that could help in monitoring and controlling game state
201// effectively.
202//
203// - Exposed to JavaScript (Public Interface)
204// - Simulation Control and Settings
205// - void simTick()
206// - void setSpeed(short speed)
207// - void setGameLevel(GameLevel level)
208// - void setCityName(const std::string &name)
209// - void setYear(int year)
210// - void pause()
211// - void resume()
212// - void setEnableDisasters(bool value)
213// - void setAutoBudget(bool value)
214// - void setAutoBulldoze(bool value)
215// - void setAutoGoto(bool value)
216// - void setEnableSound(bool value)
217// - void setDoAnimation(bool value)
218// - void doNewGame()
219// - void doBudget()
220// - void doScoreCard()
221// - void updateFunds()
222// - Gameplay Mechanics
223// - void doTool(EditingTool tool, short tileX, short tileY)
224// - void generateMap(int seed)
225// - void clearMap()
226// - void makeDisaster(DisasterType type)
227// - void getDemands(float *resDemandResult, float *comDemandResult, float *indDemandResult)
228// - Random Number Generation
229// - int simRandom()
230// - int getRandom(short range)
231// - int getRandom16()
232// - int getRandom16Signed()
233// - short getERandom(short limit)
234// - void randomlySeedRandom()
235// - void seedRandom(int seed)
236// - Game State and Data Access
237// - int getTile(int x, int y)
238// - void setTile(int x, int y, int tile)
239// - void setFunds(Quad dollars)
240// - Quad getCityPopulation()
241// - void updateMaps()
242// - void updateGraphs()
243// - void updateEvaluation()
244// - void updateBudget()
245// - Events and Callbacks
246// - void sendMessage(short messageNumber, short x = NOWHERE, short y = NOWHERE)
247// - void makeSound(std::string channel, std::string sound, int x = -1, int y = -1)
248// - Hidden from JavaScript (Private Interface)
249// - Internal Simulation Mechanics
250// - void simFrame()
251// - void simulate()
252// - void doSimInit()
253// - void setValves()
254// - void clearCensus()
255// - void collectTax()
256// - void mapScan(int x1, int x2)
257// - Utility Functions
258// - void initMapArrays()
259// - void destroyMapArrays()
260// - void initSimMemory()
261// - void initGraphs()
262// - Zone Handling
263// - void doZone(const Position &pos)
264// - void doResidential(const Position &pos, bool zonePower)
265// - void doCommercial(const Position &pos, bool zonePower)
266// - void doIndustrial(const Position &pos, bool zonePower)
267// - Disaster Simulation
268// - void doDisasters()
269// - void scenarioDisaster()
270// - void fireAnalysis()
271// - void makeFire()
272// - void makeFlood()
273//
274// Conclusion
275//
276// These exposed functions provide a comprehensive interface for
277// scripting, plugins, and user interactions through JavaScript. The
278// exposed set of functions includes random number generation,
279// simulation control mechanisms, UI-triggered actions like budget
280// updates, along with essential gameplay mechanics. The private section
281// continues to encapsulate internal simulation details and complex data
282// management routines integral to the game's core mechanics.
283
284
285
286EMSCRIPTEN_BINDINGS(MicropolisEngine) {
287
288 // position.h
289
290 enum_<Direction2>("Direction2")
291 .value("INVALID", Direction2::DIR2_INVALID)
292 .value("NORTH", Direction2::DIR2_NORTH)
293 .value("NORTH_EAST", Direction2::DIR2_NORTH_EAST)
294 .value("EAST", Direction2::DIR2_EAST)
295 .value("SOUTH_EAST", Direction2::DIR2_SOUTH_EAST)
296 .value("SOUTH", Direction2::DIR2_SOUTH)
297 .value("SOUTH_WEST", Direction2::DIR2_SOUTH_WEST)
298 .value("WEST", Direction2::DIR2_WEST)
299 .value("NORTH_WEST", Direction2::DIR2_NORTH_WEST)
300 ;
301
302 class_<Position>("Position")
303 .constructor<>()
304 .constructor<int, int>()
305 .function("move", &Position::move)
306 .function("testBounds", &Position::testBounds)
307 .property("posX", &Position::posX)
308 .property("posY", &Position::posY)
309 ;
310
311 function("increment45", &increment45);
312 function("increment90", &increment90);
313 function("rotate45", &rotate45);
314 function("rotate90", &rotate90);
315 function("rotate180", &rotate180);
316
317 // tool.h
318
319 class_<ToolEffects>("ToolEffects")
320 //.constructor<Micropolis*>() // TODO: wrap
321 .function("clear", &ToolEffects::clear)
322 .function("modifyWorld", &ToolEffects::modifyWorld)
323 .function("modifyIfEnoughFunding", &ToolEffects::modifyIfEnoughFunding)
324 .function("getMapValue", select_overload<MapValue(const Position&) const>(&ToolEffects::getMapValue))
325 .function("getMapTile", select_overload<MapTile(const Position&) const>(&ToolEffects::getMapTile))
326 .function("getCost", &ToolEffects::getCost)
327 .function("addCost", &ToolEffects::addCost)
328 .function("setMapValue", select_overload<void(const Position&, MapValue)>(&ToolEffects::setMapValue))
329 //.function("addFrontendMessage", &ToolEffects::addFrontendMessage) // TODO: wrap
330 ;
331
332 enum_<MapTileBits>("MapTileBits")
333 .value("PWRBIT", PWRBIT)
334 .value("CONDBIT", CONDBIT)
335 .value("BURNBIT", BURNBIT)
336 .value("BULLBIT", BULLBIT)
337 .value("ANIMBIT", ANIMBIT)
338 .value("ZONEBIT", ZONEBIT)
339 .value("ALLBITS", ALLBITS)
340 .value("LOMASK", LOMASK)
341 .value("BLBNBIT", BLBNBIT)
342 .value("BLBNCNBIT", BLBNCNBIT)
343 .value("BNCNBIT", BNCNBIT)
344 ;
345
346 enum_<EditingTool>("EditingTool")
347 .value("TOOL_RESIDENTIAL", TOOL_RESIDENTIAL)
348 .value("TOOL_COMMERCIAL", TOOL_COMMERCIAL)
349 .value("TOOL_INDUSTRIAL", TOOL_INDUSTRIAL)
350 .value("TOOL_FIRESTATION", TOOL_FIRESTATION)
351 .value("TOOL_POLICESTATION", TOOL_POLICESTATION)
352 .value("TOOL_QUERY", TOOL_QUERY)
353 .value("TOOL_WIRE", TOOL_WIRE)
354 .value("TOOL_BULLDOZER", TOOL_BULLDOZER)
355 .value("TOOL_RAILROAD", TOOL_RAILROAD)
356 .value("TOOL_ROAD", TOOL_ROAD)
357 .value("TOOL_STADIUM", TOOL_STADIUM)
358 .value("TOOL_PARK", TOOL_PARK)
359 .value("TOOL_SEAPORT", TOOL_SEAPORT)
360 .value("TOOL_COALPOWER", TOOL_COALPOWER)
361 .value("TOOL_NUCLEARPOWER", TOOL_NUCLEARPOWER)
362 .value("TOOL_AIRPORT", TOOL_AIRPORT)
363 .value("TOOL_NETWORK", TOOL_NETWORK)
364 .value("TOOL_WATER", TOOL_WATER)
365 .value("TOOL_LAND", TOOL_LAND)
366 .value("TOOL_FOREST", TOOL_FOREST)
367 .value("TOOL_COUNT", TOOL_COUNT)
368 .value("TOOL_FIRST", TOOL_FIRST)
369 .value("TOOL_LAST", TOOL_LAST);
370 ;
371
372 // map_type.h
373 class_<Map<Byte, 1>>("MapByte1")
374 .constructor<Byte>()
375 .property("MAP_BLOCKSIZE", &Map<Byte, 1>::MAP_BLOCKSIZE)
376 .property("MAP_W", &Map<Byte, 1>::MAP_W)
377 .property("MAP_H", &Map<Byte, 1>::MAP_H)
378 .function("fill", &Map<Byte, 1>::fill)
379 .function("clear", &Map<Byte, 1>::clear)
380 .function("set", &Map<Byte, 1>::set)
381 .function("get", &Map<Byte, 1>::get)
382 .function("onMap", &Map<Byte, 1>::onMap)
383 .function("worldSet", &Map<Byte, 1>::worldSet)
384 .function("worldGet", &Map<Byte, 1>::worldGet)
385 .function("worldOnMap", &Map<Byte, 1>::worldOnMap)
386 //.function("getBase", &Map<Byte, 1>::getBase, allow_raw_pointers()) // TODO: wrap
387 .function("getTotalByteSize", &Map<Byte, 1>::getTotalByteSize)
388 ;
389
390 class_<Map<Byte, 2>>("MapByte2")
391 .constructor<Byte>()
392 .property("MAP_BLOCKSIZE", &Map<Byte, 2>::MAP_BLOCKSIZE)
393 .property("MAP_W", &Map<Byte, 2>::MAP_W)
394 .property("MAP_H", &Map<Byte, 2>::MAP_H)
395 .function("fill", &Map<Byte, 2>::fill)
396 .function("clear", &Map<Byte, 2>::clear)
397 .function("set", &Map<Byte, 2>::set)
398 .function("get", &Map<Byte, 2>::get)
399 .function("onMap", &Map<Byte, 2>::onMap)
400 .function("worldSet", &Map<Byte, 2>::worldSet)
401 .function("worldGet", &Map<Byte, 2>::worldGet)
402 .function("worldOnMap", &Map<Byte, 2>::worldOnMap)
403 //.function("getBase", &Map<Byte, 2>::getBase, allow_raw_pointers()) // TODO: wrap
404 .function("getTotalByteSize", &Map<Byte, 2>::getTotalByteSize)
405 ;
406
407 class_<Map<Byte, 4>>("MapByte4")
408 .constructor<Byte>()
409 .property("MAP_BLOCKSIZE", &Map<Byte, 4>::MAP_BLOCKSIZE)
410 .property("MAP_W", &Map<Byte, 4>::MAP_W)
411 .property("MAP_H", &Map<Byte, 4>::MAP_H)
412 .function("fill", &Map<Byte, 4>::fill)
413 .function("clear", &Map<Byte, 4>::clear)
414 .function("set", &Map<Byte, 4>::set)
415 .function("get", &Map<Byte, 4>::get)
416 .function("onMap", &Map<Byte, 4>::onMap)
417 .function("worldSet", &Map<Byte, 4>::worldSet)
418 .function("worldGet", &Map<Byte, 4>::worldGet)
419 .function("worldOnMap", &Map<Byte, 4>::worldOnMap)
420 //.function("getBase", &Map<Byte, 4>::getBase, allow_raw_pointers()) // TODO: wrap
421 .function("getTotalByteSize", &Map<Byte, 4>::getTotalByteSize)
422 ;
423
424 class_<Map<short, 8>>("MapShort8")
425 .constructor<short>()
426 .property("MAP_BLOCKSIZE", &Map<short, 8>::MAP_BLOCKSIZE)
427 .property("MAP_W", &Map<short, 8>::MAP_W)
428 .property("MAP_H", &Map<short, 8>::MAP_H)
429 .function("fill", &Map<short, 8>::fill)
430 .function("clear", &Map<short, 8>::clear)
431 .function("set", &Map<short, 8>::set)
432 .function("get", &Map<short, 8>::get)
433 .function("onMap", &Map<short, 8>::onMap)
434 .function("worldSet", &Map<short, 8>::worldSet)
435 .function("worldGet", &Map<short, 8>::worldGet)
436 .function("worldOnMap", &Map<short, 8>::worldOnMap)
437 //.function("getBase", &Map<short, 8>::getBase, allow_raw_pointers()) // TODO: wrap
438 .function("getTotalByteSize", &Map<short, 8>::getTotalByteSize)
439 ;
440
441/*
442
443function createTypedArrayFromMap(mapInstance) {
444 var pointer = mapInstance.getBase();
445 var byteSize = mapInstance.getTotalByteSize();
446 var mapSize = mapInstance.MAP_W * mapInstance.MAP_H;
447 var arrayType;
448
449 // Determine the correct Typed Array type based on DATA type
450 if (byteSize === mapSize) {
451 arrayType = Uint8Array;
452 } else if (byteSize === mapSize * 2) {
453 arrayType = Uint16Array;
454 } else {
455 console.error("Unsupported data type for Typed Array.");
456 return null;
457 }
458
459 var typedArray = new arrayType(Module.HEAPU8.buffer, pointer, byteSize / arrayType.BYTES_PER_ELEMENT);
460 return typedArray;
461}
462
463*/
464
465 // text.h
466
467 enum_<Stri202>("Stri202")
468 .value("STR202_POPULATIONDENSITY_LOW", STR202_POPULATIONDENSITY_LOW) // 0: Low
469 .value("STR202_POPULATIONDENSITY_MEDIUM", STR202_POPULATIONDENSITY_MEDIUM) // 1: Medium
470 .value("STR202_POPULATIONDENSITY_HIGH", STR202_POPULATIONDENSITY_HIGH) // 2: High
471 .value("STR202_POPULATIONDENSITY_VERYHIGH", STR202_POPULATIONDENSITY_VERYHIGH) // 3: Very High
472 .value("STR202_LANDVALUE_SLUM", STR202_LANDVALUE_SLUM) // 4: Slum
473 .value("STR202_LANDVALUE_LOWER_CLASS", STR202_LANDVALUE_LOWER_CLASS) // 5: Lower Class
474 .value("STR202_LANDVALUE_MIDDLE_CLASS", STR202_LANDVALUE_MIDDLE_CLASS) // 6: Middle Class
475 .value("STR202_LANDVALUE_HIGH_CLASS", STR202_LANDVALUE_HIGH_CLASS) // 7: High
476 .value("STR202_CRIME_NONE", STR202_CRIME_NONE) // 8: Safe
477 .value("STR202_CRIME_LIGHT", STR202_CRIME_LIGHT) // 9: Light
478 .value("STR202_CRIME_MODERATE", STR202_CRIME_MODERATE) // 10: Moderate
479 .value("STR202_CRIME_DANGEROUS", STR202_CRIME_DANGEROUS) // 11: Dangerous
480 .value("STR202_POLLUTION_NONE", STR202_POLLUTION_NONE) // 12: None
481 .value("STR202_POLLUTION_MODERATE", STR202_POLLUTION_MODERATE) // 13: Moderate
482 .value("STR202_POLLUTION_HEAVY", STR202_POLLUTION_HEAVY) // 14: Heavy
483 .value("STR202_POLLUTION_VERY_HEAVY", STR202_POLLUTION_VERY_HEAVY) // 15: Very Heavy
484 .value("STR202_GROWRATE_DECLINING", STR202_GROWRATE_DECLINING) // 16: Declining
485 .value("STR202_GROWRATE_STABLE", STR202_GROWRATE_STABLE) // 17: Stable
486 .value("STR202_GROWRATE_SLOWGROWTH", STR202_GROWRATE_SLOWGROWTH) // 18: Slow Growth
487 .value("STR202_GROWRATE_FASTGROWTH", STR202_GROWRATE_FASTGROWTH) // 19: Fast Growth
488 ;
489
490 enum_<MessageNumber>("MessageNumber")
491 .value("MESSAGE_NEED_MORE_RESIDENTIAL", MESSAGE_NEED_MORE_RESIDENTIAL) // 1: More residential zones needed.
492 .value("MESSAGE_NEED_MORE_COMMERCIAL", MESSAGE_NEED_MORE_COMMERCIAL) // 2: More commercial zones needed.
493 .value("MESSAGE_NEED_MORE_INDUSTRIAL", MESSAGE_NEED_MORE_INDUSTRIAL) // 3: More industrial zones needed.
494 .value("MESSAGE_NEED_MORE_ROADS", MESSAGE_NEED_MORE_ROADS) // 4: More roads required.
495 .value("MESSAGE_NEED_MORE_RAILS", MESSAGE_NEED_MORE_RAILS) // 5: Inadequate rail system.
496 .value("MESSAGE_NEED_ELECTRICITY", MESSAGE_NEED_ELECTRICITY) // 6: Build a Power Plant.
497 .value("MESSAGE_NEED_STADIUM", MESSAGE_NEED_STADIUM) // 7: Residents demand a Stadium.
498 .value("MESSAGE_NEED_SEAPORT", MESSAGE_NEED_SEAPORT) // 8: Industry requires a Sea Port.
499 .value("MESSAGE_NEED_AIRPORT", MESSAGE_NEED_AIRPORT) // 9: Commerce requires an Airport.
500 .value("MESSAGE_HIGH_POLLUTION", MESSAGE_HIGH_POLLUTION) // 10: Pollution very high.
501 .value("MESSAGE_HIGH_CRIME", MESSAGE_HIGH_CRIME) // 11: Crime very high.
502 .value("MESSAGE_TRAFFIC_JAMS", MESSAGE_TRAFFIC_JAMS) // 12: Frequent traffic jams reported.
503 .value("MESSAGE_NEED_FIRE_STATION", MESSAGE_NEED_FIRE_STATION) // 13: Citizens demand a Fire Department.
504 .value("MESSAGE_NEED_POLICE_STATION", MESSAGE_NEED_POLICE_STATION) // 14: Citizens demand a Police Department.
505 .value("MESSAGE_BLACKOUTS_REPORTED", MESSAGE_BLACKOUTS_REPORTED) // 15: Blackouts reported. Check power map.
506 .value("MESSAGE_TAX_TOO_HIGH", MESSAGE_TAX_TOO_HIGH) // 16: Citizens upset. The tax rate is too high.
507 .value("MESSAGE_ROAD_NEEDS_FUNDING", MESSAGE_ROAD_NEEDS_FUNDING) // 17: Roads deteriorating, due to lack of funds.
508 .value("MESSAGE_FIRE_STATION_NEEDS_FUNDING", MESSAGE_FIRE_STATION_NEEDS_FUNDING) // 18: Fire departments need funding.
509 .value("MESSAGE_POLICE_NEEDS_FUNDING", MESSAGE_POLICE_NEEDS_FUNDING) // 19: Police departments need funding.
510 .value("MESSAGE_FIRE_REPORTED", MESSAGE_FIRE_REPORTED) // 20: Fire reported!
511 .value("MESSAGE_MONSTER_SIGHTED", MESSAGE_MONSTER_SIGHTED) // 21: A Monster has been sighted!!
512 .value("MESSAGE_TORNADO_SIGHTED", MESSAGE_TORNADO_SIGHTED) // 22: Tornado reported!!
513 .value("MESSAGE_EARTHQUAKE", MESSAGE_EARTHQUAKE) // 23: Major earthquake reported!!!
514 .value("MESSAGE_PLANE_CRASHED", MESSAGE_PLANE_CRASHED) // 24: A plane has crashed!
515 .value("MESSAGE_SHIP_CRASHED", MESSAGE_SHIP_CRASHED) // 25: Shipwreck reported!
516 .value("MESSAGE_TRAIN_CRASHED", MESSAGE_TRAIN_CRASHED) // 26: A train crashed!
517 .value("MESSAGE_HELICOPTER_CRASHED", MESSAGE_HELICOPTER_CRASHED) // 27: A helicopter crashed!
518 .value("MESSAGE_HIGH_UNEMPLOYMENT", MESSAGE_HIGH_UNEMPLOYMENT) // 28: Unemployment rate is high.
519 .value("MESSAGE_NO_MONEY", MESSAGE_NO_MONEY) // 29: YOUR CITY HAS GONE BROKE!
520 .value("MESSAGE_FIREBOMBING", MESSAGE_FIREBOMBING) // 30: Firebombing reported!
521 .value("MESSAGE_NEED_MORE_PARKS", MESSAGE_NEED_MORE_PARKS) // 31: Need more parks.
522 .value("MESSAGE_EXPLOSION_REPORTED", MESSAGE_EXPLOSION_REPORTED) // 32: Explosion detected!
523 .value("MESSAGE_NOT_ENOUGH_FUNDS", MESSAGE_NOT_ENOUGH_FUNDS) // 33: Insufficient funds to build that.
524 .value("MESSAGE_BULLDOZE_AREA_FIRST", MESSAGE_BULLDOZE_AREA_FIRST) // 34: Area must be bulldozed first.
525 .value("MESSAGE_REACHED_TOWN", MESSAGE_REACHED_TOWN) // 35: Population has reached 2,000.
526 .value("MESSAGE_REACHED_CITY", MESSAGE_REACHED_CITY) // 36: Population has reached 10,000.
527 .value("MESSAGE_REACHED_CAPITAL", MESSAGE_REACHED_CAPITAL) // 37: Population has reached 50,000.
528 .value("MESSAGE_REACHED_METROPOLIS", MESSAGE_REACHED_METROPOLIS) // 38: Population has reached 100,000.
529 .value("MESSAGE_REACHED_MEGALOPOLIS", MESSAGE_REACHED_MEGALOPOLIS) // 39: Population has reached 500,000.
530 .value("MESSAGE_NOT_ENOUGH_POWER", MESSAGE_NOT_ENOUGH_POWER) // 40: Brownouts, build another Power Plant.
531 .value("MESSAGE_HEAVY_TRAFFIC", MESSAGE_HEAVY_TRAFFIC) // 41: Heavy Traffic reported.
532 .value("MESSAGE_FLOODING_REPORTED", MESSAGE_FLOODING_REPORTED) // 42: Flooding reported!!
533 .value("MESSAGE_NUCLEAR_MELTDOWN", MESSAGE_NUCLEAR_MELTDOWN) // 43: A Nuclear Meltdown has occurred!!!
534 .value("MESSAGE_RIOTS_REPORTED", MESSAGE_RIOTS_REPORTED) // 44: They're rioting in the streets!!
535 .value("MESSAGE_STARTED_NEW_CITY", MESSAGE_STARTED_NEW_CITY) // 45: Started a New City.
536 .value("MESSAGE_LOADED_SAVED_CITY", MESSAGE_LOADED_SAVED_CITY) // 46: Restored a Saved City.
537 .value("MESSAGE_SCENARIO_WON", MESSAGE_SCENARIO_WON) // 47: You won the scenario.
538 .value("MESSAGE_SCENARIO_LOST", MESSAGE_SCENARIO_LOST) // 48: You lose the scenario.
539 .value("MESSAGE_ABOUT_MICROPOLIS", MESSAGE_ABOUT_MICROPOLIS) // 49: About Micropolis.
540 .value("MESSAGE_SCENARIO_DULLSVILLE", MESSAGE_SCENARIO_DULLSVILLE) // 50: Dullsville scenario.
541 .value("MESSAGE_SCENARIO_SAN_FRANCISCO", MESSAGE_SCENARIO_SAN_FRANCISCO) // 51: San Francisco scenario.
542 .value("MESSAGE_SCENARIO_HAMBURG", MESSAGE_SCENARIO_HAMBURG) // 52: Hamburg scenario.
543 .value("MESSAGE_SCENARIO_BERN", MESSAGE_SCENARIO_BERN) // 53: Bern scenario.
544 .value("MESSAGE_SCENARIO_TOKYO", MESSAGE_SCENARIO_TOKYO) // 54: Tokyo scenario.
545 .value("MESSAGE_SCENARIO_DETROIT", MESSAGE_SCENARIO_DETROIT) // 55: Detroit scenario.
546 .value("MESSAGE_SCENARIO_BOSTON", MESSAGE_SCENARIO_BOSTON) // 56: Boston scenario.
547 .value("MESSAGE_SCENARIO_RIO_DE_JANEIRO", MESSAGE_SCENARIO_RIO_DE_JANEIRO) // 57: Rio de Janeiro scenario.
548 .value("MESSAGE_LAST", MESSAGE_LAST) // 57: Last valid message
549 ;
550
551 // frontendmessage.h TODO
552
553 // The FrontendMessage class is defined as an abstract base class with pure_virtual()
554 // for the sendMessage method.
555 // FrontendMessageDidTool and FrontendMessageMakeSound are bound as subclasses of FrontendMessage.
556 // The allow_subclass method is used to register them as valid subclasses.
557 // Constructors and properties are exposed for FrontendMessageDidTool and
558 // FrontendMessageMakeSound to create instances and access their members in JavaScript.
559
560/*
561 class_<FrontendMessage>("FrontendMessage")
562 .smart_ptr<std::shared_ptr<FrontendMessage>>("shared_ptr<FrontendMessage>")
563 .allow_subclass<FrontendMessageDidTool>("FrontendMessageDidTool")
564 .allow_subclass<FrontendMessageMakeSound>("FrontendMessageMakeSound")
565 .function("sendMessage", &FrontendMessage::sendMessage, pure_virtual())
566 ;
567
568 class_<FrontendMessageDidTool, base<FrontendMessage>>("FrontendMessageDidTool")
569 .constructor<const char*, int, int>()
570 .property("tool", &FrontendMessageDidTool::tool)
571 .property("x", &FrontendMessageDidTool::x)
572 .property("y", &FrontendMessageDidTool::y)
573 ;
574
575 class_<FrontendMessageMakeSound, base<FrontendMessage>>("FrontendMessageMakeSound")
576 .constructor<const char*, const char*, int, int>()
577 .property("channel", &FrontendMessageMakeSound::channel)
578 .property("sound", &FrontendMessageMakeSound::sound)
579 .property("x", &FrontendMessageMakeSound::x)
580 .property("y", &FrontendMessageMakeSound::y)
581 ;
582*/
583
584 // micropolis.h
585
586 constant("WORLD_W", WORLD_W);
587 constant("WORLD_H", WORLD_H);
588 constant("BITS_PER_TILE", BITS_PER_TILE);
589 constant("BYTES_PER_TILE", BYTES_PER_TILE);
590 constant("WORLD_W_2", WORLD_W_2);
591 constant("WORLD_H_2", WORLD_H_2);
592 constant("WORLD_W_4", WORLD_W_4);
593 constant("WORLD_H_4", WORLD_H_4);
594 constant("WORLD_W_8", WORLD_W_8);
595 constant("WORLD_H_8", WORLD_H_8);
596 constant("EDITOR_TILE_SIZE", EDITOR_TILE_SIZE);
597 constant("PASSES_PER_CITYTIME", PASSES_PER_CITYTIME);
598 constant("CITYTIMES_PER_MONTH", CITYTIMES_PER_MONTH);
599 constant("CITYTIMES_PER_YEAR", CITYTIMES_PER_YEAR);
600 constant("HISTORY_LENGTH", HISTORY_LENGTH);
601 constant("MISC_HISTORY_LENGTH", MISC_HISTORY_LENGTH);
602 constant("HISTORY_COUNT", HISTORY_COUNT);
603 constant("POWER_STACK_SIZE", POWER_STACK_SIZE);
604 constant("NOWHERE", NOWHERE);
605 constant("ISLAND_RADIUS", ISLAND_RADIUS);
606 constant("MAX_TRAFFIC_DISTANCE", MAX_TRAFFIC_DISTANCE);
607 constant("MAX_ROAD_EFFECT", MAX_ROAD_EFFECT);
608 constant("MAX_POLICE_STATION_EFFECT", MAX_POLICE_STATION_EFFECT);
609 constant("MAX_FIRE_STATION_EFFECT", MAX_FIRE_STATION_EFFECT);
610 constant("RES_VALVE_RANGE", RES_VALVE_RANGE);
611 constant("COM_VALVE_RANGE", COM_VALVE_RANGE);
612 constant("IND_VALVE_RANGE", IND_VALVE_RANGE);
613
614 emscripten::enum_<HistoryType>("HistoryType")
615 .value("HISTORY_TYPE_RES", HISTORY_TYPE_RES)
616 .value("HISTORY_TYPE_COM", HISTORY_TYPE_COM)
617 .value("HISTORY_TYPE_IND", HISTORY_TYPE_IND)
618 .value("HISTORY_TYPE_MONEY", HISTORY_TYPE_MONEY)
619 .value("HISTORY_TYPE_CRIME", HISTORY_TYPE_CRIME)
620 .value("HISTORY_TYPE_POLLUTION", HISTORY_TYPE_POLLUTION)
621 .value("HISTORY_TYPE_COUNT", HISTORY_TYPE_COUNT)
622 ;
623
624 // HistoryScale
625 emscripten::enum_<HistoryScale>("HistoryScale")
626 .value("HISTORY_SCALE_SHORT", HISTORY_SCALE_SHORT)
627 .value("HISTORY_SCALE_LONG", HISTORY_SCALE_LONG)
628 .value("HISTORY_SCALE_COUNT", HISTORY_SCALE_COUNT)
629 ;
630
631 // MapType
632 emscripten::enum_<MapType>("MapType")
633 .value("MAP_TYPE_ALL", MAP_TYPE_ALL)
634 .value("MAP_TYPE_RES", MAP_TYPE_RES)
635 .value("MAP_TYPE_COM", MAP_TYPE_COM)
636 .value("MAP_TYPE_IND", MAP_TYPE_IND)
637 .value("MAP_TYPE_POWER", MAP_TYPE_POWER)
638 .value("MAP_TYPE_ROAD", MAP_TYPE_ROAD)
639 .value("MAP_TYPE_POPULATION_DENSITY", MAP_TYPE_POPULATION_DENSITY)
640 .value("MAP_TYPE_RATE_OF_GROWTH", MAP_TYPE_RATE_OF_GROWTH)
641 .value("MAP_TYPE_TRAFFIC_DENSITY", MAP_TYPE_TRAFFIC_DENSITY)
642 .value("MAP_TYPE_POLLUTION", MAP_TYPE_POLLUTION)
643 .value("MAP_TYPE_CRIME", MAP_TYPE_CRIME)
644 .value("MAP_TYPE_LAND_VALUE", MAP_TYPE_LAND_VALUE)
645 .value("MAP_TYPE_FIRE_RADIUS", MAP_TYPE_FIRE_RADIUS)
646 .value("MAP_TYPE_POLICE_RADIUS", MAP_TYPE_POLICE_RADIUS)
647 .value("MAP_TYPE_DYNAMIC", MAP_TYPE_DYNAMIC)
648 .value("MAP_TYPE_COUNT", MAP_TYPE_COUNT)
649 ;
650
651 // SpriteType
652 emscripten::enum_<SpriteType>("SpriteType")
653 .value("SPRITE_NOTUSED", SPRITE_NOTUSED)
654 .value("SPRITE_TRAIN", SPRITE_TRAIN)
655 .value("SPRITE_HELICOPTER", SPRITE_HELICOPTER)
656 .value("SPRITE_AIRPLANE", SPRITE_AIRPLANE)
657 .value("SPRITE_SHIP", SPRITE_SHIP)
658 .value("SPRITE_MONSTER", SPRITE_MONSTER)
659 .value("SPRITE_TORNADO", SPRITE_TORNADO)
660 .value("SPRITE_EXPLOSION", SPRITE_EXPLOSION)
661 .value("SPRITE_BUS", SPRITE_BUS)
662 .value("SPRITE_COUNT", SPRITE_COUNT)
663 ;
664
665 // ConnectTileCommand
666 emscripten::enum_<ConnectTileCommand>("ConnectTileCommand")
667 .value("CONNECT_TILE_FIX", CONNECT_TILE_FIX)
668 .value("CONNECT_TILE_BULLDOZE", CONNECT_TILE_BULLDOZE)
669 .value("CONNECT_TILE_ROAD", CONNECT_TILE_ROAD)
670 .value("CONNECT_TILE_RAILROAD", CONNECT_TILE_RAILROAD)
671 .value("CONNECT_TILE_WIRE", CONNECT_TILE_WIRE)
672 ;
673
674 // ToolResult
675 emscripten::enum_<ToolResult>("ToolResult")
676 .value("TOOLRESULT_NO_MONEY", TOOLRESULT_NO_MONEY)
677 .value("TOOLRESULT_NEED_BULLDOZE", TOOLRESULT_NEED_BULLDOZE)
678 .value("TOOLRESULT_FAILED", TOOLRESULT_FAILED)
679 .value("TOOLRESULT_OK", TOOLRESULT_OK)
680 ;
681
682 // Scenario
683 emscripten::enum_<Scenario>("Scenario")
684 .value("SC_NONE", SC_NONE)
685 .value("SC_DULLSVILLE", SC_DULLSVILLE)
686 .value("SC_SAN_FRANCISCO", SC_SAN_FRANCISCO)
687 .value("SC_HAMBURG", SC_HAMBURG)
688 .value("SC_BERN", SC_BERN)
689 .value("SC_TOKYO", SC_TOKYO)
690 .value("SC_DETROIT", SC_DETROIT)
691 .value("SC_BOSTON", SC_BOSTON)
692 .value("SC_RIO", SC_RIO)
693 .value("SC_COUNT", SC_COUNT)
694 ;
695
696 // ZoneType
697 emscripten::enum_<ZoneType>("ZoneType")
698 .value("ZT_COMMERCIAL", ZT_COMMERCIAL)
699 .value("ZT_INDUSTRIAL", ZT_INDUSTRIAL)
700 .value("ZT_RESIDENTIAL", ZT_RESIDENTIAL)
701 .value("ZT_NUM_DESTINATIONS", ZT_NUM_DESTINATIONS)
702 ;
703
704 // CityVotingProblems
705 emscripten::enum_<CityVotingProblems>("CityVotingProblems")
706 .value("CVP_CRIME", CVP_CRIME)
707 .value("CVP_POLLUTION", CVP_POLLUTION)
708 .value("CVP_HOUSING", CVP_HOUSING)
709 .value("CVP_TAXES", CVP_TAXES)
710 .value("CVP_TRAFFIC", CVP_TRAFFIC)
711 .value("CVP_UNEMPLOYMENT", CVP_UNEMPLOYMENT)
712 .value("CVP_FIRE", CVP_FIRE)
713 .value("CVP_NUMPROBLEMS", CVP_NUMPROBLEMS)
714 .value("CVP_PROBLEM_COMPLAINTS", CVP_PROBLEM_COMPLAINTS)
715 .value("PROBNUM", PROBNUM)
716 ;
717
718 // CityClass
719 emscripten::enum_<CityClass>("CityClass")
720 .value("CC_VILLAGE", CC_VILLAGE)
721 .value("CC_TOWN", CC_TOWN)
722 .value("CC_CITY", CC_CITY)
723 .value("CC_CAPITAL", CC_CAPITAL)
724 .value("CC_METROPOLIS", CC_METROPOLIS)
725 .value("CC_MEGALOPOLIS", CC_MEGALOPOLIS)
726 .value("CC_NUM_CITIES", CC_NUM_CITIES)
727 ;
728
729 // GameLevel
730 emscripten::enum_<GameLevel>("GameLevel")
731 .value("LEVEL_EASY", LEVEL_EASY)
732 .value("LEVEL_MEDIUM", LEVEL_MEDIUM)
733 .value("LEVEL_HARD", LEVEL_HARD)
734 .value("LEVEL_COUNT", LEVEL_COUNT)
735 .value("LEVEL_FIRST", LEVEL_FIRST)
736 .value("LEVEL_LAST", LEVEL_LAST)
737 ;
738
739 emscripten::enum_<Tiles>("Tiles")
740 .value("DIRT", DIRT) // 0: Clear tile
741 // tile 1 ?
742 // Water:
743 .value("RIVER", RIVER) // 2
744 .value("REDGE", REDGE) // 3
745 .value("CHANNEL", CHANNEL) // 4
746 .value("FIRSTRIVEDGE", FIRSTRIVEDGE) // 5
747 // tile 6 -- 19 ?
748 .value("LASTRIVEDGE", LASTRIVEDGE) // 20
749 .value("WATER_LOW", WATER_LOW) // 2 (RIVER): First water tile
750 .value("WATER_HIGH", WATER_HIGH) // 20 (LASTRIVEDGE): Last water tile (inclusive)
751 .value("TREEBASE", TREEBASE) // 21
752 .value("WOODS_LOW", WOODS_LOW) // 21 (TREEBASE)
753 .value("LASTTREE", LASTTREE) // 36
754 .value("WOODS", WOODS) // 37
755 .value("UNUSED_TRASH1", UNUSED_TRASH1) // 38
756 .value("UNUSED_TRASH2", UNUSED_TRASH2) // 39
757 .value("WOODS_HIGH", WOODS_HIGH) // 39 (UNUSED_TRASH2): Why is an 'UNUSED' tile used?
758 .value("WOODS2", WOODS2) // 40
759 .value("WOODS3", WOODS3) // 41
760 .value("WOODS4", WOODS4) // 42
761 .value("WOODS5", WOODS5) // 43
762 // Rubble (4 tiles)
763 .value("RUBBLE", RUBBLE) // 44
764 .value("LASTRUBBLE", LASTRUBBLE) // 47
765 .value("FLOOD", FLOOD) // 48
766 // tile 49, 50 ?
767 .value("LASTFLOOD", LASTFLOOD) // 51
768 .value("RADTILE", RADTILE) // 52: Radio-active contaminated tile
769 .value("UNUSED_TRASH3", UNUSED_TRASH3) // 53
770 .value("UNUSED_TRASH4", UNUSED_TRASH4) // 54
771 .value("UNUSED_TRASH5", UNUSED_TRASH5) // 55
772 // Fire animation (8 tiles)
773 .value("FIRE", FIRE) // 56
774 .value("FIREBASE", FIREBASE) // 56 (FIRE)
775 .value("LASTFIRE", LASTFIRE) // 63
776 .value("HBRIDGE", HBRIDGE) // 64: Horizontal bridge
777 .value("ROADBASE", ROADBASE) // 64 (HBRIDGE)
778 .value("VBRIDGE", VBRIDGE) // 65: Vertical bridge
779 .value("ROADS", ROADS) // 66
780 .value("ROADS2", ROADS2) // 67
781 .value("ROADS3", ROADS3) // 68
782 .value("ROADS4", ROADS4) // 69
783 .value("ROADS5", ROADS5) // 70
784 .value("ROADS6", ROADS6) // 71
785 .value("ROADS7", ROADS7) // 72
786 .value("ROADS8", ROADS8) // 73
787 .value("ROADS9", ROADS9) // 74
788 .value("ROADS10", ROADS10) // 75
789 .value("INTERSECTION", INTERSECTION) // 76
790 .value("HROADPOWER", HROADPOWER) // 77
791 .value("VROADPOWER", VROADPOWER) // 78
792 .value("BRWH", BRWH) // 79
793 .value("LTRFBASE", LTRFBASE) // 80: First tile with low traffic
794 // tile 81 -- 94 ?
795 .value("BRWV", BRWV) // 95
796 // tile 96 -- 110 ?
797 .value("BRWXXX1", BRWXXX1) // 111
798 // tile 96 -- 110 ?
799 .value("BRWXXX2", BRWXXX2) // 127
800 // tile 96 -- 110 ?
801 .value("BRWXXX3", BRWXXX3) // 143
802 .value("HTRFBASE", HTRFBASE) // 144: First tile with high traffic
803 // tile 145 -- 158 ?
804 .value("BRWXXX4", BRWXXX4) // 159
805 // tile 160 -- 174 ?
806 .value("BRWXXX5", BRWXXX5) // 175
807 // tile 176 -- 190 ?
808 .value("BRWXXX6", BRWXXX6) // 191
809 // tile 192 -- 205 ?
810 .value("LASTROAD", LASTROAD) // 206
811 .value("BRWXXX7", BRWXXX7) // 207
812 // Power lines
813 .value("HPOWER", HPOWER) // 208
814 .value("VPOWER", VPOWER) // 209
815 .value("LHPOWER", LHPOWER) // 210
816 .value("LVPOWER", LVPOWER) // 211
817 .value("LVPOWER2", LVPOWER2) // 212
818 .value("LVPOWER3", LVPOWER3) // 213
819 .value("LVPOWER4", LVPOWER4) // 214
820 .value("LVPOWER5", LVPOWER5) // 215
821 .value("LVPOWER6", LVPOWER6) // 216
822 .value("LVPOWER7", LVPOWER7) // 217
823 .value("LVPOWER8", LVPOWER8) // 218
824 .value("LVPOWER9", LVPOWER9) // 219
825 .value("LVPOWER10", LVPOWER10) // 220
826 .value("RAILHPOWERV", RAILHPOWERV) // 221: Horizontal rail, vertical power
827 .value("RAILVPOWERH", RAILVPOWERH) // 222: Vertical rail, horizontal power
828 .value("POWERBASE", POWERBASE) // 208 (HPOWER)
829 .value("LASTPOWER", LASTPOWER) // 222 (RAILVPOWERH)
830 .value("UNUSED_TRASH6", UNUSED_TRASH6) // 223
831 // Rail
832 .value("HRAIL", HRAIL) // 224
833 .value("VRAIL", VRAIL) // 225
834 .value("LHRAIL", LHRAIL) // 226
835 .value("LVRAIL", LVRAIL) // 227
836 .value("LVRAIL2", LVRAIL2) // 228
837 .value("LVRAIL3", LVRAIL3) // 229
838 .value("LVRAIL4", LVRAIL4) // 230
839 .value("LVRAIL5", LVRAIL5) // 231
840 .value("LVRAIL6", LVRAIL6) // 232
841 .value("LVRAIL7", LVRAIL7) // 233
842 .value("LVRAIL8", LVRAIL8) // 234
843 .value("LVRAIL9", LVRAIL9) // 235
844 .value("LVRAIL10", LVRAIL10) // 236
845 .value("HRAILROAD", HRAILROAD) // 237
846 .value("VRAILROAD", VRAILROAD) // 238
847 .value("RAILBASE", RAILBASE) // 224 (HRAIL)
848 .value("LASTRAIL", LASTRAIL) // 238 (VRAILROAD)
849 .value("ROADVPOWERH", ROADVPOWERH) // 239: bogus?
850 // Residential zone tiles
851 .value("RESBASE", RESBASE) // 240: Empty residential, tiles 240--248
852 .value("FREEZ", FREEZ) // 244: center-tile of 3x3 empty residential
853 .value("HOUSE", HOUSE) // 249: Single tile houses until 260
854 .value("LHTHR", LHTHR) // 249 (HOUSE)
855 .value("HHTHR", HHTHR) // 260
856 .value("RZB", RZB) // 265: center tile first 3x3 tile residential
857 .value("HOSPITALBASE", HOSPITALBASE) // 405: Center of hospital (tiles 405--413)
858 .value("HOSPITAL", HOSPITAL) // 409: Center of hospital (tiles 405--413)
859 .value("CHURCHBASE", CHURCHBASE) // 414: Center of church (tiles 414--422)
860 .value("CHURCH0BASE", CHURCH0BASE) // 414 (CHURCHBASE): numbered alias
861 .value("CHURCH", CHURCH) // 418: Center of church (tiles 414--422)
862 .value("CHURCH0", CHURCH0) // 418 (CHURCH): numbered alias
863 // Commercial zone tiles
864 .value("COMBASE", COMBASE) // 423: Empty commercial, tiles 423--431
865 // tile 424 -- 426 ?
866 .value("COMCLR", COMCLR) // 427
867 // tile 428 -- 435 ?
868 .value("CZB", CZB) // 436
869 // tile 437 -- 608 ?
870 .value("COMLAST", COMLAST) // 609
871 // tile 610, 611 ?
872 // Industrial zone tiles.
873 .value("INDBASE", INDBASE) // 612: Top-left tile of empty industrial zone.
874 .value("INDCLR", INDCLR) // 616: Center tile of empty industrial zone.
875 .value("LASTIND", LASTIND) // 620: Last tile of empty industrial zone.
876 // Industrial zone population 0, value 0: 621 -- 629
877 .value("IND1", IND1) // 621: Top-left tile of first non-empty industry zone.
878 .value("IZB", IZB) // 625: Center tile of first non-empty industry zone.
879 // Industrial zone population 1, value 0: 630 -- 638
880 // Industrial zone population 2, value 0: 639 -- 647
881 .value("IND2", IND2) // 641
882 .value("IND3", IND3) // 644
883 // Industrial zone population 3, value 0: 648 -- 656
884 .value("IND4", IND4) // 649
885 .value("IND5", IND5) // 650
886 // Industrial zone population 0, value 1: 657 -- 665
887 // Industrial zone population 1, value 1: 666 -- 674
888 // Industrial zone population 2, value 1: 675 -- 683
889 .value("IND6", IND6) // 676
890 .value("IND7", IND7) // 677
891 // Industrial zone population 3, value 1: 684 -- 692
892 .value("IND8", IND8) // 686
893 .value("IND9", IND9) // 689
894 // Seaport
895 .value("PORTBASE", PORTBASE) // 693: Top-left tile of the seaport.
896 .value("PORT", PORT) // 698: Center tile of the seaport.
897 .value("LASTPORT", LASTPORT) // 708: Last tile of the seaport.
898 .value("AIRPORTBASE", AIRPORTBASE) // 709
899 // tile 710 ?
900 .value("RADAR", RADAR) // 711
901 // tile 712 -- 715 ?
902 .value("AIRPORT", AIRPORT) // 716
903 // tile 717 -- 744 ?
904 // Coal power plant (4x4).
905 .value("COALBASE", COALBASE) // 745: First tile of coal power plant.
906 .value("POWERPLANT", POWERPLANT) // 750: 'Center' tile of coal power plant.
907 .value("LASTPOWERPLANT", LASTPOWERPLANT) // 760: Last tile of coal power plant.
908 // Fire station (3x3).
909 .value("FIRESTBASE", FIRESTBASE) // 761: First tile of fire station.
910 .value("FIRESTATION", FIRESTATION) // 765: 'Center tile' of fire station.
911 // 769 last tile fire station.
912 .value("POLICESTBASE", POLICESTBASE) // 770
913 // tile 771 -- 773 ?
914 .value("POLICESTATION", POLICESTATION) // 774
915 // tile 775 -- 778 ?
916 // Stadium (4x4).
917 .value("STADIUMBASE", STADIUMBASE) // 779: First tile stadium.
918 .value("STADIUM", STADIUM) // 784: 'Center tile' stadium.
919 // Last tile stadium 794.
920 // tile 785 -- 799 ?
921 .value("FULLSTADIUM", FULLSTADIUM) // 800
922 // tile 801 -- 810 ?
923 // Nuclear power plant (4x4).
924 .value("NUCLEARBASE", NUCLEARBASE) // 811: First tile nuclear power plant.
925 .value("NUCLEAR", NUCLEAR) // 816: 'Center' tile nuclear power plant.
926 .value("LASTZONE", LASTZONE) // 826: Also last tile nuclear power plant.
927 .value("LIGHTNINGBOLT", LIGHTNINGBOLT) // 827
928 .value("HBRDG0", HBRDG0) // 828
929 .value("HBRDG1", HBRDG1) // 829
930 .value("HBRDG2", HBRDG2) // 830
931 .value("HBRDG3", HBRDG3) // 831
932 .value("HBRDG_END", HBRDG_END) // 832
933 .value("RADAR0", RADAR0) // 832
934 .value("RADAR1", RADAR1) // 833
935 .value("RADAR2", RADAR2) // 834
936 .value("RADAR3", RADAR3) // 835
937 .value("RADAR4", RADAR4) // 836
938 .value("RADAR5", RADAR5) // 837
939 .value("RADAR6", RADAR6) // 838
940 .value("RADAR7", RADAR7) // 839
941 .value("FOUNTAIN", FOUNTAIN) // 840
942 // tile 841 -- 843: fountain animation.
943 .value("INDBASE2", INDBASE2) // 844
944 .value("TELEBASE", TELEBASE) // 844 (INDBASE2)
945 // tile 845 -- 850 ?
946 .value("TELELAST", TELELAST) // 851
947 .value("SMOKEBASE", SMOKEBASE) // 852
948 // tile 853 -- 859 ?
949 .value("TINYEXP", TINYEXP) // 860
950 // tile 861 -- 863 ?
951 .value("SOMETINYEXP", SOMETINYEXP) // 864
952 // tile 865 -- 866 ?
953 .value("LASTTINYEXP", LASTTINYEXP) // 867
954 // tile 868 -- 882 ?
955 .value("TINYEXPLAST", TINYEXPLAST) // 883
956 // tile 884 -- 915 ?
957 .value("COALSMOKE1", COALSMOKE1) // 916: Chimney animation at coal power plant (2, 0).
958 // 919 last animation tile for chimney at coal power plant (2, 0).
959 .value("COALSMOKE2", COALSMOKE2) // 920: Chimney animation at coal power plant (3, 0).
960 // 923 last animation tile for chimney at coal power plant (3, 0).
961 .value("COALSMOKE3", COALSMOKE3) // 924: Chimney animation at coal power plant (2, 1).
962 // 927 last animation tile for chimney at coal power plant (2, 1).
963 .value("COALSMOKE4", COALSMOKE4) // 928: Chimney animation at coal power plant (3, 1).
964 // 931 last animation tile for chimney at coal power plant (3, 1).
965 .value("FOOTBALLGAME1", FOOTBALLGAME1) // 932
966 // tile 933 -- 939 ?
967 .value("FOOTBALLGAME2", FOOTBALLGAME2) // 940
968 // tile 941 -- 947 ?
969 .value("VBRDG0", VBRDG0) // 948
970 .value("VBRDG1", VBRDG1) // 949
971 .value("VBRDG2", VBRDG2) // 950
972 .value("VBRDG3", VBRDG3) // 951
973 .value("NUKESWIRL1", NUKESWIRL1) // 952
974 .value("NUKESWIRL2", NUKESWIRL2) // 953
975 .value("NUKESWIRL3", NUKESWIRL3) // 954
976 .value("NUKESWIRL4", NUKESWIRL4) // 955
977 // Tiles 956-959 unused (originally)
978 // TILE_COUNT = 960,
979 // Extended zones: 956-1019
980 .value("CHURCH1BASE", CHURCH1BASE) // 956
981 .value("CHURCH1", CHURCH1) // 960
982 .value("CHURCH1BASE", CHURCH1BASE) // 956
983 .value("CHURCH1", CHURCH1) // 960
984 .value("CHURCH2BASE", CHURCH2BASE) // 965
985 .value("CHURCH2", CHURCH2) // 969
986 .value("CHURCH3BASE", CHURCH3BASE) // 974
987 .value("CHURCH3", CHURCH3) // 978
988 .value("CHURCH4BASE", CHURCH4BASE) // 983
989 .value("CHURCH4", CHURCH4) // 987
990 .value("CHURCH5BASE", CHURCH5BASE) // 992
991 .value("CHURCH5", CHURCH5) // 996
992 .value("CHURCH6BASE", CHURCH6BASE) // 1001
993 .value("CHURCH6", CHURCH6) // 1005
994 .value("CHURCH7BASE", CHURCH7BASE) // 1010
995 .value("CHURCH7", CHURCH7) // 1014
996 .value("CHURCH7LAST", CHURCH7LAST) // 1018
997 // Tiles 1020-1023 unused
998 .value("TILE_COUNT", TILE_COUNT) // 1024
999 .value("TILE_INVALID", TILE_INVALID) // -1, Invalid tile (not used in the world map).
1000 ;
1001
1002 class_<SimSprite>("SimSprite")
1003 .property("name", &SimSprite::name)
1004 .property("type", &SimSprite::type)
1005 .property("frame", &SimSprite::frame)
1006 .property("x", &SimSprite::x)
1007 .property("y", &SimSprite::y)
1008 .property("width", &SimSprite::width)
1009 .property("height", &SimSprite::height)
1010 .property("xOffset", &SimSprite::xOffset)
1011 .property("yOffset", &SimSprite::yOffset)
1012 .property("xHot", &SimSprite::xHot)
1013 .property("yHot", &SimSprite::yHot)
1014 .property("origX", &SimSprite::origX)
1015 .property("origY", &SimSprite::origY)
1016 .property("destX", &SimSprite::destX)
1017 .property("destY", &SimSprite::destY)
1018 .property("count", &SimSprite::count)
1019 .property("soundCount", &SimSprite::soundCount)
1020 .property("dir", &SimSprite::dir)
1021 .property("newDir", &SimSprite::newDir)
1022 .property("step", &SimSprite::step)
1023 .property("flag", &SimSprite::flag)
1024 .property("control", &SimSprite::control)
1025 .property("turn", &SimSprite::turn)
1026 .property("accel", &SimSprite::accel)
1027 .property("speed", &SimSprite::speed)
1028 ;
1029
1030 class_<Callback>("Callback")
1031 .function("autoGoto", &Callback::autoGoto, allow_raw_pointers())
1032 .function("didGenerateMap", &Callback::didGenerateMap, allow_raw_pointers())
1033 .function("didLoadCity", &Callback::didLoadCity, allow_raw_pointers())
1034 .function("didLoadScenario", &Callback::didLoadScenario, allow_raw_pointers())
1035 .function("didLoseGame", &Callback::didLoseGame, allow_raw_pointers())
1036 .function("didSaveCity", &Callback::didSaveCity, allow_raw_pointers())
1037 .function("didTool", &Callback::didTool, allow_raw_pointers())
1038 .function("didWinGame", &Callback::didWinGame, allow_raw_pointers())
1039 .function("didntLoadCity", &Callback::didntLoadCity, allow_raw_pointers())
1040 .function("didntSaveCity", &Callback::didntSaveCity, allow_raw_pointers())
1041 .function("makeSound", &Callback::makeSound, allow_raw_pointers())
1042 .function("newGame", &Callback::newGame, allow_raw_pointers())
1043 .function("saveCityAs", &Callback::saveCityAs, allow_raw_pointers())
1044 .function("sendMessage", &Callback::sendMessage, allow_raw_pointers())
1045 .function("showBudgetAndWait", &Callback::showBudgetAndWait, allow_raw_pointers())
1046 .function("showZoneStatus", &Callback::showZoneStatus, allow_raw_pointers())
1047 .function("simulateRobots", &Callback::simulateRobots, allow_raw_pointers())
1048 .function("simulateChurch", &Callback::simulateChurch, allow_raw_pointers())
1049 .function("startEarthquake", &Callback::startEarthquake, allow_raw_pointers())
1050 .function("startGame", &Callback::startGame, allow_raw_pointers())
1051 .function("startScenario", &Callback::startScenario, allow_raw_pointers())
1052 .function("updateBudget", &Callback::updateBudget, allow_raw_pointers())
1053 .function("updateCityName", &Callback::updateCityName, allow_raw_pointers())
1054 .function("updateDate", &Callback::updateDate, allow_raw_pointers())
1055 .function("updateDemand", &Callback::updateDemand, allow_raw_pointers())
1056 .function("updateEvaluation", &Callback::updateEvaluation, allow_raw_pointers())
1057 .function("updateFunds", &Callback::updateFunds, allow_raw_pointers())
1058 .function("updateGameLevel", &Callback::updateGameLevel, allow_raw_pointers())
1059 .function("updateHistory", &Callback::updateHistory, allow_raw_pointers())
1060 .function("updateMap", &Callback::updateMap, allow_raw_pointers())
1061 .function("updateOptions", &Callback::updateOptions, allow_raw_pointers())
1062 .function("updatePasses", &Callback::updatePasses, allow_raw_pointers())
1063 .function("updatePaused", &Callback::updatePaused, allow_raw_pointers())
1064 .function("updateSpeed", &Callback::updateSpeed, allow_raw_pointers())
1065 .function("updateTaxRate", &Callback::updateTaxRate, allow_raw_pointers())
1066 ;
1067
1068 class_<JSCallback, base<Callback>>("JSCallback")
1069 .constructor<emscripten::val>();
1070
1071 class_<Micropolis>("Micropolis")
1072
1073 .constructor<>()
1074
1075 // Simulation Control and Settings
1076 .function("setCallback", &Micropolis::setCallback, allow_raw_pointers())
1077 .function("init", &Micropolis::init)
1078 .function("loadCity", &Micropolis::loadCity)
1079 .function("simTick", &Micropolis::simTick)
1080 .function("simUpdate", &Micropolis::simUpdate)
1081 .function("generateSomeRandomCity", &Micropolis::generateSomeRandomCity)
1082 .function("getMapAddress", &Micropolis::getMapAddress)
1083 .function("getMapSize", &Micropolis::getMapSize)
1084 .function("getMopAddress", &Micropolis::getMopAddress)
1085 .function("getMopSize", &Micropolis::getMopSize)
1086 .function("animateTiles", &Micropolis::animateTiles)
1087 .function("setSpeed", &Micropolis::setSpeed)
1088 .function("setGameLevel", &Micropolis::setGameLevel)
1089 .function("setCityName", &Micropolis::setCityName)
1090 .function("setYear", &Micropolis::setYear)
1091 .function("pause", &Micropolis::pause)
1092 .function("resume", &Micropolis::resume)
1093 .function("setEnableDisasters", &Micropolis::setEnableDisasters)
1094 .function("setAutoBudget", &Micropolis::setAutoBudget)
1095 .function("setAutoBulldoze", &Micropolis::setAutoBulldoze)
1096 .function("setAutoGoto", &Micropolis::setAutoGoto)
1097 .function("setEnableSound", &Micropolis::setEnableSound)
1098 .function("setDoAnimation", &Micropolis::setDoAnimation)
1099 .function("doNewGame", &Micropolis::doNewGame)
1100 .function("doBudget", &Micropolis::doBudget)
1101 .function("doScoreCard", &Micropolis::doScoreCard)
1102 .function("updateFunds", &Micropolis::updateFunds)
1103 .function("setPasses", &Micropolis::setPasses)
1104 .function("setCityTax", &Micropolis::setCityTax)
1105
1106 // Game State and Statistics
1107 .property("initSimLoad", &Micropolis::initSimLoad)
1108 .property("simLoops", &Micropolis::simLoops)
1109 .property("simSpeed", &Micropolis::simSpeed)
1110 .property("simSpeedMeta", &Micropolis::simSpeedMeta)
1111 .property("simPaused", &Micropolis::simPaused)
1112 .property("simPausedSpeed", &Micropolis::simPausedSpeed)
1113 .property("simPasses", &Micropolis::simPasses)
1114 .property("simPass", &Micropolis::simPass)
1115 .property("gameLevel", &Micropolis::gameLevel)
1116 .property("scenario", &Micropolis::scenario)
1117 .property("doAnimation", &Micropolis::doAnimation)
1118 .property("graph10Max", &Micropolis::graph10Max)
1119 .property("graph120Max", &Micropolis::graph120Max)
1120 .property("disasterEvent", &Micropolis::disasterEvent)
1121 .property("disasterWait", &Micropolis::disasterWait)
1122 .property("scenario", &Micropolis::scenario)
1123 .property("heatSteps", &Micropolis::heatSteps)
1124 .property("heatFlow", &Micropolis::heatFlow)
1125 .property("heatRule", &Micropolis::heatRule)
1126 .property("heatWrap", &Micropolis::heatWrap)
1127 .property("donDither", &Micropolis::donDither)
1128 .property("totalFunds", &Micropolis::totalFunds)
1129 .property("cityCenterX", &Micropolis::cityCenterX)
1130 .property("cityCenterY", &Micropolis::cityCenterY)
1131 .property("pollutionMaxX", &Micropolis::pollutionMaxX)
1132 .property("pollutionMaxY", &Micropolis::pollutionMaxY)
1133 .property("crimeMaxX", &Micropolis::crimeMaxX)
1134 .property("crimeMaxY", &Micropolis::crimeMaxY)
1135 .property("cityPop", &Micropolis::cityPop)
1136 .property("cityTime", &Micropolis::cityTime)
1137 .property("cityYear", &Micropolis::cityYear)
1138 .property("cityMonth", &Micropolis::cityMonth)
1139 .property("cityYes", &Micropolis::cityYes)
1140 .property("cityScore", &Micropolis::cityScore)
1141 .property("cityClass", &Micropolis::cityClass)
1142 .property("gameLevel", &Micropolis::gameLevel)
1143 .property("mapSerial", &Micropolis::mapSerial)
1144 .property("trafficAverage", &Micropolis::trafficAverage)
1145 .property("pollutionAverage", &Micropolis::pollutionAverage)
1146 .property("crimeAverage", &Micropolis::crimeAverage)
1147 .property("landValueAverage", &Micropolis::landValueAverage)
1148 .property("startingYear", &Micropolis::startingYear)
1149 .property("generatedCitySeed", &Micropolis::generatedCitySeed)
1150 .property("cityPopDelta", &Micropolis::cityPopDelta)
1151 .property("cityAssessedValue", &Micropolis::cityAssessedValue)
1152 .property("cityScoreDelta", &Micropolis::cityScoreDelta)
1153 .property("trafficAverage", &Micropolis::trafficAverage)
1154 .property("pollutionAverage", &Micropolis::pollutionAverage)
1155 .property("crimeAverage", &Micropolis::crimeAverage)
1156 .property("totalPop", &Micropolis::totalPop)
1157 .property("totalZonePop", &Micropolis::totalZonePop)
1158 .property("hospitalPop", &Micropolis::hospitalPop)
1159 .property("churchPop", &Micropolis::churchPop)
1160 .property("stadiumPop", &Micropolis::stadiumPop)
1161 .property("coalPowerPop", &Micropolis::coalPowerPop)
1162 .property("nuclearPowerPop", &Micropolis::nuclearPowerPop)
1163 .property("valveFlag", &Micropolis::valveFlag)
1164 .property("crimeRamp", &Micropolis::crimeRamp)
1165 .property("pollutionRamp", &Micropolis::pollutionRamp)
1166 .property("resCap", &Micropolis::resCap)
1167 .property("indCap", &Micropolis::indCap)
1168 .property("comCap", &Micropolis::comCap)
1169 .property("resValve", &Micropolis::resValve)
1170 .property("indValve", &Micropolis::indValve)
1171 .property("comValve", &Micropolis::comValve)
1172 .property("disasterEvent", &Micropolis::disasterEvent)
1173 .property("disasterWait", &Micropolis::disasterWait)
1174 .property("scoreType", &Micropolis::scoreType)
1175 .property("scoreWait", &Micropolis::scoreWait)
1176 .property("poweredZoneCount", &Micropolis::poweredZoneCount)
1177 .property("unpoweredZoneCount", &Micropolis::unpoweredZoneCount)
1178 .property("newPower", &Micropolis::newPower)
1179 .property("simCycle", &Micropolis::simCycle)
1180 .property("phaseCycle", &Micropolis::phaseCycle)
1181 .property("speedCycle", &Micropolis::speedCycle)
1182 .property("doInitialEval", &Micropolis::doInitialEval)
1183 .property("mapSerial", &Micropolis::mapSerial)
1184
1185 // Resource Management
1186 .property("roadTotal", &Micropolis::roadTotal)
1187 .property("railTotal", &Micropolis::railTotal)
1188 .property("resPop", &Micropolis::resPop)
1189 .property("comPop", &Micropolis::comPop)
1190 .property("indPop", &Micropolis::indPop)
1191 .property("policeStationPop", &Micropolis::policeStationPop)
1192 .property("fireStationPop", &Micropolis::fireStationPop)
1193 .property("seaportPop", &Micropolis::seaportPop)
1194 .property("airportPop", &Micropolis::airportPop)
1195 .property("cashFlow", &Micropolis::cashFlow)
1196 .property("externalMarket", &Micropolis::externalMarket)
1197 .property("cityTax", &Micropolis::cityTax)
1198 .property("cityTaxAverage", &Micropolis::cityTaxAverage)
1199 .property("roadEffect", &Micropolis::roadEffect)
1200 .property("policeEffect", &Micropolis::policeEffect)
1201 .property("fireEffect", &Micropolis::fireEffect)
1202
1203 // User Interface and Preferences
1204 .property("autoGoto", &Micropolis::autoGoto)
1205 .property("autoBudget", &Micropolis::autoBudget)
1206 .property("autoBulldoze", &Micropolis::autoBulldoze)
1207 .property("enableSound", &Micropolis::enableSound)
1208 .property("enableDisasters", &Micropolis::enableDisasters)
1209 .property("doAnimation", &Micropolis::doAnimation)
1210 .property("doMessages", &Micropolis::doMessages)
1211 .property("doNotices", &Micropolis::doNotices)
1212 .property("messageNumber", &Micropolis::messageNumber)
1213 .property("messageTimeLast", &Micropolis::messageTimeLast)
1214 .property("evalChanged", &Micropolis::evalChanged)
1215
1216 // Gameplay Mechanics
1217 .property("cityFileName", &Micropolis::cityFileName)
1218 .property("cityName", &Micropolis::cityName)
1219 .function("doTool", &Micropolis::doTool)
1220 .function("generateMap", &Micropolis::generateMap)
1221 .function("clearMap", &Micropolis::clearMap)
1222 //.function("getDemands", &Micropolis::getDemands, allow_raw_pointers()) // TODO: wrap
1223
1224 // Random Number Generation
1225 .function("simRandom", &Micropolis::simRandom)
1226 .function("getRandom", &Micropolis::getRandom)
1227 .function("getRandom16", &Micropolis::getRandom16)
1228 .function("getRandom16Signed", &Micropolis::getRandom16Signed)
1229 .function("getERandom", &Micropolis::getERandom)
1230 .function("randomlySeedRandom", &Micropolis::randomlySeedRandom)
1231 .function("seedRandom", &Micropolis::seedRandom)
1232
1233 // Game State and Data Access
1234 .function("getTile", &Micropolis::getTile)
1235 .function("setTile", &Micropolis::setTile)
1236 .function("setFunds", &Micropolis::setFunds)
1237 .function("updateMaps", &Micropolis::updateMaps)
1238 .function("updateGraphs", &Micropolis::updateGraphs)
1239 .function("updateEvaluation", &Micropolis::updateEvaluation)
1240 .function("updateBudget", &Micropolis::updateBudget)
1241
1242 // Disasters
1243 .function("makeMeltdown", &Micropolis::makeMeltdown)
1244 .function("makeFireBombs", &Micropolis::makeFireBombs)
1245 .function("makeEarthquake", &Micropolis::makeEarthquake)
1246 .function("makeFire", &Micropolis::makeFire)
1247 .function("makeFlood", &Micropolis::makeFlood)
1248 .function("setFire", &Micropolis::setFire)
1249 .function("fireBomb", &Micropolis::fireBomb)
1250
1251 // City History Arrays
1252 //.function("getResidentialHistory", &Micropolis::getResidentialHistory, allow_raw_pointers()) // TODO: wrap
1253 //.function("getCommercialHistory", &Micropolis::getCommercialHistory, allow_raw_pointers()) // TODO: wrap
1254 //.function("getIndustrialHistory", &Micropolis::getIndustrialHistory, allow_raw_pointers()) // TODO: wrap
1255
1256 // Events and Callbacks
1257 .function("sendMessage", &Micropolis::sendMessage)
1258 .function("makeSound", &Micropolis::makeSound)
1259
1260 ;
1261
1262}
1263
1264
short crimeMaxX
X coordinate of most criminal area. Not used.
Quad roadEffect
void makeMeltdown()
bool doInitialEval
Need to perform initial city evaluation.
void makeEarthquake()
short indPop
Definition micropolis.h:997
short stadiumPop
Number of stadiums.
void setTile(int x, int y, int tile)
Scenario scoreType
The type of score table to use.
void setDoAnimation(bool value)
void seedRandom(int seed)
Definition random.cpp:177
void simUpdate()
short crimeAverage
void makeFireBombs()
Quad cityPopDelta
GameLevel gameLevel
Difficulty level of the game (0..2)
Scenario scenario
Scenario being played.
void generateSomeRandomCity()
Definition generate.cpp:92
short poweredZoneCount
Number of powered tiles in all zone.
Quad policeEffect
short graph10Max
std::string cityFileName
Filename of the last loaded city.
short unpoweredZoneCount
Number of unpowered tiles in all zones.
void updateBudget()
Definition budget.cpp:327
short churchPop
Number of churches.
bool evalChanged
The evaluation window should be shown to the user.
short cityCenterY
Y coordinate of city center.
short resPop
Definition micropolis.h:983
short getRandom(short range)
Definition random.cpp:110
short pollutionMaxY
Y coordinate of most polluted area.
void setAutoGoto(bool value)
bool doAnimation
int getRandom16()
Definition random.cpp:130
bool enableDisasters
Enable disasters.
short cityScoreDelta
void fireBomb()
short graph120Max
short scoreWait
Time to wait before computing the score.
short pollutionMaxX
X coordinate of most polluted area.
short totalZonePop
short pollutionAverage
bool indCap
Block industrial growth.
Quad fireEffect
bool resCap
Block residential growth.
short airportPop
std::string cityName
Name of the city.
void setFunds(int dollars)
short policeStationPop
void updateFunds()
Definition update.cpp:127
int generatedCitySeed
void setAutoBulldoze(bool value)
short disasterWait
Count-down timer for the disaster.
void setEnableSound(bool value)
void setEnableDisasters(bool value)
short cityCenterX
X coordinate of city center.
short totalPop
short cityYes
void setFire()
Quad cityAssessedValue
short landValueAverage
void randomlySeedRandom()
Definition random.cpp:165
bool doMessages
short coalPowerPop
void pause()
short hospitalPop
Number of hospitals.
void generateMap(int seed)
Definition generate.cpp:129
ToolResult doTool(EditingTool tool, short tileX, short tileY)
Definition tool.cpp:1397
short trafficAverage
int mapSerial
The invalidateMaps method increases the map serial number every time the maps changes.
int simRandom()
Definition random.cpp:98
short startingYear
bool enableSound
Enable sound.
void sendMessage(short Mnum, short x=NOWHERE, short y=NOWHERE, bool picture=false, bool important=false)
Definition message.cpp:390
Scenario disasterEvent
The disaster for which a count-down is running.
void doScoreCard()
Definition evaluate.cpp:479
void makeSound(const std::string &channel, const std::string &sound, int x=-1, int y=-1)
void setGameLevel(GameLevel level)
bool autoBudget
int getTile(int x, int y)
short cityScore
bool comCap
Block commercial growth.
CityClass cityClass
City class, affected by city population.
short nuclearPowerPop
void resume()
void makeFire()
void clearMap()
Definition generate.cpp:175
short fireStationPop
int getRandom16Signed()
Definition random.cpp:137
short comPop
Definition micropolis.h:990
bool loadCity(const std::string &filename)
Definition fileio.cpp:536
void makeFlood()
void doNewGame()
short cityTax
short railTotal
Definition micropolis.h:971
short getERandom(short limit)
Definition random.cpp:155
short crimeMaxY
Y coordinate of most criminal area. Not used.
short seaportPop
short roadTotal
Definition micropolis.h:964
Quad totalFunds
Funds of the player.
void doBudget()
Definition budget.cpp:97
bool autoBulldoze
void setAutoBudget(bool value)
int posY
Vertical coordnate of the position.
Definition position.h:169
int posX
Horizontal coordinate of the position.
Definition position.h:168
bool move(Direction2 dir)
Definition position.cpp:161
bool testBounds()
Definition position.h:177
int x
X coordinate of the sprite in pixels?
Definition micropolis.h:892
int destX
Destination X coordinate of the sprite.
Definition micropolis.h:902
int yHot
Offset of the hot-spot relative to SimSprite::y?
Definition micropolis.h:899
int type
Type of the sprite (TRA – BUS).
Definition micropolis.h:890
int destY
Destination Y coordinate of the sprite.
Definition micropolis.h:903
std::string name
Name of the sprite.
Definition micropolis.h:889
int y
Y coordinate of the sprite in pixels?
Definition micropolis.h:893
int frame
Frame (0 means non-active sprite)
Definition micropolis.h:891
int xHot
Offset of the hot-spot relative to SimSprite::x?
Definition micropolis.h:898
void setMapValue(const Position &pos, MapValue mapVal)
Definition tool.cpp:186
bool modifyIfEnoughFunding()
Definition tool.cpp:152
MapTile getMapTile(const Position &pos) const
Definition tool.h:242
void modifyWorld()
Definition tool.cpp:121
void addCost(int amount)
Definition tool.h:275
int getCost() const
Definition tool.h:266
void clear()
Definition tool.cpp:103
MapValue getMapValue(const Position &pos) const
Definition tool.cpp:169
static const int WORLD_H
Definition map_type.h:95
static const int WORLD_W
Definition map_type.h:90
Header file for Micropolis game engine.
static const int CITYTIMES_PER_YEAR
Definition micropolis.h:205
static const int WORLD_H_8
Definition micropolis.h:185
@ SC_TOKYO
Tokyo (scary monster)
Definition micropolis.h:705
@ SC_NONE
No scenario (free playing)
Definition micropolis.h:699
@ SC_BOSTON
Boston (nuclear meltdown)
Definition micropolis.h:707
@ SC_BERN
Bern (traffic)
Definition micropolis.h:704
@ SC_COUNT
Number of scenarios.
Definition micropolis.h:710
@ SC_SAN_FRANCISCO
San francisco (earthquake)
Definition micropolis.h:702
@ SC_RIO
Rio (flooding)
Definition micropolis.h:708
@ SC_HAMBURG
Hamburg (fire bombs)
Definition micropolis.h:703
@ SC_DULLSVILLE
Dullsville (boredom)
Definition micropolis.h:701
@ SC_DETROIT
Detroit (crime)
Definition micropolis.h:706
static const int HISTORY_LENGTH
Definition micropolis.h:210
@ ZT_RESIDENTIAL
Residential zone.
Definition micropolis.h:721
@ ZT_COMMERCIAL
Commercial zone.
Definition micropolis.h:719
@ ZT_INDUSTRIAL
Industrial zone.
Definition micropolis.h:720
@ ZT_NUM_DESTINATIONS
Number of available zones.
Definition micropolis.h:723
static const int WORLD_W_2
Definition micropolis.h:151
static const int PASSES_PER_CITYTIME
Definition micropolis.h:195
@ CONNECT_TILE_FIX
Fix zone (connect wire, road, and rail).
Definition micropolis.h:351
@ CONNECT_TILE_ROAD
Lay road and fix zone.
Definition micropolis.h:353
@ CONNECT_TILE_WIRE
Lay wire and fix zone.
Definition micropolis.h:355
@ CONNECT_TILE_RAILROAD
Lay rail and fix zone.
Definition micropolis.h:354
@ CONNECT_TILE_BULLDOZE
Bulldoze and fix zone.
Definition micropolis.h:352
static const int POWER_STACK_SIZE
Definition micropolis.h:226
@ MAP_TYPE_POLLUTION
Pollution.
Definition micropolis.h:316
@ MAP_TYPE_POPULATION_DENSITY
Population density.
Definition micropolis.h:313
@ MAP_TYPE_DYNAMIC
Dynamic filter.
Definition micropolis.h:321
@ MAP_TYPE_LAND_VALUE
Land value.
Definition micropolis.h:318
@ MAP_TYPE_FIRE_RADIUS
Fire station coverage radius.
Definition micropolis.h:319
@ MAP_TYPE_CRIME
Crime rate.
Definition micropolis.h:317
@ MAP_TYPE_ALL
All zones.
Definition micropolis.h:307
@ MAP_TYPE_IND
Industrial zones.
Definition micropolis.h:310
@ MAP_TYPE_COM
Commercial zones.
Definition micropolis.h:309
@ MAP_TYPE_RES
Residential zones.
Definition micropolis.h:308
@ MAP_TYPE_ROAD
Roads.
Definition micropolis.h:312
@ MAP_TYPE_POWER
Power connectivity.
Definition micropolis.h:311
@ MAP_TYPE_COUNT
Number of map types.
Definition micropolis.h:323
@ MAP_TYPE_RATE_OF_GROWTH
Rate of growth.
Definition micropolis.h:314
@ MAP_TYPE_TRAFFIC_DENSITY
Traffic.
Definition micropolis.h:315
@ MAP_TYPE_POLICE_RADIUS
Police station coverage radius.
Definition micropolis.h:320
static const int CITYTIMES_PER_MONTH
Definition micropolis.h:200
@ HISTORY_TYPE_CRIME
Crime history type.
Definition micropolis.h:287
@ HISTORY_TYPE_MONEY
Money history type.
Definition micropolis.h:286
@ HISTORY_TYPE_POLLUTION
Pollution history type.
Definition micropolis.h:288
@ HISTORY_TYPE_IND
Industry history type.
Definition micropolis.h:285
@ HISTORY_TYPE_COUNT
Number of history types.
Definition micropolis.h:290
@ HISTORY_TYPE_RES
Residiential history type.
Definition micropolis.h:283
@ HISTORY_TYPE_COM
Commercial history type.
Definition micropolis.h:284
static const int HISTORY_COUNT
Definition micropolis.h:221
@ LASTPOWERPLANT
Last tile of coal power plant.
Definition micropolis.h:581
@ NUCLEARBASE
First tile nuclear power plant.
Definition micropolis.h:603
@ COALBASE
First tile of coal power plant.
Definition micropolis.h:579
@ HTRFBASE
First tile with high traffic.
Definition micropolis.h:452
@ WATER_LOW
First water tile.
Definition micropolis.h:392
@ FIRESTBASE
First tile of fire station.
Definition micropolis.h:584
@ RAILHPOWERV
Horizontal rail, vertical power.
Definition micropolis.h:477
@ HBRIDGE
Horizontal bridge.
Definition micropolis.h:426
@ WATER_HIGH
Last water tile (inclusive)
Definition micropolis.h:393
@ STADIUMBASE
First tile stadium.
Definition micropolis.h:594
@ VBRIDGE
Vertical bridge.
Definition micropolis.h:428
@ LASTZONE
Also last tile nuclear power plant.
Definition micropolis.h:605
@ STADIUM
'Center tile' stadium.
Definition micropolis.h:595
@ NUCLEAR
'Center' tile nuclear power plant.
Definition micropolis.h:604
@ PORTBASE
Top-left tile of the seaport.
Definition micropolis.h:567
@ IZB
Center tile of first non-empty industry zone.
Definition micropolis.h:542
@ PORT
Center tile of the seaport.
Definition micropolis.h:568
@ COALSMOKE3
927 last animation tile for chimney at coal power plant (2, 1).
Definition micropolis.h:644
@ POWERPLANT
'Center' tile of coal power plant.
Definition micropolis.h:580
@ INDCLR
Center tile of empty industrial zone.
Definition micropolis.h:537
@ COALSMOKE4
931 last animation tile for chimney at coal power plant (3, 1).
Definition micropolis.h:647
@ RADTILE
Radio-active contaminated tile.
Definition micropolis.h:415
@ FIRESTATION
'Center tile' of fire station.
Definition micropolis.h:585
@ LTRFBASE
First tile with low traffic.
Definition micropolis.h:443
@ DIRT
Clear tile.
Definition micropolis.h:382
@ INDBASE
Top-left tile of empty industrial zone.
Definition micropolis.h:536
@ IND1
Top-left tile of first non-empty industry zone.
Definition micropolis.h:541
@ COALSMOKE1
919 last animation tile for chimney at coal power plant (2, 0).
Definition micropolis.h:638
@ RAILVPOWERH
Vertical rail, horizontal power.
Definition micropolis.h:478
@ LASTIND
Last tile of empty industrial zone.
Definition micropolis.h:538
@ TILE_INVALID
Invalid tile (not used in the world map).
Definition micropolis.h:690
@ LASTPORT
Last tile of the seaport.
Definition micropolis.h:569
@ COALSMOKE2
923 last animation tile for chimney at coal power plant (3, 0).
Definition micropolis.h:641
static const int ISLAND_RADIUS
Definition micropolis.h:239
static const int BYTES_PER_TILE
Definition micropolis.h:143
static const int WORLD_H_2
Definition micropolis.h:157
@ CC_CAPITAL
Capital, > 50000 citizens.
Definition micropolis.h:755
@ CC_MEGALOPOLIS
Megalopolis, > 500000 citizens.
Definition micropolis.h:757
@ CC_METROPOLIS
Metropolis, > 100000 citizens.
Definition micropolis.h:756
@ CC_CITY
City, > 10000 citizens.
Definition micropolis.h:754
@ CC_VILLAGE
Village.
Definition micropolis.h:752
@ CC_TOWN
Town, > 2000 citizens.
Definition micropolis.h:753
@ CC_NUM_CITIES
Number of city classes.
Definition micropolis.h:759
static const int WORLD_W_8
Definition micropolis.h:179
static const int MAX_FIRE_STATION_EFFECT
Definition micropolis.h:263
@ HISTORY_SCALE_SHORT
Short scale data (10 years)
Definition micropolis.h:297
@ HISTORY_SCALE_COUNT
Number of history scales available.
Definition micropolis.h:300
@ HISTORY_SCALE_LONG
Long scale data (120 years)
Definition micropolis.h:298
static const int EDITOR_TILE_SIZE
Definition micropolis.h:190
@ LEVEL_FIRST
First game level value.
Definition micropolis.h:770
@ LEVEL_MEDIUM
Intermediate game level.
Definition micropolis.h:765
@ LEVEL_EASY
Simple game level.
Definition micropolis.h:764
@ LEVEL_HARD
Difficult game level.
Definition micropolis.h:766
@ LEVEL_LAST
Last game level value.
Definition micropolis.h:771
@ LEVEL_COUNT
Number of game levels.
Definition micropolis.h:768
@ TOOLRESULT_FAILED
Cannot build here.
Definition micropolis.h:366
@ TOOLRESULT_OK
Build succeeded.
Definition micropolis.h:367
@ TOOLRESULT_NEED_BULLDOZE
Clear the area first.
Definition micropolis.h:365
@ TOOLRESULT_NO_MONEY
User has not enough money for tool.
Definition micropolis.h:364
static const int NOWHERE
Definition micropolis.h:233
@ CVP_NUMPROBLEMS
Number of problems.
Definition micropolis.h:743
@ CVP_FIRE
Fire.
Definition micropolis.h:741
@ CVP_POLLUTION
Pollution.
Definition micropolis.h:736
@ CVP_TAXES
Taxes.
Definition micropolis.h:738
@ CVP_HOUSING
Housing.
Definition micropolis.h:737
@ CVP_UNEMPLOYMENT
Unemployment.
Definition micropolis.h:740
@ CVP_TRAFFIC
Traffic.
Definition micropolis.h:739
@ CVP_PROBLEM_COMPLAINTS
Number of problems to complain about.
Definition micropolis.h:745
@ CVP_CRIME
Crime.
Definition micropolis.h:735
static const int MAX_ROAD_EFFECT
Definition micropolis.h:253
@ SPRITE_AIRPLANE
Airplane sprite.
Definition micropolis.h:333
@ SPRITE_TORNADO
Tornado sprite.
Definition micropolis.h:336
@ SPRITE_MONSTER
Scary monster.
Definition micropolis.h:335
@ SPRITE_TRAIN
Train sprite.
Definition micropolis.h:331
@ SPRITE_HELICOPTER
Helicopter sprite.
Definition micropolis.h:332
@ SPRITE_BUS
Bus sprite.
Definition micropolis.h:338
@ SPRITE_SHIP
Ship.
Definition micropolis.h:334
@ SPRITE_EXPLOSION
Explosion sprite.
Definition micropolis.h:337
@ SPRITE_COUNT
Number of sprite objects.
Definition micropolis.h:340
static const int WORLD_H_4
Definition micropolis.h:171
static const int BITS_PER_TILE
Definition micropolis.h:137
static const int MISC_HISTORY_LENGTH
Definition micropolis.h:215
static const int MAX_POLICE_STATION_EFFECT
Definition micropolis.h:258
static const int WORLD_W_4
Definition micropolis.h:165
static const int MAX_TRAFFIC_DISTANCE
Definition micropolis.h:248
static Direction2 rotate45(Direction2 dir, int count=1)
Definition position.h:127
static Direction2 rotate180(Direction2 dir)
Definition position.h:147
@ DIR2_SOUTH_EAST
Direction pointing south-east.
Definition position.h:91
@ DIR2_NORTH_EAST
Direction pointing north-east.
Definition position.h:89
@ DIR2_WEST
Direction pointing west.
Definition position.h:94
@ DIR2_INVALID
Invalid direction.
Definition position.h:87
@ DIR2_SOUTH
Direction pointing south.
Definition position.h:92
@ DIR2_EAST
Direction pointing east.
Definition position.h:90
@ DIR2_NORTH_WEST
Direction pointing north-west.
Definition position.h:95
@ DIR2_SOUTH_WEST
Direction pointing south-west.
Definition position.h:93
@ DIR2_NORTH
Direction pointing north.
Definition position.h:88
static Direction2 increment45(Direction2 dir, int count=1)
Definition position.h:106
static Direction2 rotate90(Direction2 dir)
Definition position.h:137
static Direction2 increment90(Direction2 dir)
Definition position.h:117
@ STR202_POPULATIONDENSITY_LOW
Low.
Definition text.h:85
@ STR202_LANDVALUE_HIGH_CLASS
High.
Definition text.h:93
@ STR202_CRIME_DANGEROUS
Dangerous.
Definition text.h:98
@ STR202_POPULATIONDENSITY_HIGH
High.
Definition text.h:87
@ STR202_GROWRATE_STABLE
Stable.
Definition text.h:106
@ STR202_LANDVALUE_LOWER_CLASS
Lower Class.
Definition text.h:91
@ STR202_POPULATIONDENSITY_VERYHIGH
Very High.
Definition text.h:88
@ STR202_CRIME_LIGHT
Light.
Definition text.h:96
@ STR202_POLLUTION_MODERATE
Moderate.
Definition text.h:101
@ STR202_LANDVALUE_SLUM
Slum.
Definition text.h:90
@ STR202_POLLUTION_VERY_HEAVY
Very Heavy.
Definition text.h:103
@ STR202_GROWRATE_DECLINING
Declining.
Definition text.h:105
@ STR202_POLLUTION_HEAVY
Heavy.
Definition text.h:102
@ STR202_LANDVALUE_MIDDLE_CLASS
Middle Class.
Definition text.h:92
@ STR202_POPULATIONDENSITY_MEDIUM
Medium.
Definition text.h:86
@ STR202_GROWRATE_SLOWGROWTH
Slow Growth.
Definition text.h:107
@ STR202_GROWRATE_FASTGROWTH
Fast Growth.
Definition text.h:108
@ STR202_CRIME_MODERATE
Moderate.
Definition text.h:97
@ STR202_CRIME_NONE
Safe.
Definition text.h:95
@ STR202_POLLUTION_NONE
None.
Definition text.h:100
@ MESSAGE_TAX_TOO_HIGH
Citizens upset. The tax rate is too high.
Definition text.h:128
@ MESSAGE_SCENARIO_WON
You won the scenario.
Definition text.h:159
@ MESSAGE_SCENARIO_SAN_FRANCISCO
San Francisco scenario.
Definition text.h:163
@ MESSAGE_FIRE_REPORTED
20: Fire reported !
Definition text.h:132
@ MESSAGE_SHIP_CRASHED
25: Shipwreck reported !
Definition text.h:137
@ MESSAGE_REACHED_MEGALOPOLIS
Population has reached 500,000.
Definition text.h:151
@ MESSAGE_PLANE_CRASHED
A plane has crashed !
Definition text.h:136
@ MESSAGE_SCENARIO_DETROIT
55: Detroit scenario.
Definition text.h:167
@ MESSAGE_BULLDOZE_AREA_FIRST
Area must be bulldozed first.
Definition text.h:146
@ MESSAGE_RIOTS_REPORTED
They're rioting in the streets !!
Definition text.h:156
@ MESSAGE_SCENARIO_LOST
You lose the scenario.
Definition text.h:160
@ MESSAGE_TRAIN_CRASHED
A train crashed !
Definition text.h:138
@ MESSAGE_SCENARIO_RIO_DE_JANEIRO
57: Rio de Janeiro scenario.
Definition text.h:169
@ MESSAGE_HIGH_UNEMPLOYMENT
Unemployment rate is high.
Definition text.h:140
@ MESSAGE_NEED_MORE_RAILS
5: Inadequate rail system.
Definition text.h:117
@ MESSAGE_BLACKOUTS_REPORTED
15: Blackouts reported. Check power map.
Definition text.h:127
@ MESSAGE_SCENARIO_BOSTON
Boston scenario.
Definition text.h:168
@ MESSAGE_ROAD_NEEDS_FUNDING
Roads deteriorating, due to lack of funds.
Definition text.h:129
@ MESSAGE_LAST
Last valid message.
Definition text.h:171
@ MESSAGE_NEED_MORE_INDUSTRIAL
More industrial zones needed.
Definition text.h:115
@ MESSAGE_NOT_ENOUGH_POWER
40: Brownouts, build another Power Plant.
Definition text.h:152
@ MESSAGE_HELICOPTER_CRASHED
A helicopter crashed !
Definition text.h:139
@ MESSAGE_NUCLEAR_MELTDOWN
A Nuclear Meltdown has occurred !!!
Definition text.h:155
@ MESSAGE_NEED_MORE_PARKS
Need more parks.
Definition text.h:143
@ MESSAGE_MONSTER_SIGHTED
A Monster has been sighted !!
Definition text.h:133
@ MESSAGE_REACHED_TOWN
35: Population has reached 2,000.
Definition text.h:147
@ MESSAGE_REACHED_METROPOLIS
Population has reached 100,000.
Definition text.h:150
@ MESSAGE_NEED_MORE_ROADS
More roads required.
Definition text.h:116
@ MESSAGE_EXPLOSION_REPORTED
Explosion detected !
Definition text.h:144
@ MESSAGE_SCENARIO_HAMBURG
Hamburg scenario.
Definition text.h:164
@ MESSAGE_TORNADO_SIGHTED
Tornado reported !!
Definition text.h:134
@ MESSAGE_NEED_AIRPORT
Commerce requires an Airport.
Definition text.h:121
@ MESSAGE_HEAVY_TRAFFIC
Heavy Traffic reported.
Definition text.h:153
@ MESSAGE_POLICE_NEEDS_FUNDING
Police departments need funding.
Definition text.h:131
@ MESSAGE_NEED_POLICE_STATION
Citizens demand a Police Department.
Definition text.h:126
@ MESSAGE_NO_MONEY
YOUR CITY HAS GONE BROKE!
Definition text.h:141
@ MESSAGE_HIGH_CRIME
Crime very high.
Definition text.h:123
@ MESSAGE_SCENARIO_BERN
Bern scenario.
Definition text.h:165
@ MESSAGE_REACHED_CITY
Population has reached 10,000.
Definition text.h:148
@ MESSAGE_SCENARIO_TOKYO
Tokyo scenario.
Definition text.h:166
@ MESSAGE_REACHED_CAPITAL
Population has reached 50,000.
Definition text.h:149
@ MESSAGE_FIREBOMBING
30: Firebombing reported !
Definition text.h:142
@ MESSAGE_NEED_FIRE_STATION
Citizens demand a Fire Department.
Definition text.h:125
@ MESSAGE_ABOUT_MICROPOLIS
About micropolis.
Definition text.h:161
@ MESSAGE_LOADED_SAVED_CITY
Restored a Saved City.
Definition text.h:158
@ MESSAGE_STARTED_NEW_CITY
45: Started a New City.
Definition text.h:157
@ MESSAGE_NEED_ELECTRICITY
Build a Power Plant.
Definition text.h:118
@ MESSAGE_NEED_MORE_COMMERCIAL
More commercial zones needed.
Definition text.h:114
@ MESSAGE_NOT_ENOUGH_FUNDS
Insufficient funds to build that.
Definition text.h:145
@ MESSAGE_SCENARIO_DULLSVILLE
50: Dullsville scenario.
Definition text.h:162
@ MESSAGE_NEED_SEAPORT
Industry requires a Sea Port.
Definition text.h:120
@ MESSAGE_FIRE_STATION_NEEDS_FUNDING
Fire departments need funding.
Definition text.h:130
@ MESSAGE_HIGH_POLLUTION
10: Pollution very high.
Definition text.h:122
@ MESSAGE_NEED_STADIUM
Residents demand a Stadium.
Definition text.h:119
@ MESSAGE_TRAFFIC_JAMS
Frequent traffic jams reported.
Definition text.h:124
@ MESSAGE_FLOODING_REPORTED
Flooding reported !!
Definition text.h:154
@ MESSAGE_EARTHQUAKE
Major earthquake reported !!!
Definition text.h:135
@ MESSAGE_NEED_MORE_RESIDENTIAL
More residential zones needed.
Definition text.h:113
unsigned short MapTile
Definition tool.h:108
@ BURNBIT
bit 13, tile can be lit.
Definition tool.h:122
@ LOMASK
Mask for the Tiles part of the tile.
Definition tool.h:129
@ ZONEBIT
bit 10, tile is the center tile of the zone.
Definition tool.h:125
@ CONDBIT
bit 14. tile can conduct electricity.
Definition tool.h:121
@ PWRBIT
bit 15, tile has power.
Definition tool.h:120
@ BULLBIT
bit 12, tile is bulldozable.
Definition tool.h:123
@ ANIMBIT
bit 11, tile is animated.
Definition tool.h:124
@ ALLBITS
Mask for the bits-part of the tile.
Definition tool.h:128
unsigned short MapValue
Definition tool.h:101