| 1 |
// |
| 2 |
// Copyright(C) 2022 by Ryan Krafnick |
| 3 |
// |
| 4 |
// This program is free software; you can redistribute it and/or |
| 5 |
// modify it under the terms of the GNU General Public License |
| 6 |
// as published by the Free Software Foundation; either version 2 |
| 7 |
// of the License, or (at your option) any later version. |
| 8 |
// |
| 9 |
// This program is distributed in the hope that it will be useful, |
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
// GNU General Public License for more details. |
| 13 |
// |
| 14 |
// DESCRIPTION: |
| 15 |
// DSDA Thing ID |
| 16 |
// |
| 17 |
|
| 18 |
#ifndef __DSDA_THING_ID__ |
| 19 |
#define __DSDA_THING_ID__ |
| 20 |
|
| 21 |
#include "p_mobj.h" |
| 22 |
|
| 23 |
typedef struct thing_id_list_entry_s { |
| 24 |
mobj_t* mo; |
| 25 |
struct thing_id_list_entry_s* next; |
| 26 |
} thing_id_list_entry_t; |
| 27 |
|
| 28 |
typedef struct { |
| 29 |
dboolean done; |
| 30 |
struct thing_id_list_entry_s* start; |
| 31 |
} thing_id_search_t; |
| 32 |
|
| 33 |
typedef struct thing_id_list_s { |
| 34 |
short thing_id; |
| 35 |
struct thing_id_list_entry_s* first; |
| 36 |
struct thing_id_list_entry_s* last; |
| 37 |
struct thing_id_list_s* next; |
| 38 |
} thing_id_list_t; |
| 39 |
|
| 40 |
void dsda_AddMobjThingID(mobj_t* mo, short thing_id); |
| 41 |
void dsda_RemoveMobjThingID(mobj_t* mo); |
| 42 |
void dsda_BuildMobjThingIDList(void); |
| 43 |
void dsda_ResetThingIDSearch(thing_id_search_t* search); |
| 44 |
mobj_t* dsda_FindMobjFromThingID(short thing_id, thing_id_search_t* search); |
| 45 |
mobj_t* dsda_FindMobjFromThingIDOrMobj(short thing_id, mobj_t* mo, thing_id_search_t* search); |
| 46 |
|
| 47 |
#endif |