src/settings.h
branchgamebalance
changeset 9908 0fa543611bbe
parent 9906 6f41b8713b65
child 6871 5a9dc001e1ad
equal deleted inserted replaced
9907:3b068c3a1c74 9908:0fa543611bbe
     1 /* $Id$ */
     1 /* $Id$ */
       
     2 
       
     3 /** @file settings.h */
     2 
     4 
     3 #ifndef SETTINGS_H
     5 #ifndef SETTINGS_H
     4 #define SETTINGS_H
     6 #define SETTINGS_H
     5 
     7 
     6 #include "saveload.h"
     8 #include "saveload.h"
    10  * @see VarTypes
    12  * @see VarTypes
    11  * @see SettingDescBase */
    13  * @see SettingDescBase */
    12 enum SettingDescTypeLong {
    14 enum SettingDescTypeLong {
    13 	/* 4 bytes allocated a maximum of 16 types for GenericType */
    15 	/* 4 bytes allocated a maximum of 16 types for GenericType */
    14 	SDT_BEGIN       = 0,
    16 	SDT_BEGIN       = 0,
    15 	SDT_NUMX        = 0, // any number-type
    17 	SDT_NUMX        = 0, ///< any number-type
    16 	SDT_BOOLX       = 1, // a boolean number
    18 	SDT_BOOLX       = 1, ///< a boolean number
    17 	SDT_ONEOFMANY   = 2, // bitmasked number where only ONE bit may be set
    19 	SDT_ONEOFMANY   = 2, ///< bitmasked number where only ONE bit may be set
    18 	SDT_MANYOFMANY  = 3, // bitmasked number where MULTIPLE bits may be set
    20 	SDT_MANYOFMANY  = 3, ///< bitmasked number where MULTIPLE bits may be set
    19 	SDT_INTLIST     = 4, // list of integers seperated by a comma ','
    21 	SDT_INTLIST     = 4, ///< list of integers seperated by a comma ','
    20 	SDT_STRING      = 5, // string with a pre-allocated buffer
    22 	SDT_STRING      = 5, ///< string with a pre-allocated buffer
    21 	SDT_END,
    23 	SDT_END,
    22 	/* 10 more possible primitives */
    24 	/* 10 more possible primitives */
    23 };
    25 };
    24 
    26 
    25 template <> struct EnumPropsT<SettingDescTypeLong> : MakeEnumPropsT<SettingDescTypeLong, byte, SDT_BEGIN, SDT_END, SDT_END> {};
    27 template <> struct EnumPropsT<SettingDescTypeLong> : MakeEnumPropsT<SettingDescTypeLong, byte, SDT_BEGIN, SDT_END, SDT_END> {};
    82 /** The patch values that are used for new games and/or modified in config file */
    84 /** The patch values that are used for new games and/or modified in config file */
    83 extern Patches _patches_newgame;
    85 extern Patches _patches_newgame;
    84 
    86 
    85 bool IConsoleSetPatchSetting(const char *name, int32 value);
    87 bool IConsoleSetPatchSetting(const char *name, int32 value);
    86 void IConsoleGetPatchSetting(const char *name);
    88 void IConsoleGetPatchSetting(const char *name);
       
    89 void IConsoleListPatches();
    87 const SettingDesc *GetPatchFromName(const char *name, uint *i);
    90 const SettingDesc *GetPatchFromName(const char *name, uint *i);
    88 bool SetPatchValue(uint index, const Patches *object, int32 value);
    91 bool SetPatchValue(uint index, const Patches *object, int32 value);
    89 
    92 
    90 #endif /* SETTINGS_H */
    93 #endif /* SETTINGS_H */