_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Public Member Functions | Public Attributes | List of all members
Settings Struct Reference

#include <settings.h>

Public Member Functions

bool GetUserGameSetting (int i)
 
void SetUserGameSetting (int i, bool v)
 
bool operator== (const Settings &other) const
 
void Save (const std::function< void(std::string)> &f, bool withPlayers=true)
 
bool SetField (std::string field, int value)
 
void Init ()
 

Public Attributes

NetGameTypes NetGameType
 
SettingsPresets Presets [PlayerMax]
 Multiplayer or single player. More...
 
int8_t Resources
 
int8_t NumUnits
 Preset resource factor. More...
 
int8_t Opponents
 Preset # of units. More...
 
int8_t Difficulty
 Preset # of ai-opponents. More...
 
GameTypes GameType
 Terrain type (summer,winter,...) More...
 
FieldOfViewTypes FoV
 Game type (melee, free for all,...) More...
 
MapRevealModes RevealMap
 Which field of view is used - important to be shared for unit sight. More...
 
RevealTypes DefeatReveal
 Reveal map kind. More...
 
union {
   struct {
      unsigned   NoFogOfWar:1
 
      unsigned   Inside:1
 if dynamic fog of war is disabled More...
 
      unsigned   AiExplores:1
 if game uses interior tileset or is generally "inside" for the purpose of obstacles More...
 
      unsigned   SimplifiedAutoTargeting:1
 If true, AI sends explorers to search for resources (almost useless thing) More...
 
      unsigned   AiChecksDependencies:1
 Use alternate target choosing algorithm for auto attack mode (idle, attack-move, patrol, etc.) More...
 
      unsigned   UserGameSettings:27
 If false, the AI can do upgrades even if the dependencies are not met. This can be desirable to simplify AI scripting. More...
 
   } 
 
   uint32_t   _Bitfield
 
}; 
 

Detailed Description

Settings structure

This structure one day should contain all common game settings, in-game, or pre-start, and the individual (per player) presets. This allows central maintenance, easy (network-)negotiation, simplifies load/save/reinitialization, etc...

Member Function Documentation

◆ GetUserGameSetting()

bool Settings::GetUserGameSetting ( int  i)
inline

◆ Init()

void Settings::Init ( )
inline

◆ operator==()

bool Settings::operator== ( const Settings other) const
inline

◆ Save()

void Settings::Save ( const std::function< void(std::string)> &  f,
bool  withPlayers = true 
)
inline

◆ SetField()

bool Settings::SetField ( std::string  field,
int  value 
)
inline

◆ SetUserGameSetting()

void Settings::SetUserGameSetting ( int  i,
bool  v 
)
inline

Member Data Documentation

◆ @35

union { ... }

◆ _Bitfield

uint32_t Settings::_Bitfield

◆ AiChecksDependencies

unsigned Settings::AiChecksDependencies

Use alternate target choosing algorithm for auto attack mode (idle, attack-move, patrol, etc.)

◆ AiExplores

unsigned Settings::AiExplores

if game uses interior tileset or is generally "inside" for the purpose of obstacles

◆ DefeatReveal

RevealTypes Settings::DefeatReveal

Reveal map kind.

◆ Difficulty

int8_t Settings::Difficulty

Preset # of ai-opponents.

◆ FoV

FieldOfViewTypes Settings::FoV

Game type (melee, free for all,...)

◆ GameType

GameTypes Settings::GameType

Terrain type (summer,winter,...)

◆ Inside

unsigned Settings::Inside

if dynamic fog of war is disabled

◆ NetGameType

NetGameTypes Settings::NetGameType

◆ NoFogOfWar

unsigned Settings::NoFogOfWar

◆ NumUnits

int8_t Settings::NumUnits

Preset resource factor.

◆ Opponents

int8_t Settings::Opponents

Preset # of units.

◆ Presets

SettingsPresets Settings::Presets[PlayerMax]

Multiplayer or single player.

◆ Resources

int8_t Settings::Resources

◆ RevealMap

MapRevealModes Settings::RevealMap

Which field of view is used - important to be shared for unit sight.

◆ SimplifiedAutoTargeting

unsigned Settings::SimplifiedAutoTargeting

If true, AI sends explorers to search for resources (almost useless thing)

◆ UserGameSettings

unsigned Settings::UserGameSettings

If false, the AI can do upgrades even if the dependencies are not met. This can be desirable to simplify AI scripting.


The documentation for this struct was generated from the following file:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.