This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cn:orx:config:main [2010/08/05 05:27 (15 years ago)] – yatusiter | cn:orx:config:main [2020/08/19 20:03 (5 years ago)] (current) – Old content sausage | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 配置 ====== | ||
- | 本部分专注于[[http:// | ||
- | ===== 简介 ===== | ||
- | |||
- | 配置系统是Orx的核心模块之一。它是使得Orx成为一个数据驱动游戏引擎的主要模块。\\ | ||
- | 它是需要学习的最重要的模块之一,因为它可以在运行中调整和修改。\\ | ||
- | 当你习惯它以后,你的开发时间将会大大地缩短。 | ||
- | |||
- | |||
- | 它的格式和[[wp> | ||
- | 同时也添加了一些特别的操作符((例如,为了处理list,random或者包含文件))将会在 [[syntax|语法部分]]中介绍。 | ||
- | |||
- | |||
- | |||
- | ===== General information ===== | ||
- | |||
- | When orx is initialized, | ||
- | Basically it will remove the extension from your executable name, if any, and add the '' | ||
- | In the same way, if your program is called '' | ||
- | |||
- | In that file you can include as many other config files ((with any kind of extension, '' | ||
- | You can also load config files directly in code. | ||
- | |||
- | <code c> | ||
- | |||
- | Once a config file is loaded, accessing its information will be done in memory, the file won't be read from disk again unless specifically asked with calls to '' | ||
- | |||
- | You can even save the content of the config to a file, either completely or partially. Here's the function you need to call in order to do so: | ||
- | |||
- | <code c> | ||
- | |||
- | '' | ||
- | If you pass '' | ||
- | Please note that the original comments of originally loaded files won't be saved as they' | ||
- | |||
- | In your '' | ||
- | In the first case, you will then be asked for each key/value pair of this section if you want to save it or not. | ||
- | |||
- | This filter system is very handy when you want to save partial data, like for handling save games as you'll see in [[savegame|the savegame section]]. | ||
- | |||
- | You can find the config module API in doxygen format via [[http:// | ||
- | We believe the API is self explanatory and shouldn' | ||
- | |||
- | Config' | ||
- | The last section shows how to adapt it for handling save games. | ||
- | |||
- | There are many ways in which the config module can be helpful: for example, it already is the base for the localization module.\\ | ||
- | It's now up to you to find other clever ways of using it depending on your needs. =) | ||
- | |||
- | |||
- | ===== Sections ===== | ||
- | |||
- | * [[Syntax]] | ||
- | * [[cn: | ||
- | * [[cn: | ||
- | * [[encryption|Encryption & orxCrypt program]] | ||
- | * [[savegame|Using config module for savegames]] |