Untangling ship queues: update the current state of affairs

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2783 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2007-06-25 21:38:31 +00:00
parent 51192258e7
commit 099f71107e
+9 -14
View File
@@ -3,34 +3,31 @@ The various ship queues used in the game:
GlobData.Game_state.avail_race_q: GlobData.Game_state.avail_race_q:
Contains all the ships from the enum from races.h that defines Contains all the ships from the enum from races.h that defines
NUM_AVAILABLE_RACES. NUM_AVAILABLE_RACES.
Elements are of type EXTENDED_SHIP_FRAGMENT. Elements are of type EXTENDED_SHIP_FRAGMENT (to become FLEET_INFO).
It contains information about the various races, not really about It contains information about the various races, not really about
specific ships. specific ships.
Filled in InitSIS(). Filled in InitSIS().
RaceDescPtr is an actual pointer, but to EXTENDED_SHIP_INFO
and not RACE_DESC
Partially included in savegames. Partially included in savegames.
GlobData.Game_state.built_ship_q: GlobData.Game_state.built_ship_q:
The fleet accompanying the flagship. The fleet accompanying the flagship.
Elements are of type SHIP_FRAGMENT. Elements are of type SHIP_FRAGMENT.
RaceDescPtr is abused to store the captain's name index. which_side is always GOOD_GUY here.
and the side that this ship is on (always GOOD_GUY here).
Partially included in savegames. Partially included in savegames.
master_q: master_q:
Queue of all the ships that exist in the game. Queue of all the ships that exist in the game.
Elements are of type SHIP_FRAGMENT. Elements are of type SHIP_FRAGMENT (to become MASTER_SHIP_INFO).
Sorted on the (abbreviated) race name (see doc/racestrings). Sorted on the (abbreviated) race name (see doc/racestrings).
Filled in LoadMasterShipList(). Filled in LoadMasterShipList().
RaceDescPtr is an actual pointer, but to SHIP_INFO and not RACE_DESC
GlobData.Game_state.npc_built_ship_q: GlobData.Game_state.npc_built_ship_q:
The npc ships in an encounter. Empty when not in an encounter. The npc ships in an encounter, or list of ship groups when in IP;
Elements are of type SHIP_FRAGMENT. empty otherwise.
Elements are of type SHIP_FRAGMENT. IP group list will most likely
change to contain GROUP_INFO instead.
For encounters with an infinite number of ships, the queue consists For encounters with an infinite number of ships, the queue consists
of a single ship with ShipInfo.crew_level set to (BYTE)~0. of a single ship with ShipInfo.crew_level set to (BYTE)~0.
RaceDescPtr is abused to store the captain's name index.
and the side that this ship is on. and the side that this ship is on.
Partially included in savegames. Partially included in savegames.
@@ -38,10 +35,8 @@ race_q[NUM_PLAYERS]:
Contains the ships participating in a battle for each player. Contains the ships participating in a battle for each player.
Elements are of type STARSHIP. Elements are of type STARSHIP.
Filled in BuildBattle(). Filled in BuildBattle().
RaceDescPtr is abused to store the captain's name index, RaceDescPtr points to a loaded ship's descriptor once the ship data
until the ship is loaded in spawn_ship(), at which time is loaded in spawn_ship(); NULL otherwise.
it becomes an actual pointer to RACE_DESC.
and the side that this ship is on.
Other queues: Other queues: