C# Class idTech4.Game.idGame

Inheritance: idBaseGame
显示文件 Open project: iainmckay/idtech4.net

Public Methods

Method Description
CacheDictionaryMedia ( idDict dict ) : void

This is called after parsing an EntityDef and for each entity spawnArgs before merging the entitydef. It could be done post-merge, but that would avoid the fast pre-cache check associated with each entityDef.

CalculateFieldOfView ( float baseFov, float &fovX, float &fovY ) : void

Calculates the horizontal and vertical field of view based on a horizontal field of view and custom aspect ratio.

Draw ( int clientIndex ) : bool
FindEntityDef ( string name, bool makeDefault ) : idDeclEntity
FindEntityDefDict ( string name, bool makeDefault ) : idDict
FindEntityUsingDef ( idEntity from, string match ) : idEntity

Searches all active entities for the next one using the specified entityDef.

Searches beginning at the entity after from, or the beginning if NULL NULL will be returned if the end of the list is reached.

GetBestGameType ( string map, string gameType ) : string
GetMapLoadingInterface ( string defaultInterface ) : string
GetTimeGroupTime ( int timeGroup ) : int
HandleGuiCommands ( string menuCommand ) : string
HandleMainMenuCommands ( string menuCommand, idUserInterface gui ) : void
Init ( ) : void
InitFromNewMap ( string mapName, idRenderWorld renderWorld, idSoundWorld soundWorld, bool isServer, bool isClient, int randomSeed ) : void
RegisterEntity ( idEntity entity ) : void
RunFrame ( idUserCommand userCommands ) : GameReturn
SelectInitialSpawnPoint ( idPlayer player ) : idEntity

spectators are spawned randomly anywhere. in-game clients are spawned based on distance to active players (randomized on the first half) upon map restart, initial spawns are used (randomized ordered list of spawns flagged "initial"). if there are more players than initial spots, overflow to regular spawning.

SelectTimeGroup ( int timeGroup ) : void
ServerClientBegin ( int clientIndex ) : void
ServerClientConnect ( int clientIndex, string guid ) : void
ServerSendChatMessage ( int to, string name, string text ) : void
SetLocalClient ( int clientIndex ) : void
SetPersistentPlayerInformation ( int clientIndex, idDict playerInfo ) : void
SetServerInfo ( idDict serverInfo ) : void
SetUserInformation ( int clientIndex, idDict userInfo, bool isClient, bool canModify ) : idDict
SpawnEntityDef ( idDict args, bool setDefaults = true ) : idEntity
SpawnPlayer ( int clientIndex ) : void
idGame ( ) : System

Private Methods

Method Description
Clear ( ) : void
CreateGameRules ( ) : void
InhibitEntitySpawn ( idDict args ) : bool
InitAsyncNetwork ( ) : void
InitClientDeclRemap ( int clientIndex ) : void
InitConsoleCommands ( ) : void
InitCvars ( ) : void
LoadMap ( string mapName, int randomSeed ) : void
MapPopulate ( ) : void
RandomizeInitialSpawns ( ) : void
SpawnMapEntities ( ) : void

Parses textual entity definitions out of an entstring and spawns gentities.

Method Details

CacheDictionaryMedia() public method

This is called after parsing an EntityDef and for each entity spawnArgs before merging the entitydef. It could be done post-merge, but that would avoid the fast pre-cache check associated with each entityDef.
public CacheDictionaryMedia ( idDict dict ) : void
dict idDict
return void

CalculateFieldOfView() public method

Calculates the horizontal and vertical field of view based on a horizontal field of view and custom aspect ratio.
public CalculateFieldOfView ( float baseFov, float &fovX, float &fovY ) : void
baseFov float
fovX float
fovY float
return void

Draw() public method

public Draw ( int clientIndex ) : bool
clientIndex int
return bool

FindEntityDef() public method

public FindEntityDef ( string name, bool makeDefault ) : idDeclEntity
name string
makeDefault bool
return idTech4.Text.Decl.idDeclEntity

FindEntityDefDict() public method

public FindEntityDefDict ( string name, bool makeDefault ) : idDict
name string
makeDefault bool
return idDict

FindEntityUsingDef() public method

Searches all active entities for the next one using the specified entityDef.
Searches beginning at the entity after from, or the beginning if NULL NULL will be returned if the end of the list is reached.
public FindEntityUsingDef ( idEntity from, string match ) : idEntity
from idEntity
match string
return idEntity

GetBestGameType() public method

public GetBestGameType ( string map, string gameType ) : string
map string
gameType string
return string

GetMapLoadingInterface() public method

public GetMapLoadingInterface ( string defaultInterface ) : string
defaultInterface string
return string

GetTimeGroupTime() public method

public GetTimeGroupTime ( int timeGroup ) : int
timeGroup int
return int

HandleGuiCommands() public method

public HandleGuiCommands ( string menuCommand ) : string
menuCommand string
return string

HandleMainMenuCommands() public method

public HandleMainMenuCommands ( string menuCommand, idUserInterface gui ) : void
menuCommand string
gui idTech4.UI.idUserInterface
return void

Init() public method

public Init ( ) : void
return void

InitFromNewMap() public method

public InitFromNewMap ( string mapName, idRenderWorld renderWorld, idSoundWorld soundWorld, bool isServer, bool isClient, int randomSeed ) : void
mapName string
renderWorld idTech4.Renderer.idRenderWorld
soundWorld idTech4.Sound.idSoundWorld
isServer bool
isClient bool
randomSeed int
return void

RegisterEntity() public method

public RegisterEntity ( idEntity entity ) : void
entity idEntity
return void

RunFrame() public method

public RunFrame ( idUserCommand userCommands ) : GameReturn
userCommands idTech4.Input.idUserCommand
return GameReturn

SelectInitialSpawnPoint() public method

spectators are spawned randomly anywhere. in-game clients are spawned based on distance to active players (randomized on the first half) upon map restart, initial spawns are used (randomized ordered list of spawns flagged "initial"). if there are more players than initial spots, overflow to regular spawning.
public SelectInitialSpawnPoint ( idPlayer player ) : idEntity
player idTech4.Game.Entities.idPlayer
return idEntity

SelectTimeGroup() public method

public SelectTimeGroup ( int timeGroup ) : void
timeGroup int
return void

ServerClientBegin() public method

public ServerClientBegin ( int clientIndex ) : void
clientIndex int
return void

ServerClientConnect() public method

public ServerClientConnect ( int clientIndex, string guid ) : void
clientIndex int
guid string
return void

ServerSendChatMessage() public method

public ServerSendChatMessage ( int to, string name, string text ) : void
to int
name string
text string
return void

SetLocalClient() public method

public SetLocalClient ( int clientIndex ) : void
clientIndex int
return void

SetPersistentPlayerInformation() public method

public SetPersistentPlayerInformation ( int clientIndex, idDict playerInfo ) : void
clientIndex int
playerInfo idDict
return void

SetServerInfo() public method

public SetServerInfo ( idDict serverInfo ) : void
serverInfo idDict
return void

SetUserInformation() public method

public SetUserInformation ( int clientIndex, idDict userInfo, bool isClient, bool canModify ) : idDict
clientIndex int
userInfo idDict
isClient bool
canModify bool
return idDict

SpawnEntityDef() public method

public SpawnEntityDef ( idDict args, bool setDefaults = true ) : idEntity
args idDict
setDefaults bool
return idEntity

SpawnPlayer() public method

public SpawnPlayer ( int clientIndex ) : void
clientIndex int
return void

idGame() public method

public idGame ( ) : System
return System