├── .gitignore
├── .travis.yml
├── CMakeLists.txt
├── Caesar Open.ttf
├── DS-Greece.ttf
├── INSTALL_LINUX
├── INSTALL_WINDOWS
├── LICENSE
├── LICENSE_GPL3
├── README.md
├── c3_rev
├── C3.eng
├── C3_MM.eng
├── CMakeLists.txt
├── Caesar3.ini
├── basic.cpp
├── basic.h
├── c3.inf
├── cities_points.h
├── defs.h
├── gui.cpp
├── gui.h
├── house_evol.cpp
├── house_evol.h
├── log.cpp
├── log.h
├── main.cpp
├── mmio.cpp
├── mmio.h
├── pk.cpp
├── pk.h
├── variables.h
└── win32-cross.cmake
├── cmake
├── Modules
│ ├── CMakeParseArguments.cmake
│ ├── EnsureVersion.cmake
│ ├── FindLibintl.cmake
│ ├── FindPNG.cmake
│ ├── FindPackageHandleStandardArgs.cmake
│ ├── FindQxt.cmake
│ ├── FindSDL.cmake
│ ├── FindSDL_image.cmake
│ ├── FindSDL_mixer.cmake
│ ├── FindSDL_ttf.cmake
│ ├── Findzlib.cmake
│ ├── GenerateVersionHPP.cmake
│ └── version.hpp.in.cmake
└── vs
│ └── opencaesar3.vcxproj.user
├── dependencies
└── README
├── docs
└── CIII_EmpireCatalog_PharaohAah.pdf
├── install.sh
├── locale
├── en
│ └── LC_MESSAGES
│ │ └── caesar.po
└── ru
│ ├── LC_MESSAGES
│ └── caesar.po
│ ├── russian.csv
│ └── test.txt
├── missions
└── capua.oc3mission
├── models
├── game
│ ├── archives.model
│ ├── cities.model
│ ├── construction.model
│ ├── house.model
│ ├── names.model
│ ├── pantheon.model
│ └── settings.model
└── gui
│ ├── educationadv.gui
│ ├── employersadv.gui
│ ├── entertainmentadv.gui
│ ├── filmwidget.gui
│ ├── playername.gui
│ ├── speedoptions.gui
│ ├── topmenu.gui
│ └── videooptions.gui
├── release_src.sh
├── release_win32.sh
├── resources
└── README
├── sgreader
├── CMakeLists.txt
├── README
├── aboutdialog.cpp
├── aboutdialog.h
├── gui
│ ├── extractthread.cpp
│ ├── extractthread.h
│ ├── extractwizard.cpp
│ ├── extractwizard.h
│ ├── filelistpage.cpp
│ ├── filelistpage.h
│ ├── inputdirpage.cpp
│ ├── inputdirpage.h
│ ├── outputdirpage.cpp
│ ├── outputdirpage.h
│ ├── progresspage.cpp
│ └── progresspage.h
├── icons
│ ├── sgreader.ico
│ └── sgreader.png
├── imagetreeitem.cpp
├── imagetreeitem.h
├── licensedialog.cpp
├── licensedialog.h
├── main.cpp
├── mainwindow.cpp
├── mainwindow.h
├── sgbitmap.cpp
├── sgbitmap.h
├── sgfile.cpp
├── sgfile.h
├── sgimage.cpp
├── sgimage.h
├── sgreader.pro
├── sgreader.qrc
└── sgreader.rc
├── source
├── building
│ ├── building.cpp
│ ├── building.hpp
│ ├── buildings.hpp
│ ├── clay_pit.cpp
│ ├── clay_pit.hpp
│ ├── constants.hpp
│ ├── education.cpp
│ ├── education.hpp
│ ├── engineer_post.cpp
│ ├── engineer_post.hpp
│ ├── entertainment.cpp
│ ├── entertainment.hpp
│ ├── factory.cpp
│ ├── factory.hpp
│ ├── farm.cpp
│ ├── farm.hpp
│ ├── forum.cpp
│ ├── forum.hpp
│ ├── garden.cpp
│ ├── garden.hpp
│ ├── goverment.cpp
│ ├── goverment.hpp
│ ├── granary.cpp
│ ├── granary.hpp
│ ├── health.cpp
│ ├── health.hpp
│ ├── high_bridge.cpp
│ ├── high_bridge.hpp
│ ├── house.cpp
│ ├── house.hpp
│ ├── low_bridge.cpp
│ ├── low_bridge.hpp
│ ├── marble_quarry.cpp
│ ├── marble_quarry.hpp
│ ├── market.cpp
│ ├── market.hpp
│ ├── metadata.cpp
│ ├── metadata.hpp
│ ├── military.cpp
│ ├── military.hpp
│ ├── military_academy.cpp
│ ├── military_academy.hpp
│ ├── native.cpp
│ ├── native.hpp
│ ├── pottery.cpp
│ ├── pottery.hpp
│ ├── prefecture.cpp
│ ├── prefecture.hpp
│ ├── religion.cpp
│ ├── religion.hpp
│ ├── ruins.cpp
│ ├── ruins.hpp
│ ├── senate.cpp
│ ├── senate.hpp
│ ├── service.cpp
│ ├── service.hpp
│ ├── training.cpp
│ ├── training.hpp
│ ├── warehouse.cpp
│ ├── warehouse.hpp
│ ├── watersupply.cpp
│ ├── watersupply.hpp
│ ├── well.cpp
│ ├── well.hpp
│ ├── wharf.cpp
│ ├── wharf.hpp
│ ├── working.cpp
│ └── working.hpp
├── core
│ ├── alignment.cpp
│ ├── alignment.hpp
│ ├── allocator.hpp
│ ├── bytearray.hpp
│ ├── color.hpp
│ ├── delegate.hpp
│ ├── direction.hpp
│ ├── enumerator.hpp
│ ├── event.hpp
│ ├── eventconverter.cpp
│ ├── eventconverter.hpp
│ ├── exception.hpp
│ ├── flagholder.hpp
│ ├── font.cpp
│ ├── font.hpp
│ ├── foreach.hpp
│ ├── gettext.hpp
│ ├── json.cpp
│ ├── json.hpp
│ ├── list.hpp
│ ├── logger.cpp
│ ├── logger.hpp
│ ├── math.hpp
│ ├── platform.hpp
│ ├── position.hpp
│ ├── predefinitions.hpp
│ ├── rectangle.hpp
│ ├── referencecounted.hpp
│ ├── requirements.hpp
│ ├── safetycast.hpp
│ ├── saveadapter.cpp
│ ├── saveadapter.hpp
│ ├── scopedptr.hpp
│ ├── serializer.cpp
│ ├── serializer.hpp
│ ├── signals.hpp
│ ├── singleton.hpp
│ ├── size.hpp
│ ├── smartptr.hpp
│ ├── stringarray.hpp
│ ├── stringhelper.cpp
│ ├── stringhelper.hpp
│ ├── time.cpp
│ ├── time.hpp
│ ├── variant.cpp
│ ├── variant.hpp
│ ├── variantprivate.hpp
│ └── vector2.hpp
├── events
│ ├── dispatcher.cpp
│ ├── dispatcher.hpp
│ ├── event.cpp
│ ├── event.hpp
│ ├── setvideooptions.cpp
│ ├── setvideooptions.hpp
│ ├── showfeastwindow.cpp
│ └── showfeastwindow.hpp
├── game
│ ├── abstractloader.hpp
│ ├── alarm_event_holder.cpp
│ ├── alarm_event_holder.hpp
│ ├── astarpathfinding.cpp
│ ├── astarpathfinding.hpp
│ ├── astarpoint.hpp
│ ├── build_options.cpp
│ ├── build_options.hpp
│ ├── citizen_group.cpp
│ ├── citizen_group.hpp
│ ├── city.cpp
│ ├── city.hpp
│ ├── cityfunds.cpp
│ ├── cityfunds.hpp
│ ├── cityservice.hpp
│ ├── cityservice_animals.cpp
│ ├── cityservice_animals.hpp
│ ├── cityservice_culture.cpp
│ ├── cityservice_culture.hpp
│ ├── cityservice_disorder.cpp
│ ├── cityservice_disorder.hpp
│ ├── cityservice_emigrant.cpp
│ ├── cityservice_emigrant.hpp
│ ├── cityservice_festival.cpp
│ ├── cityservice_festival.hpp
│ ├── cityservice_fishplace.cpp
│ ├── cityservice_fishplace.hpp
│ ├── cityservice_info.cpp
│ ├── cityservice_info.hpp
│ ├── cityservice_prosperity.cpp
│ ├── cityservice_prosperity.hpp
│ ├── cityservice_religion.cpp
│ ├── cityservice_religion.hpp
│ ├── cityservice_roads.cpp
│ ├── cityservice_roads.hpp
│ ├── cityservice_shoreline.cpp
│ ├── cityservice_shoreline.hpp
│ ├── cityservice_timers.cpp
│ ├── cityservice_timers.hpp
│ ├── cityservice_water.cpp
│ ├── cityservice_water.hpp
│ ├── cityservice_workershire.cpp
│ ├── cityservice_workershire.hpp
│ ├── constants.hpp
│ ├── construction.cpp
│ ├── construction.hpp
│ ├── divinity.cpp
│ ├── divinity.hpp
│ ├── empire.cpp
│ ├── empire.hpp
│ ├── empire_city.hpp
│ ├── empire_city_computer.cpp
│ ├── empire_city_computer.hpp
│ ├── empire_trading.cpp
│ ├── empire_trading.hpp
│ ├── enums.hpp
│ ├── fish_place.cpp
│ ├── fish_place.hpp
│ ├── game.cpp
│ ├── game.hpp
│ ├── gamedate.cpp
│ ├── gamedate.hpp
│ ├── good.cpp
│ ├── good.hpp
│ ├── goodhelper.cpp
│ ├── goodhelper.hpp
│ ├── goodorders.cpp
│ ├── goodorders.hpp
│ ├── goodstore.cpp
│ ├── goodstore.hpp
│ ├── goodstore_simple.cpp
│ ├── goodstore_simple.hpp
│ ├── house_level.cpp
│ ├── house_level.hpp
│ ├── infoboxmanager.cpp
│ ├── infoboxmanager.hpp
│ ├── loader.cpp
│ ├── loader.hpp
│ ├── loader_map.cpp
│ ├── loader_map.hpp
│ ├── loader_oc3mission.cpp
│ ├── loader_oc3mission.hpp
│ ├── loader_oc3save.cpp
│ ├── loader_oc3save.hpp
│ ├── loader_sav.cpp
│ ├── loader_sav.hpp
│ ├── minimap_colours.cpp
│ ├── minimap_colours.hpp
│ ├── name_generator.cpp
│ ├── name_generator.hpp
│ ├── path_finding.cpp
│ ├── path_finding.hpp
│ ├── pathway.cpp
│ ├── pathway.hpp
│ ├── pathway_helper.cpp
│ ├── pathway_helper.hpp
│ ├── pkwareinputstream.cpp
│ ├── pkwareinputstream.hpp
│ ├── player.cpp
│ ├── player.hpp
│ ├── resourcegroup.cpp
│ ├── resourcegroup.hpp
│ ├── road.cpp
│ ├── road.hpp
│ ├── roadbuild_helper.cpp
│ ├── roadbuild_helper.hpp
│ ├── route.hpp
│ ├── saver.cpp
│ ├── saver.hpp
│ ├── screen.cpp
│ ├── screen.hpp
│ ├── screen_game.cpp
│ ├── screen_game.hpp
│ ├── screen_menu.cpp
│ ├── screen_menu.hpp
│ ├── screen_wait.cpp
│ ├── screen_wait.hpp
│ ├── service.cpp
│ ├── service.hpp
│ ├── settings.cpp
│ ├── settings.hpp
│ ├── tilemap.cpp
│ ├── tilemap.hpp
│ ├── tilemap_camera.cpp
│ ├── tilemap_camera.hpp
│ ├── tilemapchangecommand.cpp
│ ├── tilemapchangecommand.hpp
│ ├── tileoverlay_factory.cpp
│ ├── tileoverlay_factory.hpp
│ ├── timer.cpp
│ ├── timer.hpp
│ ├── trade_options.cpp
│ ├── trade_options.hpp
│ ├── walkermanager.cpp
│ ├── walkermanager.hpp
│ ├── win_targets.cpp
│ └── win_targets.hpp
├── gfx
│ ├── IMG_saveend.h
│ ├── IMG_savepng.cpp
│ ├── IMG_savepng.h
│ ├── animation.cpp
│ ├── animation.hpp
│ ├── animation_bank.cpp
│ ├── animation_bank.hpp
│ ├── city_renderer.cpp
│ ├── city_renderer.hpp
│ ├── constants.hpp
│ ├── decorator.cpp
│ ├── decorator.hpp
│ ├── engine.cpp
│ ├── engine.hpp
│ ├── gl_engine.cpp
│ ├── gl_engine.hpp
│ ├── layer.cpp
│ ├── layer.hpp
│ ├── layerconstants.hpp
│ ├── layercrime.cpp
│ ├── layercrime.hpp
│ ├── layerdamage.cpp
│ ├── layerdamage.hpp
│ ├── layerdesirability.cpp
│ ├── layerdesirability.hpp
│ ├── layerentertainment.cpp
│ ├── layerentertainment.hpp
│ ├── layerfire.cpp
│ ├── layerfire.hpp
│ ├── layerfood.cpp
│ ├── layerfood.hpp
│ ├── layerhealth.cpp
│ ├── layerhealth.hpp
│ ├── layerreligion.cpp
│ ├── layerreligion.hpp
│ ├── layersimple.cpp
│ ├── layersimple.hpp
│ ├── layerwater.cpp
│ ├── layerwater.hpp
│ ├── loader.cpp
│ ├── loader.hpp
│ ├── loader_png.cpp
│ ├── loader_png.hpp
│ ├── picture.cpp
│ ├── picture.hpp
│ ├── picture_bank.cpp
│ ├── picture_bank.hpp
│ ├── picture_info_bank.cpp
│ ├── picture_info_bank.hpp
│ ├── pictureconverter.cpp
│ ├── pictureconverter.hpp
│ ├── renderer.hpp
│ ├── sdl_engine.cpp
│ ├── sdl_engine.hpp
│ ├── tile.cpp
│ ├── tile.hpp
│ ├── tileoverlay.cpp
│ └── tileoverlay.hpp
├── gui
│ ├── advisor_education_window.cpp
│ ├── advisor_education_window.hpp
│ ├── advisor_emperor_window.cpp
│ ├── advisor_emperor_window.hpp
│ ├── advisor_employers_window.cpp
│ ├── advisor_employers_window.hpp
│ ├── advisor_entertainment_window.cpp
│ ├── advisor_entertainment_window.hpp
│ ├── advisor_finance_window.cpp
│ ├── advisor_finance_window.hpp
│ ├── advisor_health_window.cpp
│ ├── advisor_health_window.hpp
│ ├── advisor_legion_window.cpp
│ ├── advisor_legion_window.hpp
│ ├── advisor_ratings_window.cpp
│ ├── advisor_ratings_window.hpp
│ ├── advisor_religion_window.cpp
│ ├── advisor_religion_window.hpp
│ ├── advisor_trade_window.cpp
│ ├── advisor_trade_window.hpp
│ ├── advisors_window.cpp
│ ├── advisors_window.hpp
│ ├── buildmenu.cpp
│ ├── buildmenu.hpp
│ ├── contextmenu.cpp
│ ├── contextmenu.hpp
│ ├── contextmenuitem.cpp
│ ├── contextmenuitem.hpp
│ ├── contextmenuitemprivate.h
│ ├── contextmenuprivate.hpp
│ ├── dialogbox.cpp
│ ├── dialogbox.hpp
│ ├── editbox.cpp
│ ├── editbox.hpp
│ ├── empiremap_window.cpp
│ ├── empiremap_window.hpp
│ ├── environment.cpp
│ ├── environment.hpp
│ ├── festival_planing_window.cpp
│ ├── festival_planing_window.hpp
│ ├── film_widget.cpp
│ ├── film_widget.hpp
│ ├── groupbox.cpp
│ ├── groupbox.hpp
│ ├── info_box.cpp
│ ├── info_box.hpp
│ ├── label.cpp
│ ├── label.hpp
│ ├── listbox.cpp
│ ├── listbox.hpp
│ ├── listboxitem.cpp
│ ├── listboxitem.hpp
│ ├── listboxprivate.hpp
│ ├── loadmapwindow.cpp
│ ├── loadmapwindow.hpp
│ ├── mainmenu.cpp
│ ├── mainmenu.hpp
│ ├── menu.cpp
│ ├── menu.hpp
│ ├── message_stack_widget.cpp
│ ├── message_stack_widget.hpp
│ ├── minimap_window.cpp
│ ├── minimap_window.hpp
│ ├── mission_target_window.cpp
│ ├── mission_target_window.hpp
│ ├── modal_widget.cpp
│ ├── modal_widget.hpp
│ ├── overlays_menu.cpp
│ ├── overlays_menu.hpp
│ ├── playername_window.cpp
│ ├── playername_window.hpp
│ ├── popup_messagebox.cpp
│ ├── popup_messagebox.hpp
│ ├── pushbutton.cpp
│ ├── pushbutton.hpp
│ ├── rightpanel.cpp
│ ├── rightpanel.hpp
│ ├── save_dialog.cpp
│ ├── save_dialog.hpp
│ ├── scrollbar.cpp
│ ├── scrollbar.hpp
│ ├── scrollbarprivate.hpp
│ ├── senate_popup_info.cpp
│ ├── senate_popup_info.hpp
│ ├── special_orders_window.cpp
│ ├── special_orders_window.hpp
│ ├── startmenu.cpp
│ ├── startmenu.hpp
│ ├── texturedbutton.hpp
│ ├── topmenu.cpp
│ ├── topmenu.hpp
│ ├── video_options_window.cpp
│ ├── video_options_window.hpp
│ ├── warehouse_infobox.cpp
│ ├── warehouse_infobox.hpp
│ ├── widget.cpp
│ ├── widget.hpp
│ ├── widget_deleter.cpp
│ ├── widget_deleter.hpp
│ ├── widget_factory.cpp
│ ├── widget_factory.hpp
│ ├── widgetanimator.cpp
│ ├── widgetanimator.hpp
│ ├── widgetpositionanimator.cpp
│ ├── widgetpositionanimator.hpp
│ ├── widgetprivate.hpp
│ ├── window_gamespeed_options.cpp
│ └── window_gamespeed_options.hpp
├── main.cpp
├── sound
│ ├── oc3_sound_engine.cpp
│ └── oc3_sound_engine.hpp
├── version.hpp
├── vfs
│ ├── archive.hpp
│ ├── archive_zip.cpp
│ ├── archive_zip.hpp
│ ├── entity.hpp
│ ├── file.cpp
│ ├── file.hpp
│ ├── filelist.cpp
│ ├── filelist.hpp
│ ├── filelist_item.hpp
│ ├── filenative_impl.cpp
│ ├── filenative_impl.hpp
│ ├── filepath.cpp
│ ├── filepath.hpp
│ ├── filesystem.cpp
│ ├── filesystem.hpp
│ ├── memfile.cpp
│ └── memfile.hpp
└── walker
│ ├── ability.cpp
│ ├── ability.hpp
│ ├── action.hpp
│ ├── animals.cpp
│ ├── animals.hpp
│ ├── cart_pusher.cpp
│ ├── cart_pusher.hpp
│ ├── cart_supplier.cpp
│ ├── cart_supplier.hpp
│ ├── constants.hpp
│ ├── corpse.cpp
│ ├── corpse.hpp
│ ├── emigrant.cpp
│ ├── emigrant.hpp
│ ├── fishing_boat.cpp
│ ├── fishing_boat.hpp
│ ├── immigrant.cpp
│ ├── immigrant.hpp
│ ├── market_kid.cpp
│ ├── market_kid.hpp
│ ├── market_lady.cpp
│ ├── market_lady.hpp
│ ├── merchant.cpp
│ ├── merchant.hpp
│ ├── patrician.cpp
│ ├── patrician.hpp
│ ├── prefect.cpp
│ ├── prefect.hpp
│ ├── protestor.cpp
│ ├── protestor.hpp
│ ├── serviceman.cpp
│ ├── serviceman.hpp
│ ├── servicewalker_helper.hpp
│ ├── ship.cpp
│ ├── ship.hpp
│ ├── taxcollector.cpp
│ ├── taxcollector.hpp
│ ├── trainee.cpp
│ ├── trainee.hpp
│ ├── walker.cpp
│ ├── walker.hpp
│ ├── workerhunter.cpp
│ └── workerhunter.hpp
└── utils
├── aesGladman
├── aes.h
├── aescrypt.cpp
├── aeskey.cpp
├── aesopt.h
├── aestab.cpp
├── fileenc.cpp
├── fileenc.h
├── hmac.cpp
├── hmac.h
├── pwd2key.cpp
├── pwd2key.h
├── sha1.cpp
├── sha1.h
├── sha2.cpp
└── sha2.h
├── bzip2
├── blocksort.c
├── bzcompress.c
├── bzlib.c
├── bzlib.h
├── bzlib_private.h
├── crctable.c
├── decompress.c
├── huffman.c
└── randtable.c
├── lzma
├── LzmaDec.c
├── LzmaDec.h
└── Types.h
└── zlib
├── adler32.c
├── compress.c
├── crc32.c
├── crc32.h
├── deflate.c
├── deflate.h
├── gzclose.c
├── gzguts.h
├── gzio.c
├── gzlib.c
├── gzread.c
├── gzwrite.c
├── infback.c
├── inffast.c
├── inffast.h
├── inffixed.h
├── inflate.c
├── inflate.h
├── inftrees.c
├── inftrees.h
├── trees.c
├── trees.h
├── uncompr.c
├── zconf.h
├── zlib.h
├── zutil.c
└── zutil.h
/.gitignore:
--------------------------------------------------------------------------------
1 | CMakeLists.txt.user
2 | # Emacs backup and temp files
3 | *~
4 | \#*#
5 | stdout.txt
6 | caesar3
7 |
8 | #coredump files
9 | core.*
10 |
11 | # makefile is generated by cmake
12 | Makefile
13 | CMakeFiles
14 | CMakeCache.txt
15 | cmake_install.cmake
16 |
17 | # Eclipse project files
18 | .classpath
19 | .project
20 | .cproject
21 |
22 | build/*
23 | resources/*
24 | dependencies/*
25 | application/*
26 | en/*
27 |
28 | # Compiled translation files
29 | *.mo
30 |
31 | /*.7pre1
32 | /source/gfx/*.autosave
33 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: cpp
2 |
3 | compiler:
4 | - gcc
5 | - clang
6 |
7 | #matrix:
8 | # include:
9 | # - compiler: i686-w64-mingw32
10 | # env: OPTIONS="-DCMAKE_TOOLCHAIN_FILE=cmake/xcompile/win32.cmake"
11 |
12 | before_install:
13 | - sudo apt-get update
14 | - sudo apt-get install -qq libsdl1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev
15 |
16 |
17 | before_script:
18 | - mkdir build
19 | - cd build
20 | - cmake ..
21 |
22 | script: make
23 |
--------------------------------------------------------------------------------
/Caesar Open.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gecube/opencaesar3/8f4678951c05cd7302fbdcfe22f5264d94270bfd/Caesar Open.ttf
--------------------------------------------------------------------------------
/DS-Greece.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gecube/opencaesar3/8f4678951c05cd7302fbdcfe22f5264d94270bfd/DS-Greece.ttf
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | This file is part of openCaesar3.
2 |
3 | openCaesar3 is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | openCaesar3 is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with openCaesar3. If not, see .
15 |
16 | Copyright 2012-2013 Gregoire Athanase, gathanase@gmail.com
17 |
18 |
19 | openCaesar3 source code and binary is published under the GNU GPLv3 license.
20 | The libarchive library is published under the BSD-2 clause license.
21 |
22 |
23 |
--------------------------------------------------------------------------------
/c3_rev/C3.eng:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gecube/opencaesar3/8f4678951c05cd7302fbdcfe22f5264d94270bfd/c3_rev/C3.eng
--------------------------------------------------------------------------------
/c3_rev/C3_MM.eng:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gecube/opencaesar3/8f4678951c05cd7302fbdcfe22f5264d94270bfd/c3_rev/C3_MM.eng
--------------------------------------------------------------------------------
/c3_rev/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | project(c3_rev)
2 | cmake_minimum_required(VERSION 2.8)
3 | aux_source_directory(. SRC_LIST)
4 | file(GLOB INC_LIST "*.h")
5 |
6 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} -g")
7 |
8 | add_executable(${PROJECT_NAME} ${INC_LIST} ${SRC_LIST})
9 |
10 | target_link_libraries(${PROJECT_NAME} "winmm.lib")
11 | target_link_libraries(${PROJECT_NAME} "ddraw.lib")
12 | target_link_libraries(${PROJECT_NAME} "dsound.lib")
13 |
14 |
--------------------------------------------------------------------------------
/c3_rev/Caesar3.ini:
--------------------------------------------------------------------------------
1 | [Config]
2 | RAM=32
3 | CDDrive=..\cd.
4 |
5 |
--------------------------------------------------------------------------------
/c3_rev/basic.h:
--------------------------------------------------------------------------------
1 | #ifndef __C3_BASIC_INCLUDE__
2 | #define __C3_BASIC_INCLUDE__
3 |
4 | int fun_getStringWidth(const char *str, int fontId);
5 | int fun_strlen(const char *str);
6 | int fun_getCharWidth(unsigned __int8 c, int fontId);
7 | void unused_addToGameTextString(char *str, int group, int number, signed int len);
8 | void fun_strMoveLeft(char *start, const char *end);
9 | int fun_strToInt(char *str);
10 | int fun_strNumDigitChars(char *str);
11 |
12 | #endif
13 |
14 |
--------------------------------------------------------------------------------
/c3_rev/c3.inf:
--------------------------------------------------------------------------------
1 | . F F Nt 2 d d d B
--------------------------------------------------------------------------------
/c3_rev/cities_points.h:
--------------------------------------------------------------------------------
1 | #ifndef __C3_CITIESPOINTS_INCLUDE__
2 | #define __C3_CITIESPOINTS_INCLUDE__
3 |
4 | #include "defs.h"
5 |
6 | #define _RR_SIZE 10
7 |
8 | C3MapPoint stru_5F1890[_RR_SIZE]; //
9 | C3MapPoint stru_5F18A0[_RR_SIZE];
10 | C3MapPoint stru_5F18C0[_RR_SIZE];
11 | C3MapPoint stru_5F18F0[_RR_SIZE];
12 | C3MapPoint stru_5F1930[_RR_SIZE];
13 | C3MapPoint stru_5F1980[_RR_SIZE];
14 | C3MapPoint stru_5F19E0[_RR_SIZE];
15 | C3MapPoint stru_5F19F8[_RR_SIZE];
16 | C3MapPoint stru_5F1A20[_RR_SIZE];
17 | C3MapPoint stru_5F1A58[_RR_SIZE];
18 | C3MapPoint stru_5F1AA0[_RR_SIZE];
19 | C3MapPoint stru_5F1AF8[_RR_SIZE];
20 | C3MapPoint stru_5F1B60[_RR_SIZE];
21 | C3MapPoint stru_5F1B80[_RR_SIZE];
22 | C3MapPoint stru_5F1BB0[_RR_SIZE];
23 | C3MapPoint stru_5F1BF0[_RR_SIZE];
24 | C3MapPoint stru_5F1C40[_RR_SIZE];
25 | C3MapPoint stru_5F1CA0[_RR_SIZE];
26 | C3MapPoint stru_5F1D10[_RR_SIZE];
27 | C3MapPoint stru_5F1D38[_RR_SIZE];
28 | C3MapPoint stru_5F1D70[_RR_SIZE];
29 | C3MapPoint stru_5F1DB8[_RR_SIZE];
30 | C3MapPoint stru_5F1E10[_RR_SIZE];
31 | C3MapPoint stru_5F1E78[_RR_SIZE];
32 | C3MapPoint stru_5F1EF0[_RR_SIZE];
33 | C3MapPoint stru_5F1F20[_RR_SIZE];
34 | C3MapPoint stru_5F1F60[_RR_SIZE];
35 | C3MapPoint stru_5F1FB0[_RR_SIZE];
36 | C3MapPoint stru_5F2010[_RR_SIZE];
37 | C3MapPoint stru_5F2080[_RR_SIZE];
38 | C3MapPoint stru_5F20FE[_RR_SIZE];
39 |
40 | #endif
41 |
42 |
43 |
--------------------------------------------------------------------------------
/c3_rev/gui.cpp:
--------------------------------------------------------------------------------
1 | #include "variables.h"
2 |
3 | void fun_resetTooltipTimer()
4 | {
5 | mouseover_last_update = time_current;
6 | mouseover_info_id = 0;
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/c3_rev/gui.h:
--------------------------------------------------------------------------------
1 | #ifndef __C3_GUI_INCLUDE__
2 | #define __C3_GUI_INCLUDE__
3 |
4 | void fun_resetTooltipTimer();
5 |
6 | #endif
7 |
--------------------------------------------------------------------------------
/c3_rev/house_evol.h:
--------------------------------------------------------------------------------
1 | #ifndef __HOUSE_EVOL_INCLUDE__
2 | #define __HOUSE_EVOL_INCLUDE__
3 |
4 | void fun_determineHouseEvolveText(int buildingId);
5 |
6 | #endif
7 |
--------------------------------------------------------------------------------
/c3_rev/log.h:
--------------------------------------------------------------------------------
1 | #ifndef __LOG_INCLUDE__
2 | #define __LOG_INCLUDE__
3 |
4 | void fun_logDebugMessage(const char *msg, const char *paramStr, int paramInt);
5 |
6 | #endif
7 |
8 |
--------------------------------------------------------------------------------
/c3_rev/mmio.h:
--------------------------------------------------------------------------------
1 | #ifndef __MMIO_INCLUDE__
2 | #define __MMIO_INCLUDE__
3 |
4 | #include "windows.h"
5 |
6 | int mmio_loadFile(const char *pszFileName, HMMIO *outMmio, void **out_a3, const MMCKINFO *pmmckiParent);
7 | int mmio_530B40(HMMIO hmmio, int length1, char* a3, int a4, int a5);
8 | int mmio_close(HMMIO *mmio, HGLOBAL *a2);
9 | int cvtdate(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11);
10 | void __cdecl fun_writeLogMessageToStatusTxt(DWORD nNumberOfBytesToWrite);
11 | void fun_logDebugMessage(const char *msg, const char *paramStr, int paramInt);
12 | int fun_chdirToCdBasedOnExtension(const char *filename);
13 | void fun_storeFileExtension(const char *filename);
14 | void fun_strncpy(const char *src, char *dst, int len);
15 | void fun_strtoupper(char* a1);
16 | void fun_getGameTextString(int group, int number);
17 | void fun_drawHelpDialogWithVideo();
18 |
19 |
20 | void fun_chdirHome();
21 | void fun_getTimeAsString();
22 | int fun_intToString(signed int number, int offset, int addPlusSign);
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/c3_rev/win32-cross.cmake:
--------------------------------------------------------------------------------
1 | # Define the environment for cross compiling from Linux to Win32
2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name
3 | SET(CMAKE_SYSTEM_VERSION 1)
4 | SET(CMAKE_C_COMPILER /usr/bin/i686-w64-mingw32-gcc)
5 | SET(CMAKE_CXX_COMPILER /usr/bin/i686-w64-mingw32-g++)
6 | SET(CMAKE_RC_COMPILER /usr/bin/i686-w64-mingw32-windres)
7 | SET(CMAKE_RANLIB /usr/bin/i686-w64-mingw32-ranlib)
8 |
9 | # Configure the behaviour of the find commands
10 | SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
14 |
--------------------------------------------------------------------------------
/cmake/Modules/version.hpp.in.cmake:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_PROJECT_VERSION_INCLUDE_H_
17 | #define __OPENCAESAR3_PROJECT_VERSION_INCLUDE_H_
18 |
19 | #include "core/platform.hpp"
20 |
21 | #define OC3_VERSION_MAJOR 0
22 | #define OC3_VERSION_MINOR 2
23 | #define OC3_VERSION_REVSN @rev_number@
24 |
25 | #define OC3_STR_EXT(__A) #__A
26 | #define OC3_STR_A(__A) OC3_STR_EXT(__A)
27 | #define OC3_VERSION OC3_STR_A(OC3_VERSION_MAJOR)"."OC3_STR_A(OC3_VERSION_MINOR)"."OC3_STR_A(OC3_VERSION_REVSN)"["OC3_PLATFORM_NAME":"OC3_COMPILER_NAME"]"
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/cmake/vs/opencaesar3.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | @DEBUG_ARGS@
5 | WindowsLocalDebugger
6 |
7 |
8 | @DEBUG_ARGS@
9 | WindowsLocalDebugger
10 |
11 |
12 | @DEBUG_ARGS@
13 | WindowsLocalDebugger
14 |
15 |
16 | @DEBUG_ARGS@
17 | WindowsLocalDebugger
18 |
19 |
--------------------------------------------------------------------------------
/dependencies/README:
--------------------------------------------------------------------------------
1 | Use this folder for windows dependencies (http://opencaesar3.org/files/dependencies.7z)
2 |
--------------------------------------------------------------------------------
/docs/CIII_EmpireCatalog_PharaohAah.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gecube/opencaesar3/8f4678951c05cd7302fbdcfe22f5264d94270bfd/docs/CIII_EmpireCatalog_PharaohAah.pdf
--------------------------------------------------------------------------------
/locale/ru/russian.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gecube/opencaesar3/8f4678951c05cd7302fbdcfe22f5264d94270bfd/locale/ru/russian.csv
--------------------------------------------------------------------------------
/locale/ru/test.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gecube/opencaesar3/8f4678951c05cd7302fbdcfe22f5264d94270bfd/locale/ru/test.txt
--------------------------------------------------------------------------------
/models/game/archives.model:
--------------------------------------------------------------------------------
1 | {
2 | pics_1 : "resources/pics_1.zip"
3 | }
--------------------------------------------------------------------------------
/models/game/pantheon.model:
--------------------------------------------------------------------------------
1 | {
2 | ceres :
3 | {
4 | name : "Ceres",
5 | shortDesc : "Fertility",
6 | type : "goddess",
7 | service : "srvc_temple_ceres",
8 | image : "picture1_00013.png"
9 | },
10 |
11 | mars :
12 | {
13 | name : "Mars",
14 | shortDesc : "War",
15 | type : "god",
16 | service : "srvc_temple_mars",
17 | image : "picture1_00012.png"
18 | },
19 |
20 | neptune :
21 | {
22 | name : "Neptune"
23 | shortDesc : ""
24 | type : "god",
25 | service : "srvc_temple_neptune"
26 | image : "picture1_00015.png"
27 | },
28 |
29 | venus :
30 | {
31 | name : "Venus"
32 | shortDesc : ""
33 | type : "goddes"
34 | service : "srvc_temple_venus"
35 | image : "picture1_00011.png"
36 | },
37 |
38 | mercury :
39 | {
40 | name : "Mercury"
41 | shortDesc : ""
42 | type : "god",
43 | service : "srvc_temple_mercury"
44 | image : "picture1_00014.png"
45 | }
46 | }
--------------------------------------------------------------------------------
/models/game/settings.model:
--------------------------------------------------------------------------------
1 | {
2 | resolution : [1024, 768]
3 | fullscreen : false
4 | }
--------------------------------------------------------------------------------
/models/gui/educationadv.gui:
--------------------------------------------------------------------------------
1 | {
2 | lbBackground#Label :
3 | {
4 | geometryf : [ 0.0, 0.0, 1, 1 ]
5 | bgtype : "whiteFrame"
6 |
7 | lbBlackframe#Label : {
8 | geometryf : [ 0.05, 0.4, 0.95, 0.7 ]
9 | bgtype : "blackFrame"
10 | }
11 |
12 | lbWorkText#Label : {
13 | font : "FONT_1"
14 | geometry : [ 180, 80, 250, 105 ]
15 | text : "##work##"
16 | }
17 |
18 | lbMaxAvailableText#Label : {
19 | font : "FONT_1"
20 | geometry : [ 290, 80, 450, 105 ]
21 | text : "##max_available##"
22 | }
23 |
24 | lbCoverageText#Label : {
25 | font : "FONT_1"
26 | geometry : [ 480, 80, 600, 105 ]
27 | text : "##coverage##"
28 | }
29 |
30 | lbCityInfo#Label : {
31 | font : "FONT_1"
32 | geometry : [ 65, 50, 610, 80 ]
33 | }
34 |
35 | lbTroubleInfo#Label : {
36 | font : "FONT_1"
37 | multiline : true
38 | geometryf : [ 0.05, 0.71, 0.95, 0.95 ]
39 | }
40 |
41 | lbTitle#Label : {
42 | geometryf : [ 0.05, 0.05, 0.95, 0.1 ]
43 | minimumSize : [ 0, 30 ]
44 | maximumSize : [ 0, 60 ]
45 | font : "FONT_3"
46 | text : "##education_advisor_title##"
47 | textAlign : [ "center", "center" ]
48 | }
49 | }
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/models/gui/filmwidget.gui:
--------------------------------------------------------------------------------
1 | {
2 | geometry : [ 0, 0, 415, 450 ]
3 |
4 | lbBackground#Label :
5 | {
6 | geometryf : [ 0.0, 0.0, 1, 1 ]
7 | bgtype : "whiteFrame"
8 |
9 | lbTitle#Label :
10 | {
11 | font : "FONT_2"
12 | geometry : [ 42, 400, 370, 440 ]
13 | text : "##title##"
14 | textAlign : [ "center", "center" ]
15 | }
16 |
17 | btnHelp#TexturedButton :
18 | {
19 | geometry : [ 16, 408, 40, 432 ]
20 | normal : [ "paneling", 528 ]
21 | hovered : [ "paneling", 529 ]
22 | pressed : [ "paneling", 530 ]
23 | disabled : [ "paneling", 531 ]
24 | }
25 |
26 | btnExit#TexturedButton :
27 | {
28 | geometry : [ 374, 408, 398, 432 ]
29 | normal : [ "paneling", 532 ]
30 | hovered : [ "paneling", 533 ]
31 | pressed : [ "paneling", 534 ]
32 | disabled : [ "paneling", 535 ]
33 | }
34 |
35 | lbBlackFrame#Label : {
36 | geometry : [ 10, 310, 405, 400 ]
37 | bgtype : "blackFrame"
38 |
39 | lbTime#Label : {
40 | geometry : [ 0, 0, 150, 20 ]
41 | font : "FONT_1"
42 | }
43 |
44 | lbReceiver#Label : {
45 | geometry : [ 150, 0, 405, 20 ]
46 | font : "FONT_1"
47 | }
48 |
49 | lbMessage#Label : {
50 | geometry : [ 0, 20, 430, 90 ]
51 | font : "FONT_1"
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/models/gui/playername.gui:
--------------------------------------------------------------------------------
1 | {
2 | geometry : [ 0, 0, 380, 128 ]
3 |
4 | lbBackground#Label :
5 | {
6 | geometryf : [ 0.0, 0.0, 1, 1 ]
7 | bgtype : "whiteFrame"
8 |
9 | edPlayerName#EditBox :
10 | {
11 | geometry : [ 32, 50, 352, 82 ]
12 | textAlign : [ "upperLeft", "center" ]
13 | font : "FONT_2_WHITE"
14 | textOffset : [ 20, 0 ]
15 | text : "##new_governor##"
16 | }
17 |
18 | lbNext#Label :
19 | {
20 | geometry : [ 180, 90, 336, 110 ]
21 | text : "##plname_continue##"
22 | font : "FONT_2"
23 | }
24 |
25 | lbTitle#Label :
26 | {
27 | geometry : [ 10, 10, 380, 48 ]
28 | text : "##enter_your_name##"
29 | font : "FONT_3"
30 | textAlign : [ "center", "center" ]
31 | }
32 |
33 | btnContinue#TexturedButton :
34 | {
35 | geometry : [ 330, 90, 357, 117 ]
36 | normal : [ "paneling", 179 ]
37 | hovered : [ "paneling", 180 ]
38 | pressed : [ "paneling", 181 ]
39 | disabled : [ "paneling", 179 ]
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/models/gui/topmenu.gui:
--------------------------------------------------------------------------------
1 | {
2 | lbPopulation#Label : {
3 | geometry : [ 0, 0, 120, 23 ]
4 | image : "paneling_00015.png"
5 | font : "FONT_2_WHITE"
6 | textAlign : [ "center", "center" ]
7 | tooltipText : "##population_tooltip##"
8 | }
9 |
10 | lbDate#Label : {
11 | geometry : [ 0, 0, 120, 23 ]
12 | font : "FONT_2_YELLOW"
13 | textAlign : [ "center", "center" ]
14 | image : "paneling_00015.png"
15 | tooltipText : "##funds_tooltip##"
16 | }
17 |
18 | lbFunds#Label : {
19 | geometry : [ 0, 0, 120, 23 ]
20 | font : "FONT_2_WHITE"
21 | textAlign : [ "center", "center" ]
22 | image : "paneling_00015.png"
23 | tooltipText : "##date_tooltip##"
24 | }
25 |
26 | cntxItemFile#ContextMenuItem : {
27 | text : "##gmenu_file##"
28 | submenu : true
29 |
30 | cntxItemNewgame#ContextMenuItem : {
31 | text : "##gmenu_file_new##"
32 | }
33 |
34 | cntxItemRestart#ContextMenuItem : {
35 | text : "##gmenu_file_restart##"
36 | }
37 |
38 | cntxItemLoad#ContextMenuItem : {
39 | text : "##gmenu_file_load##"
40 | }
41 |
42 | cntxItemSave#ContextMenuItem : {
43 | text : "##gmenu_file_save##"
44 | }
45 |
46 | cntxItemMainMenu#ContextMenuItem : {
47 | text : "##gmenu_file_mainmenu##"
48 | }
49 |
50 | cntxItemExit#ContextMenuItem : {
51 | text : "##gmenu_file_exit##"
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/models/gui/videooptions.gui:
--------------------------------------------------------------------------------
1 | {
2 | geometry : [ 0, 0, 320, 290 ]
3 |
4 | lbTitle#Label :
5 | {
6 | font : "FONT_3"
7 | geometry : [ 30, 10, 290, 35 ]
8 | text : "##video_options##"
9 | textAlign : [ "center", "center" ]
10 | }
11 |
12 | lbBackground#Label :
13 | {
14 | geometryf : [ 0.0, 0.0, 1, 1 ]
15 | bgtype : "whiteFrame"
16 |
17 | btnSwitchMode#PushButton :
18 | {
19 | geometry : [ 50, 45, 270, 65 ]
20 | text : "##switch_mode##"
21 | bgtype : "smallGrayBorderLine"
22 | id : 1
23 | }
24 |
25 | lbxModes#ListBox :
26 | {
27 | geometry : [ 52, 68, 270, 232 ]
28 | bgtype : "smallGrayBorderLine"
29 | }
30 |
31 | btnCancel#PushButton :
32 | {
33 | geometry : [ 50, 237, 270, 257 ]
34 | bgtype : "smallGrayBorderLine"
35 | text : "##cancel##"
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/release_src.sh:
--------------------------------------------------------------------------------
1 | # make a SVN tag:
2 | # svn copy file:///home/greg/dev/SVN/caesar/trunk file:///home/greg/dev/SVN/caesar/tags/0-0-2
3 |
4 | DATE=`date +"%Y_%m_%d.%H_%M_%S"`
5 | DIR=BAK/REL_SRC_$DATE
6 | DST=$DIR/opencaesar3
7 | mkdir -p $DST
8 | cp *.?pp $DST
9 | cp make* $DST
10 | cp *.sh $DST
11 | cp *.csv $DST
12 | cp INSTALL* $DST
13 | cp README* $DST
14 | cp LICENSE* $DST
15 | mkdir -p $DST/fr/LC_MESSAGES
16 | cp fr/LC_MESSAGES/caesar.po $DST/fr/LC_MESSAGES
17 |
18 | tar cvz --directory $DIR -f opencaesar3-src-$DATE.tgz opencaesar3
19 | mv opencaesar3-src-$DATE.tgz BAK
20 |
21 |
22 |
--------------------------------------------------------------------------------
/release_win32.sh:
--------------------------------------------------------------------------------
1 | # make a SVN tag:
2 | # svn copy file:///home/greg/dev/SVN/caesar/trunk file:///home/greg/dev/SVN/caesar/tags/0-0-2
3 |
4 | DATE=`date +"%Y_%m_%d.%H_%M_%S"`
5 | DIR=BAK/REL_WIN32_$DATE
6 | DST=$DIR/opencaesar3
7 | mkdir -p $DST
8 |
9 | cp caesar.exe $DST
10 | cp *.csv $DST
11 |
12 | # copy text files in windows format
13 | for FILE in INSTALL_WINDOWS README LICENSE*
14 | do
15 | cp $FILE $DST/$FILE.txt
16 | todos $DST/$FILE.txt
17 | done
18 |
19 | # copy dependencies
20 | cp win32_deps/*.dll $DST
21 | cp win32_deps/*.ttf $DST
22 |
23 | mkdir $DST/sgreader
24 | cp win32_deps/sgreader/*.exe $DST/sgreader
25 | cp win32_deps/sgreader/*.txt $DST/sgreader
26 |
27 | # install translations
28 | mkdir -p $DST/fr/LC_MESSAGES
29 | cp fr/LC_MESSAGES/caesar.po $DST/fr/LC_MESSAGES
30 |
31 | # make stubs for resources directory
32 | mkdir -p $DST/resources/pics
33 | mkdir -p $DST/resources/maps
34 |
35 | cd $DIR
36 | zip -r opencaesar3-win32-$DATE.zip opencaesar3
37 | cd -
38 | mv $DIR/opencaesar3-win32-$DATE.zip BAK
39 |
40 |
--------------------------------------------------------------------------------
/resources/README:
--------------------------------------------------------------------------------
1 | Use this folder for game resources (http://opencaesar3.org/files/resources.7z)
2 |
--------------------------------------------------------------------------------
/sgreader/gui/extractthread.h:
--------------------------------------------------------------------------------
1 | #ifndef EXTRACTTHREAD_H
2 | #define EXTRACTTHREAD_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | class ExtractThread : public QThread {
10 | Q_OBJECT
11 |
12 | public:
13 | ExtractThread(const QStringList &files, const QString &outputDir,
14 | bool extractSystem);
15 | QStringList errors() const;
16 | void cancel();
17 | int errorCount() const;
18 | int extractCount() const;
19 |
20 | signals:
21 | void progressChanged(int value);
22 | void fileChanged(const QString &filename, int maxImages);
23 |
24 | protected:
25 | void run();
26 |
27 | private:
28 | void extractFile(const QString &filename);
29 |
30 | QStringList errorMessages;
31 | QStringList files;
32 | QDir outputDir;
33 | bool extractSystem;
34 | bool doCancel;
35 | int extracted;
36 | int errorImages;
37 | };
38 |
39 | #endif /* EXTRACTTHREAD_H */
40 |
--------------------------------------------------------------------------------
/sgreader/gui/extractwizard.cpp:
--------------------------------------------------------------------------------
1 | #include "extractwizard.h"
2 |
3 | #include "inputdirpage.h"
4 | #include "filelistpage.h"
5 | #include "outputdirpage.h"
6 | #include "progresspage.h"
7 |
8 | #include // TODO: specify
9 |
10 | ExtractWizard::ExtractWizard(QWidget *parent)
11 | : QWizard(parent)
12 | {
13 | setWindowTitle("Extract files wizard");
14 |
15 | addPage(new InputDirPage(this));
16 | addPage(new FileListPage(this));
17 | addPage(new OutputDirPage(this));
18 | addPage(new ProgressPage(this));
19 |
20 | setOptions(QWizard::DisabledBackButtonOnLastPage);
21 | setWizardStyle(QWizard::ClassicStyle);
22 |
23 | QList layout;
24 | layout << QWizard::CancelButton << QWizard::Stretch << QWizard::BackButton
25 | << QWizard::NextButton << QWizard::FinishButton;
26 | setButtonLayout(layout);
27 | }
28 |
29 | ExtractWizard::~ExtractWizard() {
30 |
31 | }
32 |
33 | void ExtractWizard::closeEvent(QCloseEvent *event) {
34 | ProgressPage *page = qobject_cast(currentPage());
35 |
36 | qDebug("Close called on dialog");
37 | if (page && page->isBusy()) {
38 | event->ignore();
39 | } else {
40 | event->accept();
41 | }
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/sgreader/gui/extractwizard.h:
--------------------------------------------------------------------------------
1 | #ifndef EXTRACTWIZARD_H
2 | #define EXTRACTWIZARD_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | class QStackedWidget;
9 | class QPushButton;
10 |
11 | class InputDirPage;
12 | class OutputDirPage;
13 | class FileListPage;
14 | class ProgressPage;
15 |
16 | class ExtractWizard : public QWizard {
17 | Q_OBJECT
18 |
19 | public:
20 | ExtractWizard(QWidget *parent = 0);
21 | ~ExtractWizard();
22 |
23 | protected:
24 | void closeEvent(QCloseEvent *event);
25 |
26 | private:
27 | InputDirPage *inputPage;
28 | FileListPage *filePage;
29 | OutputDirPage *outputPage;
30 | ProgressPage *progressPage;
31 |
32 | QStackedWidget *stackWidget;
33 | QPushButton *nextButton;
34 | QPushButton *prevButton;
35 | QPushButton *cancelButton;
36 |
37 | QString inputFolder;
38 | QString outputFolder;
39 | QStringList files;
40 | };
41 |
42 | #endif /* EXTRACTWIZARD_H */
43 |
--------------------------------------------------------------------------------
/sgreader/gui/filelistpage.h:
--------------------------------------------------------------------------------
1 | #ifndef FILELISTPAGE_H
2 | #define FILELISTPAGE_H
3 |
4 | #include
5 |
6 | class QListWidget;
7 |
8 | class FileListPage : public QWizardPage {
9 | public:
10 | FileListPage(QWidget *parent);
11 | void initializePage();
12 | bool validatePage();
13 |
14 | private:
15 | QListWidget *fileList;
16 | };
17 |
18 | #endif /* FILELISTPAGE_H */
19 |
--------------------------------------------------------------------------------
/sgreader/gui/inputdirpage.cpp:
--------------------------------------------------------------------------------
1 | #include "inputdirpage.h"
2 |
3 | #include // TODO: specify
4 |
5 | InputDirPage::InputDirPage(QWidget *parent)
6 | : QWizardPage(parent)
7 | {
8 | setTitle("Select the input folder");
9 |
10 | QLabel *inputDescription = new QLabel(
11 | tr("Choose the folder where the SG2/SG3 files are located that you wish"
12 | " to extract.\n\nFor Caesar 3, this is the installation folder, for"
13 | " the other Citybuilding games it's install_dir\\Data."));
14 | inputDescription->setWordWrap(true);
15 |
16 | QVBoxLayout *boxlayout = new QVBoxLayout();
17 | QHBoxLayout *dirlayout = new QHBoxLayout();
18 |
19 | QLabel *inputLabel = new QLabel(tr("Input folder:"));
20 | inputLineEdit = new QLineEdit();
21 | QPushButton *browseButton = new QPushButton(tr("Browse..."));
22 |
23 | connect(browseButton, SIGNAL(clicked()), this, SLOT(browseClicked()));
24 |
25 | dirlayout->addWidget(inputLabel);
26 | dirlayout->addWidget(inputLineEdit);
27 | dirlayout->addWidget(browseButton);
28 |
29 | boxlayout->addWidget(inputDescription);
30 | boxlayout->addLayout(dirlayout);
31 | boxlayout->addStretch();
32 |
33 | setLayout(boxlayout);
34 |
35 | registerField("inputDir*", inputLineEdit);
36 | }
37 |
38 | void InputDirPage::browseClicked() {
39 | QString dirname = QFileDialog::getExistingDirectory(this,
40 | tr("Choose the folder where the .sg2/.sg3 files are located"), inputLineEdit->text());
41 |
42 | if (!dirname.isEmpty()) {
43 | inputLineEdit->setText(dirname);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/sgreader/gui/inputdirpage.h:
--------------------------------------------------------------------------------
1 | #ifndef INPUTDIRPAGE_H
2 | #define INPUTDIRPAGE_H
3 |
4 | #include
5 |
6 | class QLineEdit;
7 |
8 | class InputDirPage : public QWizardPage {
9 | Q_OBJECT
10 |
11 | public:
12 | InputDirPage(QWidget *parent);
13 | QString inputDir() const;
14 |
15 | private slots:
16 | void browseClicked();
17 |
18 | private:
19 | QLineEdit *inputLineEdit;
20 | };
21 |
22 | #endif /* INPUTDIRPAGE_H */
23 |
--------------------------------------------------------------------------------
/sgreader/gui/outputdirpage.h:
--------------------------------------------------------------------------------
1 | #ifndef OUTPUTDIRPAGE_H
2 | #define OUTPUTDIRPAGE_H
3 |
4 | #include
5 |
6 | class QLineEdit;
7 | class QCheckBox;
8 |
9 | class OutputDirPage : public QWizardPage {
10 | Q_OBJECT
11 |
12 | public:
13 | OutputDirPage(QWidget *parent);
14 | void initializePage();
15 |
16 | private slots:
17 | void browseClicked();
18 |
19 | private:
20 | QLineEdit *outputLineEdit;
21 | QCheckBox *systemCheckbox;
22 | };
23 |
24 | #endif /* OUTPUTDIRPAGE_H */
25 |
--------------------------------------------------------------------------------
/sgreader/gui/progresspage.h:
--------------------------------------------------------------------------------
1 | #ifndef PROGRESSPAGE_H
2 | #define PROGRESSPAGE_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | class ExtractThread;
10 |
11 | class ProgressPage : public QWizardPage {
12 | Q_OBJECT
13 |
14 | public:
15 | ProgressPage(QWidget *parent);
16 | void initializePage();
17 | bool isComplete() const;
18 | bool isBusy() const;
19 |
20 | private slots:
21 | void progressChanged(int image);
22 | void fileChanged(const QString &filename, int numFiles);
23 | void threadFinished();
24 | void cancelThread();
25 |
26 | private:
27 | ExtractThread *thread;
28 | QProgressBar *fileProgress;
29 | QProgressBar *imageProgress;
30 | QLabel *fileLabel;
31 | QLabel *imageLabel;
32 | QPushButton *cancelButton;
33 | QTextEdit *errorTextEdit;
34 | };
35 |
36 | #endif /* PROGRESSPAGE_H */
37 |
--------------------------------------------------------------------------------
/sgreader/icons/sgreader.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gecube/opencaesar3/8f4678951c05cd7302fbdcfe22f5264d94270bfd/sgreader/icons/sgreader.ico
--------------------------------------------------------------------------------
/sgreader/icons/sgreader.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gecube/opencaesar3/8f4678951c05cd7302fbdcfe22f5264d94270bfd/sgreader/icons/sgreader.png
--------------------------------------------------------------------------------
/sgreader/imagetreeitem.cpp:
--------------------------------------------------------------------------------
1 | #include "imagetreeitem.h"
2 |
3 | ImageTreeItem::ImageTreeItem(QTreeWidget *parent, int id, SgImage *image)
4 | : QTreeWidgetItem(parent, ItemType), imageRecord(image), imageId(id)
5 | {
6 | setColumnData();
7 | }
8 |
9 | ImageTreeItem::ImageTreeItem(QTreeWidgetItem *parent, int id, SgImage *image)
10 | : QTreeWidgetItem(parent, ItemType), imageRecord(image), imageId(id)
11 | {
12 | setColumnData();
13 | }
14 |
15 | SgImage *ImageTreeItem::image() {
16 | return imageRecord;
17 | }
18 |
19 | void ImageTreeItem::setColumnData() {
20 | setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
21 | setText(0, QString("%0: %1").arg(imageId + 1)
22 | .arg(imageRecord->description()));
23 | //setData(0, Qt::DisplayRole, imageId);
24 | //setData(1, Qt::DisplayRole, imageRecord->description());
25 | setToolTip(0, imageRecord->fullDescription());
26 | }
27 |
--------------------------------------------------------------------------------
/sgreader/imagetreeitem.h:
--------------------------------------------------------------------------------
1 | #ifndef IMAGETREEITEM_H
2 | #define IMAGETREEITEM_H
3 |
4 | #include "sgimage.h"
5 |
6 | #include
7 | #include
8 |
9 | class ImageTreeItem : public QTreeWidgetItem {
10 | public:
11 | ImageTreeItem(QTreeWidget *parent, int id, SgImage *image);
12 | ImageTreeItem(QTreeWidgetItem *parent, int id, SgImage *image);
13 |
14 | SgImage *image();
15 |
16 | static const int ItemType = QTreeWidgetItem::UserType;
17 |
18 | private:
19 | void setColumnData();
20 | SgImage *imageRecord;
21 | int imageId;
22 | };
23 |
24 | #endif /* IMAGETREEITEM_H */
25 |
--------------------------------------------------------------------------------
/sgreader/mainwindow.h:
--------------------------------------------------------------------------------
1 | #ifndef MAINWINDOW_H
2 | #define MAINWINDOW_H
3 |
4 | #include
5 | #include // TODO: specify
6 |
7 | #include "sgfile.h"
8 | #include "sgimage.h"
9 |
10 | class QAction;
11 |
12 | class MainWindow : public QMainWindow {
13 | Q_OBJECT
14 |
15 | public:
16 | MainWindow();
17 | //~MainWindow();
18 |
19 |
20 | private slots:
21 | void openFile();
22 | void saveFile();
23 | void extractAll();
24 | void treeSelectionChanged();
25 | //void help();
26 | void license();
27 | void about();
28 |
29 | private:
30 | void createChildren();
31 | void createMenu();
32 | void createActions();
33 |
34 | void loadFile(const QString &filename);
35 | void loadImage(SgImage *image);
36 | void clearImage();
37 |
38 | QTreeWidget *treeWidget;
39 | QLabel *imageLabel;
40 | QString filename;
41 | QString appname;
42 | QImage image;
43 | SgFile *sgFile;
44 |
45 | QAction *openAction;
46 | QAction *saveAction;
47 | QAction *extractAllAction;
48 | QAction *exitAction;
49 |
50 | QAction *helpAction;
51 | QAction *licenseAction;
52 | QAction *aboutAction;
53 | };
54 |
55 | #endif /* MAINWINDOW_H */
56 |
--------------------------------------------------------------------------------
/sgreader/sgbitmap.h:
--------------------------------------------------------------------------------
1 | #ifndef SGBITMAP_H
2 | #define SGBITMAP_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | class QDataStream;
10 | class QFile;
11 | class SgBitmapRecord;
12 | class SgImage;
13 |
14 | class SgBitmap {
15 | public:
16 | SgBitmap(int id, const QString &sgFilename, QDataStream *stream);
17 | ~SgBitmap();
18 | int imageCount() const;
19 | QString description() const;
20 | QString bitmapName() const;
21 | QImage getImage(int id);
22 | SgImage *image(int id);
23 | void addImage(SgImage *child);
24 | QFile *openFile(char isExtern);
25 | QString errorMessage(int id) const;
26 |
27 | enum {
28 | RECORD_SIZE = 200
29 | };
30 | private:
31 | QString find555File();
32 | QString findFilenameCaseInsensitive(QDir directory, QString filename);
33 |
34 | QList images;
35 | SgBitmapRecord *record;
36 | QFile *file;
37 | QString sgFilename;
38 | int bitmapId;
39 | char isExtern;
40 | };
41 |
42 | #endif /* SGBITMAP_H */
43 |
--------------------------------------------------------------------------------
/sgreader/sgfile.h:
--------------------------------------------------------------------------------
1 | #ifndef SGFILE_H
2 | #define SGFILE_H
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | class SgBitmap;
9 | class SgImage;
10 | class SgHeader; // = header
11 |
12 | class SgFile {
13 | public:
14 | SgFile(const QString &filename);
15 | ~SgFile();
16 | bool load();
17 | int bitmapCount() const;
18 | int totalImageCount() const;
19 | int imageCount(int bitmapId) const;
20 | QString basename() const;
21 |
22 | SgBitmap *getBitmap(int bitmapId) const;
23 | QString getBitmapDescription(int bitmapId) const;
24 |
25 | SgImage *image(int bitmapId, int imageId) const;
26 | SgImage *image(int globalImageId) const;
27 |
28 | QImage getImage(int bitmapId, int imageId);
29 | QImage getImage(int globalImageId);
30 |
31 | QString errorMessage(int bitmapId, int imageId) const;
32 | QString errorMessage(int globalImageId) const;
33 |
34 | private:
35 | bool checkVersion();
36 | int maxBitmapRecords() const;
37 | void loadBitmaps(QDataStream *stream);
38 | void loadImages(QDataStream *stream, bool includeAlpha);
39 |
40 | QList bitmaps;
41 | QList images;
42 | QString filename;
43 | QString basefilename;
44 | SgHeader *header;
45 | };
46 |
47 | #endif /* SGFILE_H */
48 |
--------------------------------------------------------------------------------
/sgreader/sgreader.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = app
2 | TARGET =
3 | CONFIG += qxt
4 | QXT += core gui
5 | DEPENDPATH += . gui
6 | INCLUDEPATH += . gui
7 | OBJECTS_DIR = build/obj
8 | MOC_DIR = build/moc
9 | RCC_DIR = build/rcc
10 |
11 | # Input
12 | HEADERS += aboutdialog.h \
13 | imagetreeitem.h \
14 | licensedialog.h \
15 | mainwindow.h \
16 | sgbitmap.h \
17 | sgfile.h \
18 | sgimage.h \
19 | gui/filelistpage.h \
20 | gui/inputdirpage.h \
21 | gui/outputdirpage.h \
22 | gui/progresspage.h \
23 | gui/extractthread.h \
24 | gui/extractwizard.h
25 | SOURCES += aboutdialog.cpp \
26 | imagetreeitem.cpp \
27 | licensedialog.cpp \
28 | main.cpp \
29 | mainwindow.cpp \
30 | sgbitmap.cpp \
31 | sgfile.cpp \
32 | sgimage.cpp \
33 | gui/filelistpage.cpp \
34 | gui/inputdirpage.cpp \
35 | gui/outputdirpage.cpp \
36 | gui/progresspage.cpp \
37 | gui/extractthread.cpp \
38 | gui/extractwizard.cpp
39 | RESOURCES += sgreader.qrc
40 | RC_FILE = sgreader.rc
41 |
--------------------------------------------------------------------------------
/sgreader/sgreader.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | icons/sgreader.png
5 |
6 |
7 |
--------------------------------------------------------------------------------
/sgreader/sgreader.rc:
--------------------------------------------------------------------------------
1 | IDI_ICON1 ICON DISCARDABLE "icons/sgreader.ico"
2 |
--------------------------------------------------------------------------------
/source/building/buildings.hpp:
--------------------------------------------------------------------------------
1 | #include "wharf.hpp"
2 | #include "warehouse.hpp"
--------------------------------------------------------------------------------
/source/building/clay_pit.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CLAY_PIT_H_INCLUDED__
17 | #define __OPENCAESAR3_CLAY_PIT_H_INCLUDED__
18 |
19 | #include "factory.hpp"
20 |
21 | class ClayPit : public Factory
22 | {
23 | public:
24 | ClayPit();
25 |
26 | bool canBuild( CityPtr city, const TilePos& pos ) const; // returns true if it can be built there
27 | void timeStep( const unsigned long time );
28 | };
29 |
30 | #endif //__OPENCAESAR3_CLAY_PIT_H_INCLUDED__
31 |
--------------------------------------------------------------------------------
/source/building/education.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef _OPENCAESAR3_BUILDING_EDUCATION_H_INCLUDE_
17 | #define _OPENCAESAR3_BUILDING_EDUCATION_H_INCLUDE_
18 |
19 | #include "building/service.hpp"
20 |
21 | class School : public ServiceBuilding
22 | {
23 | public:
24 | School();
25 |
26 | int getVisitorsNumber() const;
27 |
28 | virtual void deliverService();
29 |
30 | virtual unsigned int getWalkerDistance() const;
31 | };
32 |
33 | class Library : public ServiceBuilding
34 | {
35 | public:
36 | Library();
37 |
38 | int getVisitorsNumber() const;
39 | };
40 |
41 | class College : public ServiceBuilding
42 | {
43 | public:
44 | College();
45 |
46 | int getVisitorsNumber() const;
47 | };
48 |
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/source/building/engineer_post.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_BUILDINGENGINEER_H_INCLUDE_
17 | #define __OPENCAESAR3_BUILDINGENGINEER_H_INCLUDE_
18 |
19 | #include "service.hpp"
20 |
21 | class EngineerPost : public ServiceBuilding
22 | {
23 | public:
24 | EngineerPost();
25 | void timeStep(const unsigned long time);
26 | void deliverService();
27 |
28 | unsigned int getWalkerDistance() const;
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/source/building/forum.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_FORUM_H_INCLUDED__
17 | #define __OPENCAESAR3_FORUM_H_INCLUDED__
18 |
19 | #include "service.hpp"
20 | #include "core/scopedptr.hpp"
21 |
22 | class Forum : public ServiceBuilding
23 | {
24 | public:
25 | Forum();
26 |
27 | int collectTaxes();
28 | int getPeoplesReached() const;
29 |
30 | virtual void deliverService();
31 | virtual void timeStep( const unsigned long time );
32 |
33 | private:
34 | class Impl;
35 | ScopedPtr< Impl > _d;
36 | };
37 |
38 | #endif //__OPENCAESAR3_FORUM_H_INCLUDED__
39 |
--------------------------------------------------------------------------------
/source/building/garden.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 |
17 | #ifndef __OPENCAESAR3_GARDEN_H_INCLUDED__
18 | #define __OPENCAESAR3_GARDEN_H_INCLUDED__
19 |
20 | #include "game/construction.hpp"
21 |
22 | class Garden : public Construction
23 | {
24 | public:
25 | Garden();
26 | virtual void initTerrain(Tile& terrain);
27 | virtual bool isWalkable() const;
28 | virtual bool isNeedRoadAccess() const;
29 | virtual void build(CityPtr city, const TilePos& pos );
30 | virtual void load(const VariantMap &stream);
31 | void update();
32 | };
33 |
34 | #endif //__OPENCAESAR3_GARDEN_H_INCLUDED__
35 |
--------------------------------------------------------------------------------
/source/building/granary.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_GRANARY_H_INCLUDED__
17 | #define __OPENCAESAR3_GRANARY_H_INCLUDED__
18 |
19 | #include "working.hpp"
20 |
21 | class GoodStore;
22 | class Granary : public WorkingBuilding
23 | {
24 | public:
25 | Granary();
26 |
27 | virtual void timeStep(const unsigned long time);
28 | void computePictures();
29 | GoodStore& getGoodStore();
30 |
31 | virtual void save( VariantMap& stream) const;
32 | virtual void load( const VariantMap& stream);
33 |
34 | private:
35 | void _tryDevastateGranary();
36 |
37 | class Impl;
38 | ScopedPtr< Impl > _d;
39 | };
40 |
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/source/building/marble_quarry.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_FACTORYMARBLE_H_INCLUDED__
17 | #define __OPENCAESAR3_FACTORYMARBLE_H_INCLUDED__
18 |
19 | #include "factory.hpp"
20 |
21 | class MarbleQuarry : public Factory
22 | {
23 | public:
24 | MarbleQuarry();
25 |
26 | virtual bool canBuild(CityPtr city, const TilePos& pos ) const; // returns true if it can be built there
27 | virtual void timeStep(const unsigned long time);
28 | };
29 |
30 | #endif //__OPENCAESAR3_FACTORYMARBLE_H_INCLUDED__
31 |
--------------------------------------------------------------------------------
/source/building/military.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_MILITARY_BUILDING_H_INCLUDED__
17 | #define __OPENCAESAR3_MILITARY_BUILDING_H_INCLUDED__
18 |
19 | #include "working.hpp"
20 |
21 | class Barracks : public WorkingBuilding
22 | {
23 | public:
24 | Barracks();
25 | };
26 |
27 | class FortLegionnaire : public Building
28 | {
29 | public:
30 | FortLegionnaire();
31 | };
32 |
33 | class FortJaveline : public Building
34 | {
35 | public:
36 | FortJaveline();
37 | };
38 |
39 | class FortMounted : public Building
40 | {
41 | public:
42 | FortMounted();
43 | };
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/source/building/military_academy.cpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 |
17 | #include "military_academy.hpp"
18 | #include "constants.hpp"
19 |
20 | MilitaryAcademy::MilitaryAcademy() : WorkingBuilding( constants::building::B_MILITARY_ACADEMY, Size(3) )
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/source/building/military_academy.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_ACADEMY_H_INCLUDED__
17 | #define __OPENCAESAR3_ACADEMY_H_INCLUDED__
18 |
19 | #include "working.hpp"
20 |
21 | class MilitaryAcademy : public WorkingBuilding
22 | {
23 | public:
24 | MilitaryAcademy();
25 | };
26 |
27 | #endif //__OPENCAESAR3_ACADEMY_H_INCLUDED__
28 |
--------------------------------------------------------------------------------
/source/building/pottery.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_FACTORY_POTTERY_H_INCLUDED__
17 | #define __OPENCAESAR3_FACTORY_POTTERY_H_INCLUDED__
18 |
19 | #include "factory.hpp"
20 |
21 | class Pottery : public Factory
22 | {
23 | public:
24 | Pottery();
25 |
26 | virtual bool canBuild(CityPtr city, const TilePos &pos) const;
27 | virtual void timeStep(const unsigned long time);
28 | };
29 |
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/source/building/prefecture.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_BUILDINGPREFECT_H_INCLUDED__
17 | #define __OPENCAESAR3_BUILDINGPREFECT_H_INCLUDED__
18 |
19 | #include "service.hpp"
20 | #include "core/position.hpp"
21 |
22 | class Prefecture : public ServiceBuilding
23 | {
24 | public:
25 | Prefecture();
26 | void timeStep(const unsigned long time);
27 | void deliverService();
28 | int getServiceDelay() const;
29 |
30 | void fireDetect( const TilePos& pos );
31 |
32 | private:
33 | TilePos _fireDetect;
34 | };
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/source/building/senate.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_SENATE_H_INCLUDED_
17 | #define __OPENCAESAR3_SENATE_H_INCLUDED_
18 |
19 | #include "service.hpp"
20 | #include "core/scopedptr.hpp"
21 |
22 | class Senate : public ServiceBuilding
23 | {
24 | public:
25 | Senate();
26 | unsigned int getFunds() const;
27 |
28 | int collectTaxes();
29 | int getPeoplesReached() const;
30 |
31 | virtual std::string getError() const;
32 |
33 | void deliverService();
34 |
35 | bool canBuild(CityPtr city, const TilePos& pos )const;
36 | private:
37 | class Impl;
38 | ScopedPtr< Impl > _d;
39 | };
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/source/building/warehouse.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 | //
16 | // Copyright 2012-2013 Gregoire Athanase, gathanase@gmail.com
17 |
18 |
19 | #ifndef WAREHOUSE_HPP
20 | #define WAREHOUSE_HPP
21 |
22 | #include "working.hpp"
23 | #include "game/enums.hpp"
24 | #include "game/good.hpp"
25 | #include "core/position.hpp"
26 |
27 | class GoodStore;
28 |
29 | class Warehouse: public WorkingBuilding
30 | {
31 | friend class WarehouseStore;
32 |
33 | public:
34 | Warehouse();
35 |
36 | virtual void timeStep(const unsigned long time);
37 | void computePictures();
38 | GoodStore& getGoodStore();
39 |
40 | virtual void save(VariantMap& stream) const;
41 | virtual void load(const VariantMap& stream);
42 |
43 | private:
44 | void _resolveDevastationMode();
45 |
46 | class Impl;
47 | ScopedPtr< Impl > _d;
48 | };
49 |
50 |
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/source/building/well.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_WELL_H_INCLUDED__
17 | #define __OPENCAESAR3_WELL_H_INCLUDED__
18 |
19 | #include "service.hpp"
20 |
21 | class Well : public ServiceBuilding
22 | {
23 | public:
24 | Well();
25 |
26 | virtual void deliverService();
27 |
28 | virtual bool isNeedRoadAccess() const;
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/source/core/alignment.cpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #include "core/alignment.hpp"
17 |
18 |
19 | AlignHelper::AlignHelper() : EnumsHelper( alignAuto )
20 | {
21 | append( alignUpperLeft, "upperLeft" );
22 | append( alignLowerRight, "lowerRight" );
23 | append( alignCenter, "center" );
24 | append( alignScale, "scale" );
25 | append( alignAuto, "auto" );
26 | }
27 |
--------------------------------------------------------------------------------
/source/core/alignment.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_ALIGNMENT_H_INCLUDED__
17 | #define __OPENCAESAR3_ALIGNMENT_H_INCLUDED__
18 |
19 | #include "enumerator.hpp"
20 |
21 | enum TypeAlign
22 | {
23 | //! Aligned to parent's top or left side (default)
24 | alignUpperLeft=0,
25 | //! Aligned to parent's bottom or right side
26 | alignLowerRight,
27 | //! Aligned to the center of parent
28 | alignCenter,
29 | //! Stretched to fit parent
30 | alignScale,
31 | //!
32 | alignAuto
33 | };
34 |
35 | class AlignHelper : public EnumsHelper
36 | {
37 | public:
38 | AlignHelper();
39 | };
40 |
41 | #endif // __NRP_ALIGNMENT_H_INCLUDED__
42 |
43 |
--------------------------------------------------------------------------------
/source/core/bytearray.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_BYTEARRAY_H_INCLUDED__
17 | #define __OPENCAESAR3_BYTEARRAY_H_INCLUDED__
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | class ByteArray : public std::vector
24 | {
25 | public:
26 | ByteArray()
27 | {
28 |
29 | }
30 |
31 | ByteArray& operator=( const std::string& str )
32 | {
33 | resize( str.size() + 1, 0 );
34 | memcpy( &(*this)[0], str.c_str(), str.size() );
35 | return *this;
36 | }
37 |
38 | const char* data() const
39 | {
40 | return &(*this)[0];
41 | }
42 |
43 | char* data()
44 | {
45 | return &(*this)[0];
46 | }
47 | };
48 |
49 | #endif //__OPENCAESAR3_BYTEARRAY_H_INCLUDED__
--------------------------------------------------------------------------------
/source/core/direction.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 |
17 | #ifndef _OPENCAESAR3_DIRECTION_INCLUDE_H_
18 | #define _OPENCAESAR3_DIRECTION_INCLUDE_H_
19 |
20 | namespace constants
21 | {
22 |
23 | typedef enum
24 | {
25 | noneDirection,
26 | north,
27 | northWest,
28 | west,
29 | southWest,
30 | south,
31 | southEast,
32 | east,
33 | northEast,
34 | countDirection
35 | } Direction;
36 |
37 | } //end namespace constants
38 |
39 | #endif //_OPENCAESAR3_DIRECTION_INCLUDE_H_
40 |
--------------------------------------------------------------------------------
/source/core/eventconverter.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 |
17 | #ifndef __OPENCAESAR3_EVENTCONVERTER_H_INCLUDE_
18 | #define __OPENCAESAR3_EVENTCONVERTER_H_INCLUDE_
19 |
20 | #include "event.hpp"
21 | #include
22 | #include
23 |
24 | class EventConverter
25 | {
26 | public:
27 | static EventConverter& instance();
28 | ~EventConverter();
29 |
30 | NEvent get( const SDL_Event& event );
31 |
32 | private:
33 | class Impl;
34 | std::auto_ptr< Impl > _d;
35 |
36 | EventConverter();
37 | };
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/source/core/exception.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 | //
16 | // Copyright 2012-2013 Gregoire Athanase, gathanase@gmail.com
17 |
18 |
19 | #ifndef EXCEPTION_HPP
20 | #define EXCEPTION_HPP
21 |
22 |
23 | #include
24 |
25 | #define THROW(x) { std::stringstream _exception_text; _exception_text << x; throw Exception(_exception_text.str()); }
26 |
27 |
28 | class Exception
29 | {
30 | public:
31 | Exception(const std::string &aDescription)
32 | {
33 | _desc = aDescription;
34 | };
35 |
36 | ~Exception() {};
37 |
38 | const std::string& getDescription() const
39 | {
40 | return _desc;
41 | }
42 |
43 | private:
44 | std::string _desc;
45 | };
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/source/core/flagholder.hpp:
--------------------------------------------------------------------------------
1 | #ifndef __OPENCAESAR3_FLAGHOLDER_H_INCLUDE_
2 | #define __OPENCAESAR3_FLAGHOLDER_H_INCLUDE_
3 |
4 | template< class T >
5 | class FlagHolder
6 | {
7 | public:
8 | FlagHolder() : _flags( 0 ) {}
9 |
10 | void setFlag( T flag, bool enabled=true )
11 | {
12 | if( enabled )
13 | _flags |= flag;
14 | else
15 | _flags &= ~flag;
16 | }
17 |
18 | void resetFlag( T flag )
19 | {
20 | setFlag( flag, false );
21 | }
22 |
23 | bool isFlag( T flag ) const
24 | {
25 | return (_flags & flag) > 0;
26 | }
27 |
28 | void setFlags( int val )
29 | {
30 | _flags = val;
31 | }
32 | private:
33 |
34 | int _flags;
35 | };
36 |
37 | #endif
38 |
39 |
--------------------------------------------------------------------------------
/source/core/gettext.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 | //
16 | // Copyright 2012-2013 Gregoire Athanase, gathanase@gmail.com
17 |
18 |
19 | #ifndef GETTEXT_HPP
20 | #define GETTEXT_HPP
21 |
22 | #include
23 | #define _(x) gettext(x)
24 |
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/source/core/logger.cpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #include "logger.hpp"
17 | #include "requirements.hpp"
18 | #include "stringhelper.hpp"
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | void Logger::warning( const char* fmt, ... )
31 | {
32 | va_list argument_list;
33 | va_start(argument_list, fmt);
34 |
35 | std::string ret;
36 | StringHelper::vformat( ret, 512, fmt, argument_list );
37 |
38 | va_end(argument_list);
39 |
40 | std::cout << ret << std::endl;
41 | }
42 |
43 | void Logger::redirect(std::string filename )
44 | {
45 | std::ofstream* file = new std::ofstream();
46 |
47 | file->open("stdout.txt");
48 | std::cout.rdbuf( file->rdbuf() ); // перенапраляем в файл
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/source/core/logger.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_LOGGER_H_INCLUDED__
17 | #define __OPENCAESAR3_LOGGER_H_INCLUDED__
18 |
19 | #include
20 |
21 | class Logger
22 | {
23 | public:
24 | static void warning( const char* fmt, ...);
25 |
26 | static void redirect( std::string filename );
27 | };
28 |
29 | #endif //__OPENCAESAR3_LOGGER_H_INCLUDED__
30 |
--------------------------------------------------------------------------------
/source/core/safetycast.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 |
17 | #ifndef __OPENCAESAR3_SAFETY_CAST_INCLUDE_
18 | #define __OPENCAESAR3_SAFETY_CAST_INCLUDE_
19 |
20 | #include
21 |
22 | template
23 | inline T safety_cast( B object ) throw()
24 | {
25 | try
26 | {
27 | return dynamic_cast(object);
28 | }
29 | #if defined(OC3_PLATFORM_WIN) && !defined(OC3_USE_MINGW_COMPILER)
30 | catch(std::__non_rtti_object )
31 | {
32 | //LOGIT(pfEmerg, "cast(0x%p): __non_rtti_object exception has caught: '%s'\n", object, e.what());
33 | return 0;
34 | }
35 | #else
36 | catch(std::bad_cast)
37 | {
38 | return 0;
39 | }
40 | #endif
41 | catch(...)
42 | {
43 | //LOGIT(pfEmerg, "cast(0x%p): an unknown exception has caught.\n", object);
44 | return 0;
45 | }
46 | }
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/source/core/saveadapter.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_SAVEADAPTER_H_INCLUDED__
17 | #define __OPENCAESAR3_SAVEADAPTER_H_INCLUDED__
18 |
19 | #include "core/variant.hpp"
20 | #include "vfs/filepath.hpp"
21 |
22 | class SaveAdapter
23 | {
24 | public:
25 | static VariantMap load( const io::FilePath& fileName );
26 |
27 | static bool save( const VariantMap& options, const io::FilePath& filename );
28 | private:
29 | SaveAdapter();
30 | };
31 |
32 | #endif //__OPENCAESAR3_SAVEADAPTER_H_INCLUDED__
33 |
--------------------------------------------------------------------------------
/source/core/serializer.cpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 | //
16 | // Copyright 2012-2013 Gregoire Athanase, gathanase@gmail.com
17 |
18 | #include "serializer.hpp"
19 |
20 | const char* Serializable::damageLevel = "damageLevel";
21 | const char* Serializable::fireLevel = "fireLevel";
22 |
23 |
--------------------------------------------------------------------------------
/source/core/serializer.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 | //
16 | // Copyright 2012-2013 Gregoire Athanase, gathanase@gmail.com
17 |
18 | #ifndef __OPENCAESAR3_SERIALIZABLE_H_INCLUDED__
19 | #define __OPENCAESAR3_SERIALIZABLE_H_INCLUDED__
20 |
21 | class VariantMap;
22 |
23 | class Serializable
24 | {
25 | public:
26 | static const char* damageLevel;
27 | static const char* fireLevel;
28 | // read/write self on stream
29 | virtual void save( VariantMap& options ) const = 0;
30 | virtual void load( const VariantMap& options ) = 0;
31 | };
32 |
33 |
34 | #endif //__OPENCAESAR3_SERIALIZABLE_H_INCLUDED__
35 |
--------------------------------------------------------------------------------
/source/core/stringarray.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_STRINGARRAY_H_INCLUDED__
17 | #define __OPENCAESAR3_STRINGARRAY_H_INCLUDED__
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | class StringArray : public std::vector< std::string >
24 | {
25 | public:
26 | std::string rand() const
27 | {
28 | return empty() ? "" : at( std::rand() % size() );
29 | }
30 | };
31 |
32 | #endif //__OPENCAESAR3_STRINGARRAY_H_INCLUDED__
33 |
--------------------------------------------------------------------------------
/source/events/setvideooptions.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef _OPENCAESAR_EVENT_SETVIDEOOPTIONS_H_INCLUDE_
17 | #define _OPENCAESAR_EVENT_SETVIDEOOPTIONS_H_INCLUDE_
18 |
19 | #include "event.hpp"
20 |
21 | namespace events
22 | {
23 |
24 | class SetVideoSettings : public GameEvent
25 | {
26 | public:
27 | static GameEventPtr create();
28 | virtual void exec( Game& game );
29 |
30 | private:
31 | void _setResolution(Size);
32 | void _setFullscreen(bool);
33 | };
34 |
35 | }
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/source/events/showfeastwindow.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef _OPENCAESAR_EVENT_SHOWFEASTWINDOW_H_INCLUDE_
17 | #define _OPENCAESAR_EVENT_SHOWFEASTWINDOW_H_INCLUDE_
18 |
19 | #include "event.hpp"
20 |
21 | namespace events
22 | {
23 |
24 | class ShowFeastWindow : public GameEvent
25 | {
26 | public:
27 | static GameEventPtr create(std::string text, std::string title, std::string receiver);
28 | virtual void exec( Game& game );
29 |
30 | private:
31 | std::string _text;
32 | std::string _title;
33 | std::string _receiver;
34 | };
35 |
36 | }
37 |
38 | #endif //_OPENCAESAR_EVENT_SHOWFEASTWINDOW_H_INCLUDE_
39 |
--------------------------------------------------------------------------------
/source/game/abstractloader.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_SCENARIOABSTRACTLOADER_H_INCLUDED__
17 | #define __OPENCAESAR3_SCENARIOABSTRACTLOADER_H_INCLUDED__
18 |
19 | #include "core/referencecounted.hpp"
20 |
21 | class Game;
22 |
23 | class GameAbstractLoader : public ReferenceCounted
24 | {
25 | public:
26 | virtual ~GameAbstractLoader() {}
27 | virtual bool load( const std::string& filename, Game& oScenario ) = 0;
28 | virtual bool isLoadableFileExtension( const std::string& filename ) = 0;
29 | //virtual bool isLoadableFileFormat( file ) = 0;
30 | };
31 |
32 |
33 | #endif //__OPENCAESAR3_SCENARIOABSTRACTLOADER_H_INCLUDED__
34 |
--------------------------------------------------------------------------------
/source/game/alarm_event_holder.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_ALARM_EVENT_HOLDER_H_INCLUDED__
17 | #define __OPENCAESAR3_ALARM_EVENT_HOLDER_H_INCLUDED__
18 |
19 | #include "core/scopedptr.hpp"
20 | #include "core/position.hpp"
21 | #include "core/signals.hpp"
22 |
23 | #include
24 |
25 | class AlarmEventHolder
26 | {
27 | public:
28 | AlarmEventHolder();
29 |
30 | ~AlarmEventHolder();
31 |
32 | void add(TilePos pos, std::string message );
33 | void next();
34 |
35 | bool haveAlarms() const;
36 | TilePos getCurrentPos() const;
37 | std::string getCurrentMessage() const;
38 |
39 | oc3_signals public:
40 | Signal1& onAlarmChange();
41 | Signal1& onMoveToAlarm();
42 |
43 | private:
44 | class Impl;
45 | ScopedPtr< Impl > _d;
46 | };
47 |
48 | #endif //__OPENCAESAR3_ALARM_EVENT_HOLDER_H_INCLUDED__
49 |
--------------------------------------------------------------------------------
/source/game/astarpathfinding.hpp:
--------------------------------------------------------------------------------
1 | #ifndef __OPENCAESAR3_ASTARPATHFINDING_H_INCLUDED__
2 | #define __OPENCAESAR3_ASTARPATHFINDING_H_INCLUDED__
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include "core/scopedptr.hpp"
9 |
10 | class Tilemap;
11 | class TilePos;
12 | class Pathway;
13 | class AStarPoint;
14 | class Size;
15 | class Tile;
16 |
17 | class Pathfinder
18 | {
19 | public:
20 | typedef enum { noFlags=0x0, checkStart=0x1, checkStop=0x2, roadOnly=0x4, waterOnly=0x8,
21 | terrainOnly=0x10, traversePath=0x20, everyWhere=0x80 } Flags;
22 | static const AStarPoint invalidPoint;
23 | static Pathfinder& getInstance();
24 |
25 | void update( const Tilemap& tmap );
26 |
27 | bool getPath( const TilePos& start, const TilePos& stop,
28 | Pathway& oPathWay, int flags,
29 | const Size& arrivedArea );
30 |
31 | bool getPath( const Tile& start, const Tile& stop,
32 | Pathway& oPathWay, int flags,
33 | const Size& arrivedArea );
34 |
35 | unsigned int getMaxLoopCount() const;
36 |
37 | ~Pathfinder();
38 | private:
39 | Pathfinder();
40 |
41 | bool aStar( const TilePos& start, const TilePos& stop, const Size& arrivedArea, Pathway& oPathWay, int flags );
42 |
43 | class Impl;
44 | ScopedPtr< Impl > _d;
45 | };
46 |
47 |
48 | #endif //__OPENCAESAR3_ASTARPATHFINDING_H_INCLUDED__
49 |
--------------------------------------------------------------------------------
/source/game/citizen_group.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef _OPENCAESAR_HOUSE_HABITANT_INCLUDE_H_
17 | #define _OPENCAESAR_HOUSE_HABITANT_INCLUDE_H_
18 |
19 | #include "core/variant.hpp"
20 |
21 | class CitizenGroup : public std::map< int, int >
22 | {
23 | public:
24 | typedef enum { newborn=0, child, scholar, student, mature, aged, longliver=99 } Age;
25 | typedef enum { childMin=2, matureMin=21 } AgeRange;
26 |
27 | int count() const;
28 | int count( Age group ) const;
29 |
30 | CitizenGroup retrieve( int count );
31 |
32 | CitizenGroup& operator += ( const CitizenGroup& b );
33 |
34 | VariantList save() const;
35 | void load( const VariantList& stream );
36 | };
37 |
38 | #endif //_OPENCAESAR_HOUSE_HABITANT_INCLUDE_H_
39 |
--------------------------------------------------------------------------------
/source/game/cityservice.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_H_INCLUDED__
18 |
19 | #include "core/referencecounted.hpp"
20 | #include "core/smartptr.hpp"
21 |
22 | class CityService : public ReferenceCounted
23 | {
24 | public:
25 | virtual void update( const unsigned int time ) = 0;
26 |
27 | virtual std::string getName() const { return _name; }
28 | virtual bool isDeleted() const { return false; }
29 |
30 | virtual void destroy() {}
31 |
32 | protected:
33 | CityService( const std::string& name ) : _name( name )
34 | {
35 | }
36 |
37 | protected:
38 | std::string _name;
39 | };
40 |
41 | typedef SmartPtr CityServicePtr;
42 |
43 | #endif//__OPENCAESAR3_CITYSERVICE_H_INCLUDED__
44 |
--------------------------------------------------------------------------------
/source/game/cityservice_animals.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_ANIMALS_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_ANIMALS_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "core/predefinitions.hpp"
22 |
23 | class CityServiceAnimals : public CityService
24 | {
25 | public:
26 | static CityServicePtr create( CityPtr city );
27 |
28 | void update( const unsigned int time );
29 |
30 | private:
31 | CityServiceAnimals();
32 |
33 | class Impl;
34 | ScopedPtr< Impl > _d;
35 | };
36 |
37 | #endif //__OPENCAESAR3_CITYSERVICE_ANIMALS_H_INCLUDED__
38 |
--------------------------------------------------------------------------------
/source/game/cityservice_culture.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_CULTURE_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_CULTURE_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "core/predefinitions.hpp"
22 |
23 | class CityServiceCulture : public CityService
24 | {
25 | public:
26 | typedef enum { ccSchool, ccLibrary, ccAcademy, ccReligion, ccTheatres } Coverage;
27 | static CityServicePtr create( CityPtr city );
28 |
29 | void update( const unsigned int time );
30 | int getValue() const;
31 |
32 | int getCoverage( Coverage type ) const;
33 |
34 | static std::string getDefaultName();
35 |
36 | private:
37 | CityServiceCulture( CityPtr city );
38 |
39 | class Impl;
40 | ScopedPtr< Impl > _d;
41 | };
42 |
43 | #endif //__OPENCAESAR3_CITYSERVICE_CULTURE_H_INCLUDED__
44 |
--------------------------------------------------------------------------------
/source/game/cityservice_disorder.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_DISORDER_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_DISORDER_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "core/predefinitions.hpp"
22 |
23 | class CityServiceDisorder : public CityService
24 | {
25 | public:
26 | static CityServicePtr create( CityPtr city );
27 |
28 | void update( const unsigned int time );
29 | private:
30 | CityServiceDisorder( CityPtr city );
31 |
32 | class Impl;
33 | ScopedPtr< Impl > _d;
34 | };
35 |
36 | #endif //__OPENCAESAR3_CITYSERVICE_DISORDER_H_INCLUDED__
37 |
--------------------------------------------------------------------------------
/source/game/cityservice_emigrant.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_EMIGRANT_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_EMIGRANT_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "core/predefinitions.hpp"
22 |
23 | class CityServiceEmigrant : public CityService
24 | {
25 | public:
26 | static CityServicePtr create( CityPtr city );
27 |
28 | void update( const unsigned int time );
29 |
30 | private:
31 | CityServiceEmigrant( CityPtr city );
32 |
33 | class Impl;
34 | ScopedPtr< Impl > _d;
35 | };
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/source/game/cityservice_fishplace.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_FISHPLACE_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_FISHPLACE_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "core/predefinitions.hpp"
22 |
23 | class CityServiceFishPlace : public CityService
24 | {
25 | public:
26 | static CityServicePtr create( CityPtr city );
27 |
28 | void update( const unsigned int time );
29 |
30 | private:
31 | CityServiceFishPlace( CityPtr city );
32 |
33 | class Impl;
34 | ScopedPtr< Impl > _d;
35 | };
36 |
37 | #endif //__OPENCAESAR3_CITYSERVICE_FISHPLACE_H_INCLUDED__
38 |
--------------------------------------------------------------------------------
/source/game/cityservice_info.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_INFO_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_INFO_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "core/predefinitions.hpp"
22 |
23 | class CityServiceInfo : public CityService
24 | {
25 | public:
26 | static CityServicePtr create( CityPtr city );
27 |
28 | void update( const unsigned int time );
29 |
30 | private:
31 | CityServiceInfo( CityPtr city );
32 |
33 | class Impl;
34 | ScopedPtr< Impl > _d;
35 | };
36 |
37 | #endif //__OPENCAESAR3_CITYSERVICE_INFO_H_INCLUDED__
38 |
--------------------------------------------------------------------------------
/source/game/cityservice_religion.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_RELIGION_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_RELIGION_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "core/predefinitions.hpp"
22 |
23 | class CityServiceReligion : public CityService
24 | {
25 | public:
26 | static CityServicePtr create( CityPtr city );
27 |
28 | void update( const unsigned int time );
29 |
30 | private:
31 | CityServiceReligion( CityPtr city );
32 |
33 | class Impl;
34 | ScopedPtr< Impl > _d;
35 | };
36 |
37 | #endif //__OPENCAESAR3_CITYSERVICE_RELIGION_H_INCLUDED__
38 |
--------------------------------------------------------------------------------
/source/game/cityservice_roads.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_ROADS_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_ROADS_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "core/predefinitions.hpp"
22 |
23 | class CityServiceRoads : public CityService
24 | {
25 | public:
26 | static CityServicePtr create( CityPtr city );
27 |
28 | void update( const unsigned int time );
29 | ~CityServiceRoads();
30 | private:
31 | CityServiceRoads( CityPtr city );
32 |
33 | class Impl;
34 | ScopedPtr< Impl > _d;
35 | };
36 |
37 | #endif //__OPENCAESAR3_CITYSERVICE_ROADS_H_INCLUDED__
38 |
--------------------------------------------------------------------------------
/source/game/cityservice_shoreline.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_SHORELINE_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_SHORELINE_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/predefinitions.hpp"
21 | #include "core/scopedptr.hpp"
22 |
23 | class CityServiceShoreline : public CityService
24 | {
25 | public:
26 | static CityServicePtr create( CityPtr city );
27 |
28 | void update( const unsigned int time );
29 |
30 | private:
31 | CityServiceShoreline( CityPtr city );
32 |
33 | class Impl;
34 | ScopedPtr< Impl > _d;
35 | };
36 |
37 | #endif //__OPENCAESAR3_CITYSERVICE_SHORELINE_H_INCLUDED__
38 |
--------------------------------------------------------------------------------
/source/game/cityservice_timers.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_TIMERS_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_TIMERS_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "timer.hpp"
21 |
22 | class CityServiceTimers : public CityService
23 | {
24 | public:
25 | static CityServiceTimers& getInstance();
26 |
27 | void update( const unsigned int time );
28 | void addTimer( TimerPtr timer );
29 |
30 | ~CityServiceTimers();
31 | private:
32 | CityServiceTimers();
33 |
34 | class Impl;
35 | ScopedPtr< Impl > _d;
36 | };
37 |
38 |
39 | #endif //__OPENCAESAR3_CITYSERVICE_TIMERS_H_INCLUDED__
40 |
--------------------------------------------------------------------------------
/source/game/cityservice_water.cpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #include "cityservice_water.hpp"
17 | #include "city.hpp"
18 |
19 | class CityServiceWater::Impl
20 | {
21 | public:
22 | CityPtr city;
23 | };
24 |
25 | CityServicePtr CityServiceWater::create( CityPtr city )
26 | {
27 | CityServiceWater* ret = new CityServiceWater( city );
28 |
29 | return CityServicePtr( ret );
30 | }
31 |
32 | CityServiceWater::CityServiceWater( CityPtr city )
33 | : CityService( "water" ), _d( new Impl )
34 | {
35 | _d->city = city;
36 | }
37 |
38 | void CityServiceWater::update( const unsigned int time )
39 | {
40 | if( time % 22 != 1 )
41 | return;
42 |
43 | //unsigned int vacantPop=0;
44 | }
45 |
--------------------------------------------------------------------------------
/source/game/cityservice_water.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_WATER_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_WATER_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "core/predefinitions.hpp"
22 |
23 | class CityServiceWater : public CityService
24 | {
25 | public:
26 | static CityServicePtr create( CityPtr city );
27 |
28 | void update( const unsigned int time );
29 | private:
30 | CityServiceWater( CityPtr city );
31 |
32 | class Impl;
33 | ScopedPtr< Impl > _d;
34 | };
35 |
36 | #endif //__OPENCAESAR3_CITYSERVICE_WATER_H_INCLUDED__
37 |
--------------------------------------------------------------------------------
/source/game/cityservice_workershire.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_CITYSERVICE_WORKERSHIRE_H_INCLUDED__
17 | #define __OPENCAESAR3_CITYSERVICE_WORKERSHIRE_H_INCLUDED__
18 |
19 | #include "cityservice.hpp"
20 | #include "core/scopedptr.hpp"
21 | #include "gfx/tileoverlay.hpp"
22 | #include "core/predefinitions.hpp"
23 |
24 | class CityServiceWorkersHire : public CityService
25 | {
26 | public:
27 | static CityServicePtr create( CityPtr city );
28 |
29 | void update( const unsigned int time );
30 | private:
31 | CityServiceWorkersHire( CityPtr city );
32 |
33 | void _hireByType( const TileOverlay::Type type );
34 | bool _haveHr( WorkingBuildingPtr building );
35 |
36 | class Impl;
37 | ScopedPtr< Impl > _d;
38 | };
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/source/game/constants.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 | //
16 | // Copyright 2012-2013 Gregoire Athanase, gathanase@gmail.com
17 |
18 |
19 | #ifndef _OPENCAESAR3_GAME_CONSTANTS_INCLUDE_H_
20 | #define _OPENCAESAR3_GAME_CONSTANTS_INCLUDE_H_
21 |
22 | #include "building/constants.hpp"
23 |
24 | namespace constants
25 | {
26 |
27 | namespace place
28 | {
29 | const TileOverlay::Type fishPlace=100;
30 | }
31 |
32 | }
33 |
34 | #endif //_OPENCAESAR3_GAME_CONSTANTS_INCLUDE_H_
35 |
--------------------------------------------------------------------------------
/source/game/fish_place.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef _OPENCAESAR3_FISHPLACE_H_INCLUDE_
17 | #define _OPENCAESAR3_FISHPLACE_H_INCLUDE_
18 |
19 | #include "gfx/tileoverlay.hpp"
20 |
21 | class FishPlace : public TileOverlay
22 | {
23 | public:
24 | FishPlace();
25 | ~FishPlace();
26 |
27 | virtual void build(CityPtr city, const TilePos &pos);
28 | virtual void initTerrain(Tile &terrain);
29 | virtual void timeStep(const unsigned long time);
30 | virtual void destroy();
31 |
32 | const PicturesArray& getPictures(Renderer::Pass pass) const;
33 | Renderer::PassQueue getPassQueue() const;
34 |
35 | private:
36 |
37 | class Impl;
38 | ScopedPtr< Impl > _d;
39 | };
40 |
41 | #endif //_OPENCAESAR3_FISHPLACE_H_INCLUDE_
42 |
--------------------------------------------------------------------------------
/source/game/gamedate.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_GAMEDATE_H_INCLUDED__
17 | #define __OPENCAESAR3_GAMEDATE_H_INCLUDED__
18 |
19 | #include "core/time.hpp"
20 | #include "core/scopedptr.hpp"
21 |
22 | class GameDate
23 | {
24 | public:
25 | static DateTime current();
26 |
27 | static void timeStep( unsigned int time );
28 |
29 | static void init( const DateTime& date );
30 |
31 | static GameDate& instance();
32 |
33 | ~GameDate();
34 |
35 | private:
36 | GameDate();
37 |
38 | class Impl;
39 | ScopedPtr< Impl > _d;
40 | };
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/source/game/goodhelper.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 |
17 | #ifndef __OPENCAESAR3_GOODHELPER_H_INCLUDED__
18 | #define __OPENCAESAR3_GOODHELPER_H_INCLUDED__
19 |
20 | #include "core/scopedptr.hpp"
21 | #include "gfx/picture.hpp"
22 | #include "good.hpp"
23 | #include "core/direction.hpp"
24 |
25 | class GoodStock;
26 |
27 | class GoodHelper
28 | {
29 | public:
30 | static GoodHelper& getInstance();
31 |
32 | static std::string getName( Good::Type type );
33 | static Picture getPicture( Good::Type type, bool emp=false );
34 | static Good::Type getType( const std::string& name );
35 | static std::string getTypeName( Good::Type type );
36 | static Picture getCartPicture( const GoodStock& stock, constants::Direction direction );
37 | ~GoodHelper();
38 | private:
39 | GoodHelper();
40 |
41 | class Impl;
42 | ScopedPtr< Impl > _d;
43 | };
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/source/game/goodorders.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_GOODORDERS_H_INCLUDED__
17 | #define __OPENCAESAR3_GOODORDERS_H_INCLUDED__
18 |
19 | #include "good.hpp"
20 | #include "core/scopedptr.hpp"
21 |
22 | class GoodOrders
23 | {
24 | public:
25 | typedef enum { accept=0, reject, deliver, none } Order;
26 |
27 | GoodOrders();
28 | ~GoodOrders();
29 |
30 | void set( const Good::Type type, Order rule );
31 | void set( Order rule );
32 | Order get( const Good::Type type );
33 |
34 | private:
35 | class Impl;
36 | ScopedPtr< Impl > _d;
37 | };
38 |
39 | #endif //__OPENCAESAR3_GOODORDERS_H_INCLUDED__
40 |
--------------------------------------------------------------------------------
/source/game/infoboxmanager.hpp:
--------------------------------------------------------------------------------
1 | #ifndef __OPENCAESAR3_INFOBOX_MANAGER_H_INCLUDE_
2 | #define __OPENCAESAR3_INFOBOX_MANAGER_H_INCLUDE_
3 |
4 | #include "core/smartptr.hpp"
5 | #include "core/referencecounted.hpp"
6 | #include "core/scopedptr.hpp"
7 | #include "core/predefinitions.hpp"
8 | #include "enums.hpp"
9 | #include "gui/info_box.hpp"
10 |
11 | class InfoBoxManager;
12 | typedef SmartPtr< InfoBoxManager > InfoBoxManagerPtr;
13 |
14 | class InfoboxCreator
15 | {
16 | public:
17 | virtual gui::InfoBoxSimple* create( gui::Widget*, const Tile& ) = 0;
18 | };
19 |
20 | class InfoBoxManager : public ReferenceCounted
21 | {
22 | public:
23 | static InfoBoxManagerPtr create( CityPtr city, gui::GuiEnv* gui );
24 |
25 | void showHelp( const Tile& tile );
26 | void setShowDebugInfo( const bool showInfo );
27 |
28 | void addInfobox( const TileOverlay::Type type, const std::string& typeName, InfoboxCreator* ctor );
29 | bool canCreate( const TileOverlay::Type type ) const;
30 | private:
31 | InfoBoxManager( CityPtr city, gui::GuiEnv* gui );
32 | ~InfoBoxManager();
33 |
34 | class Impl;
35 | ScopedPtr< Impl > _d;
36 | };
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/source/game/loader.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 | //
16 | // Copyright 2012-2013 Gregoire Athanase, gathanase@gmail.com
17 |
18 |
19 | #ifndef SCENARIO_LOADER_HPP
20 | #define SCENARIO_LOADER_HPP
21 |
22 | #include "core/scopedptr.hpp"
23 | #include "vfs/filepath.hpp"
24 |
25 | class Game;
26 |
27 | class GameLoader
28 | {
29 | public:
30 | GameLoader();
31 | ~GameLoader();
32 |
33 | bool load(const io::FilePath& filename, Game& game);
34 |
35 | private:
36 | class Impl;
37 | ScopedPtr< Impl > _d;
38 | };
39 |
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/source/game/loader_map.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_SCENARIOMAP_LOADER_H_INCLUDED__
17 | #define __OPENCAESAR3_SCENARIOMAP_LOADER_H_INCLUDED__
18 |
19 | #include "abstractloader.hpp"
20 | #include "core/scopedptr.hpp"
21 |
22 | class GameLoaderC3Map : public GameAbstractLoader
23 | {
24 | public:
25 | GameLoaderC3Map();
26 |
27 | bool load(const std::string& filename, Game& game);
28 | bool isLoadableFileExtension( const std::string& filename );
29 |
30 | private:
31 | class Impl;
32 | ScopedPtr< Impl > _d;
33 | };
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/source/game/loader_oc3mission.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_SCENARIO_OC3MISSION_LOADER_H_INCLUDED__
17 | #define __OPENCAESAR3_SCENARIO_OC3MISSION_LOADER_H_INCLUDED__
18 |
19 | #include "abstractloader.hpp"
20 | #include "core/scopedptr.hpp"
21 |
22 | class GameLoaderMission : public GameAbstractLoader
23 | {
24 | public:
25 | GameLoaderMission();
26 |
27 | bool load(const std::string& filename, Game& oScenario);
28 | bool isLoadableFileExtension( const std::string& filename );
29 |
30 | private:
31 | class Impl;
32 | ScopedPtr< Impl > _d;
33 | };
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/source/game/loader_oc3save.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_SCENARIO_OC3SAVE_LOADER_H_INCLUDED__
17 | #define __OPENCAESAR3_SCENARIO_OC3SAVE_LOADER_H_INCLUDED__
18 |
19 | #include "abstractloader.hpp"
20 | #include "core/scopedptr.hpp"
21 |
22 | class Game;
23 |
24 | class GameLoaderOc3 : public GameAbstractLoader
25 | {
26 | public:
27 | bool load(const std::string& filename, Game &game);
28 | bool isLoadableFileExtension( const std::string& filename );
29 | };
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/source/game/loader_sav.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_SCENARIOSAV_LOADER_H_INCLUDED__
17 | #define __OPENCAESAR3_SCENARIOSAV_LOADER_H_INCLUDED__
18 |
19 | #include "abstractloader.hpp"
20 | #include "core/scopedptr.hpp"
21 |
22 | class GameLoaderC3Sav : public GameAbstractLoader
23 | {
24 | public:
25 | GameLoaderC3Sav();
26 |
27 | bool load(const std::string& filename, Game& game);
28 | bool isLoadableFileExtension( const std::string& filename );
29 |
30 | private:
31 | class Impl;
32 | ScopedPtr< Impl > _d;
33 | };
34 |
35 | #endif // __OPENCAESAR3_SCENARIOSAV_LOADER_H_INCLUDED__
36 |
--------------------------------------------------------------------------------
/source/game/name_generator.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_NAME_GENERATOR_H_INCLUDED__
17 | #define __OPENCAESAR3_NAME_GENERATOR_H_INCLUDED__
18 |
19 | #include "core/scopedptr.hpp"
20 | #include "vfs/filepath.hpp"
21 |
22 | class NameGenerator
23 | {
24 | public:
25 | typedef enum { male=0, female,
26 | patricianMale, patricianFemale } NameType;
27 | static NameGenerator& instance();
28 |
29 | ~NameGenerator();
30 |
31 | static std::string rand( NameType type );
32 | static void initialize( const io::FilePath& filename );
33 |
34 | private:
35 | NameGenerator();
36 |
37 | class Impl;
38 | ScopedPtr< Impl > _d;
39 | };
40 |
41 | #endif //__OPENCAESAR3_NAME_GENERATOR_H_INCLUDED__
42 |
--------------------------------------------------------------------------------
/source/game/pathway_helper.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef __OPENCAESAR3_PATHWAYHELPER_H_INCLUDED__
17 | #define __OPENCAESAR3_PATHWAYHELPER_H_INCLUDED__
18 |
19 | #include "pathway.hpp"
20 |
21 | class PathwayHelper
22 | {
23 | public:
24 | typedef enum { roadOnly=0, allTerrain, roadFirst } WayType;
25 | static Pathway create(CityPtr city,
26 | TilePos startPos, TilePos stopPos,
27 | WayType type=roadOnly, Size arrivedArea=Size(1));
28 |
29 | static Pathway randomWay( CityPtr city, TilePos startPos, int walkRadius );
30 | };
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/source/game/roadbuild_helper.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 |
17 | #ifndef __OPENCAESAR3_ROADPROPAGATOR_H_INCLUDE_
18 | #define __OPENCAESAR3_ROADPROPAGATOR_H_INCLUDE_
19 |
20 | #include "core/scopedptr.hpp"
21 | #include "tilemap.hpp"
22 |
23 | class Tilemap;
24 |
25 | class RoadPropagator
26 | {
27 | public:
28 | /** finds the shortest path between origin and destination
29 | * returns True if a path exists
30 | * the path is returned in oPathWay
31 | */
32 | static ConstTilemapWay createPath( const Tilemap& tileMap, const Tile& startTile, const Tile& destination );
33 | };
34 |
35 | #endif //__OPENCAESAR3_ROADPROPAGATOR_H_INCLUDE_
36 |
--------------------------------------------------------------------------------
/source/game/route.hpp:
--------------------------------------------------------------------------------
1 | // This file is part of openCaesar3.
2 | //
3 | // openCaesar3 is free software: you can redistribute it and/or modify
4 | // it under the terms of the GNU General Public License as published by
5 | // the Free Software Foundation, either version 3 of the License, or
6 | // (at your option) any later version.
7 | //
8 | // openCaesar3 is distributed in the hope that it will be useful,
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | // GNU General Public License for more details.
12 | //
13 | // You should have received a copy of the GNU General Public License
14 | // along with openCaesar3. If not, see .
15 |
16 | #ifndef _OPENCAESAR3_APPOINTEDWAY_H_INCLUDE_
17 | #define _OPENCAESAR3_APPOINTEDWAY_H_INCLUDE_
18 |
19 | #include "oc3_pathway.hpp"
20 | #include