MainDataStructures in Game

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
User avatar
Adamant
Space Kraken
Posts: 101
Joined: Mon Jan 06, 2014 3:33 pm

MainDataStructures in Game

#1 Post by Adamant »

Is there one or multiple basic DataStructures for Game like

class Game {
StarMap*;
Players*;
...
}

if these are lesser clear grouped (they have to exist anyway as there exist Idea of a Game)
what DataStructure Type do these use?

* Array
* Vector
* LinkedList
* Graph as complex Linked-List like DataStructure??
* BTree
* ..

Basing on idea of Level/Scope Game, what Entities exist and what ComplexTypes are used for them?

eg
Player players[8]; // for plain Array of Players
Pure Cyan harms PhotoReceptors doubtless - even half Portion appears mysterious.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: MainDataStructures in Game

#2 Post by Dilvish »

That code is in the "server" subdirectory, mostly in "Server.cpp" and "ServerFSM.cpp". There are some game_setup_data and _player_setup_data structures; my recollection is that the list of players is kept as an std::vector
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply