FS2_Open
Open source remastering of the Freespace 2 engine
parseobjectdock.h
Go to the documentation of this file.
1 /*
2  * Created by Ian "Goober5000" Warfield for the FreeSpace2 Source Code Project.
3  * You may not sell or otherwise commercially exploit the source or things you
4  * create based on the source.
5  */
6 
7 
8 
9 #ifndef _PARSE_OBJECT_DOCK_H
10 #define _PARSE_OBJECT_DOCK_H
11 
12 #include "globalincs/globals.h"
13 
14 class p_object;
15 
16 // info for each docked parse object
17 typedef struct p_dock_instance {
18  p_dock_instance *next; // next item in list
19 
20  char dockpoint_used[NAME_LENGTH]; // name of docking bay
21  p_object *docked_objp; // parse object that is docked to me
23 
24 // class used when a function must be evaluated for all docked objects
25 // (it's a class because it has a constructor)
27 {
28 public:
29 
30  // Set this to true when the function should return early.
32 
33  // The following were originally unions, but it became necessary to use structs
34  // for certain functions that need to maintain two or more values.
35  struct {
36  int int_value;
39 
40 
41  // constructor to initialize everything to 0
42  // (revised for the same reasons as dock_function_info)
44  : early_return_condition(false)
45  {
46  memset(&parameter_variables, 0, sizeof(parameter_variables));
47  memset(&maintained_variables, 0, sizeof(maintained_variables));
48  }
49 };
50 
52 
53 // check whether other_objp is directly docked to objp
55 
56 // find the object occupying objp's specified dockpoint
58 
59 // find objp's dockpoint being occupied by other_objp
61 
62 // Überfunction for evaluating all objects that could possibly be docked to objp. This will
63 // call "function" for each docked object. The function should store its intermediate and
64 // return values in the p_dock_function_info class.
66 
67 // docks all docked objects; called only from parse_create_object in missionparse.cpp
69 
70 // add objp1 and objp2 to each others' dock lists; currently only called by mission_parse_set_up_initial_docks
71 void dock_dock_objects(p_object *objp1, char *dockpoint1, p_object *objp2, char *dockpoint2);
72 
73 // free the entire dock list without undocking anything; should only be used on object cleanup
74 void dock_free_dock_list(p_object *objp);
75 
76 #endif // _PARSE_OBJECT_DOCK_H
bool object_is_docked(p_object *objp)
void dock_dock_docked_objects(p_object *objp)
p_dock_instance * next
p_object * dock_find_object_at_dockpoint(p_object *objp, char *dockpoint)
object * objp
Definition: lua.cpp:3105
char * dock_find_dockpoint_used_by_object(p_object *objp, p_object *other_objp)
p_object * docked_objp
void dock_free_dock_list(p_object *objp)
struct p_dock_instance p_dock_instance
#define NAME_LENGTH
Definition: globals.h:15
struct p_dock_function_info::@259 parameter_variables
struct p_dock_function_info::@259 maintained_variables
char dockpoint_used[NAME_LENGTH]
void dock_evaluate_all_docked_objects(p_object *objp, p_dock_function_info *infop, void(*function)(p_object *, p_dock_function_info *))
bool dock_check_find_direct_docked_object(p_object *objp, p_object *other_objp)
void dock_dock_objects(p_object *objp1, char *dockpoint1, p_object *objp2, char *dockpoint2)
false
Definition: lua.cpp:6789