Debian Codegraph @

manage/robotpage.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef ROBOTPAGE_H
20 #define ROBOTPAGE_H
21
22 #include "manage.h"
23 #include "robot.h"
24 #include "cfile.h"
25 #include "pstypes.h"
26 #include "objinfo.h"
27
28 struct mngs_robot_page {
29 object_info robot_struct;
30 char image_name[PAGENAME_LEN];
31 };
32
33 // Robot page functions
34 //---------------------------------------------------------------
35
36 // Given an open file pointer and a robot_page struct, writes that robotpage out
37 void mng_WriteRobotPage(CFILE *outfile, mngs_robot_page *robotpage);
38
39 // Reads a robot page from an open file. Returns 0 on error.
40 int mng_ReadRobotPage(CFILE *infile, mngs_robot_page *robotpage);
41
42 // Given a robot handle, searches the table file and replaces the robot with the same name
43 // If local=1, then does it to the users local copy
44 // Returns 0 on error, else 1 if all is good
45 int mng_ReplaceRobotPage(char *name, int handle, int local);
46
47 // Given a robot name, finds it in the table file and deletes it
48 // If local is 1, deletes from the local table file
49 int mng_DeleteRobotPage(char *name, int local);
50
51 // Reads in the robotpage named "name" into robotpage struct
52 // Returns 0 on error or couldn't find, else 1 if all is good
53 int mng_FindSpecificRobotPage(char *name, mngs_robot_page *robotpage);
54
55 // Given a robot page, allocs a robot and calls AssignRobotPageToRobot to actually
56 // load model and values. Rturns robot handle on success, -1 if fail
57 int mng_SetAndLoadRobot(mngs_robot_page *robotpage);
58
59 // Given a robotpage and a robot handle, attempts to make robot n correspond to
60 // to the robotpage.
61 // Returns 1 on success, 0 otherwise
62 int mng_AssignRobotPageToRobot(mngs_robot_page *robotpage, int n);
63
64 // Copies values from a Robot into a robot_page
65 void mng_AssignRobotToRobotPage(int n, mngs_robot_page *robotpage);
66
67 // Reads in a robot page from the local table file, superseding any robot
68 // already in RAM with that same name
69 void mng_LoadLocalRobotPage(CFILE *);
70
71 // Reads in a page off the net
72 void mng_LoadNetRobotPage(CFILE *);
73
74 #endif