|
| 1 | +#ifndef unnatural_uwapi_components_h_dxc2f4hz8werz |
| 2 | +#define unnatural_uwapi_components_h_dxc2f4hz8werz |
| 3 | + |
| 4 | +#include "common.h" |
| 5 | + |
| 6 | +#ifdef __cplusplus |
| 7 | +extern "C" |
| 8 | +{ |
| 9 | +#endif |
| 10 | + |
| 11 | +#ifdef UNNATURAL_BOTS |
| 12 | + typedef struct UwEntity UwEntity; |
| 13 | + typedef UwEntity *UwEntityPtr; |
| 14 | + UNNATURAL_API UwEntityPtr uwEntityPointer(uint32 id); |
| 15 | + UNNATURAL_API uint32 uwEntityId(UwEntityPtr entity); |
| 16 | + UNNATURAL_API void uwModifiedEntities(UwIds *data); |
| 17 | +#endif |
| 18 | + |
| 19 | +#ifdef UNNATURAL_SCRIPTS |
| 20 | + typedef uint32 UwEntityPtr; |
| 21 | +#endif |
| 22 | + |
| 23 | + UNNATURAL_API void uwAllEntities(UwIds *data); |
| 24 | + UNNATURAL_API bool uwEntityExists(uint32 id); |
| 25 | + |
| 26 | + typedef struct UwProtoComponent |
| 27 | + { |
| 28 | + uint32 proto; |
| 29 | + } UwProtoComponent; |
| 30 | + UNNATURAL_API bool uwFetchProtoComponent(UwEntityPtr entity, UwProtoComponent *data); |
| 31 | + |
| 32 | + typedef struct UwOwnerComponent |
| 33 | + { |
| 34 | + uint32 force; |
| 35 | + } UwOwnerComponent; |
| 36 | + UNNATURAL_API bool uwFetchOwnerComponent(UwEntityPtr entity, UwOwnerComponent *data); |
| 37 | + |
| 38 | + typedef struct UwControllerComponent |
| 39 | + { |
| 40 | + uint32 player; |
| 41 | + uint32 timestamp; |
| 42 | + } UwControllerComponent; |
| 43 | + UNNATURAL_API bool uwFetchControllerComponent(UwEntityPtr entity, UwControllerComponent *data); |
| 44 | + |
| 45 | + typedef struct UwPositionComponent |
| 46 | + { |
| 47 | + uint32 position; |
| 48 | + float yaw; |
| 49 | + } UwPositionComponent; |
| 50 | + UNNATURAL_API bool uwFetchPositionComponent(UwEntityPtr entity, UwPositionComponent *data); |
| 51 | + |
| 52 | + typedef enum UwUnitStateFlags |
| 53 | + { |
| 54 | + UwUnitStateFlags_None = 0, |
| 55 | + UwUnitStateFlags_Shooting = 1 << 0, |
| 56 | + UwUnitStateFlags_Processing = 1 << 1, // processing recipe |
| 57 | + UwUnitStateFlags_Rebuilding = 1 << 2, // changing recipe |
| 58 | + UwUnitStateFlags_Stalling = 1 << 3, // usually due to maximumProcessingOutput |
| 59 | + } UwUnitStateFlags; |
| 60 | + typedef struct UwUnitComponent |
| 61 | + { |
| 62 | + UwUnitStateFlags state; |
| 63 | + uint32 killCount; |
| 64 | + } UwUnitComponent; |
| 65 | + UNNATURAL_API bool uwFetchUnitComponent(UwEntityPtr entity, UwUnitComponent *data); |
| 66 | + |
| 67 | + typedef struct UwLifeComponent |
| 68 | + { |
| 69 | + sint32 life; |
| 70 | + } UwLifeComponent; |
| 71 | + UNNATURAL_API bool uwFetchLifeComponent(UwEntityPtr entity, UwLifeComponent *data); |
| 72 | + |
| 73 | + typedef struct UwMoveComponent |
| 74 | + { |
| 75 | + uint32 posStart; |
| 76 | + uint32 posEnd; |
| 77 | + uint32 tickStart; |
| 78 | + uint32 tickEnd; |
| 79 | + float yawStart; |
| 80 | + float yawEnd; |
| 81 | + } UwMoveComponent; |
| 82 | + UNNATURAL_API bool uwFetchMoveComponent(UwEntityPtr entity, UwMoveComponent *data); |
| 83 | + |
| 84 | + typedef struct UwAimComponent |
| 85 | + { |
| 86 | + uint32 target; |
| 87 | + } UwAimComponent; |
| 88 | + UNNATURAL_API bool uwFetchAimComponent(UwEntityPtr entity, UwAimComponent *data); |
| 89 | + |
| 90 | + typedef struct UwRecipeComponent |
| 91 | + { |
| 92 | + uint32 recipe; |
| 93 | + } UwRecipeComponent; |
| 94 | + UNNATURAL_API bool uwFetchRecipeComponent(UwEntityPtr entity, UwRecipeComponent *data); |
| 95 | + |
| 96 | + typedef struct UwUpdateTimestampComponent |
| 97 | + { |
| 98 | + uint32 timestamp; |
| 99 | + } UwUpdateTimestampComponent; |
| 100 | + UNNATURAL_API bool uwFetchUpdateTimestampComponent(UwEntityPtr entity, UwUpdateTimestampComponent *data); |
| 101 | + |
| 102 | + typedef struct UwRecipeStatisticsComponent |
| 103 | + { |
| 104 | + uint32 timestamps[3]; |
| 105 | + uint32 completed; |
| 106 | + } UwRecipeStatisticsComponent; |
| 107 | + UNNATURAL_API bool uwFetchRecipeStatisticsComponent(UwEntityPtr entity, UwRecipeStatisticsComponent *data); |
| 108 | + |
| 109 | + typedef struct UwPriorityComponent |
| 110 | + { |
| 111 | + UwPriorityEnum priority; |
| 112 | + } UwPriorityComponent; |
| 113 | + UNNATURAL_API bool uwFetchPriorityComponent(UwEntityPtr entity, UwPriorityComponent *data); |
| 114 | + |
| 115 | + typedef struct UwAmountComponent |
| 116 | + { |
| 117 | + uint32 amount; |
| 118 | + } UwAmountComponent; |
| 119 | + UNNATURAL_API bool uwFetchAmountComponent(UwEntityPtr entity, UwAmountComponent *data); |
| 120 | + |
| 121 | + typedef struct UwAttachmentComponent |
| 122 | + { |
| 123 | + uint32 target; |
| 124 | + } UwAttachmentComponent; |
| 125 | + UNNATURAL_API bool uwFetchAttachmentComponent(UwEntityPtr entity, UwAttachmentComponent *data); |
| 126 | + |
| 127 | + typedef enum UwPlayerStateFlags |
| 128 | + { |
| 129 | + UwPlayerStateFlags_None = 0, |
| 130 | + UwPlayerStateFlags_Loaded = 1 << 0, |
| 131 | + UwPlayerStateFlags_Pause = 1 << 1, |
| 132 | + UwPlayerStateFlags_Disconnected = 1 << 2, |
| 133 | + UwPlayerStateFlags_Admin = 1 << 3, |
| 134 | + } UwPlayerStateFlags; |
| 135 | + typedef enum UwPlayerConnectionClassEnum |
| 136 | + { |
| 137 | + UwPlayerConnectionClassEnum_None = 0, |
| 138 | + UwPlayerConnectionClassEnum_Computer = 1, |
| 139 | + UwPlayerConnectionClassEnum_VirtualReality = 2, |
| 140 | + UwPlayerConnectionClassEnum_Robot = 3, |
| 141 | + UwPlayerConnectionClassEnum_UwApi = 4, |
| 142 | + } UwPlayerConnectionClassEnum; |
| 143 | + typedef struct UwPlayerComponent |
| 144 | + { |
| 145 | + char name[28]; |
| 146 | + uint32 nameLength; |
| 147 | + uint64 steamUserId; |
| 148 | + uint32 force; |
| 149 | + float progress; |
| 150 | + uint32 ping; |
| 151 | + UwPlayerStateFlags state; |
| 152 | + UwPlayerConnectionClassEnum playerConnectionClass; |
| 153 | + } UwPlayerComponent; |
| 154 | + UNNATURAL_API bool uwFetchPlayerComponent(UwEntityPtr entity, UwPlayerComponent *data); |
| 155 | + |
| 156 | + typedef enum UwForceStateFlags |
| 157 | + { |
| 158 | + UwForceStateFlags_None = 0, |
| 159 | + UwForceStateFlags_Winner = 1 << 0, |
| 160 | + UwForceStateFlags_Defeated = 1 << 1, |
| 161 | + UwForceStateFlags_Disconnected = 1 << 2, |
| 162 | + } UwForceStateFlags; |
| 163 | + typedef struct UwForceComponent |
| 164 | + { |
| 165 | + float color[3]; |
| 166 | + uint64 score; |
| 167 | + uint32 killCount; |
| 168 | + uint32 lossCount; |
| 169 | + uint32 finishTimestamp; |
| 170 | + uint32 intendedTeam; |
| 171 | + uint32 intendedRace; |
| 172 | + UwForceStateFlags state; |
| 173 | + } UwForceComponent; |
| 174 | + UNNATURAL_API bool uwFetchForceComponent(UwEntityPtr entity, UwForceComponent *data); |
| 175 | + |
| 176 | + typedef struct UwForceDetailsComponent |
| 177 | + { |
| 178 | + uint64 killValue; |
| 179 | + uint64 lossValue; |
| 180 | + uint32 startingPosition; |
| 181 | + uint32 race; |
| 182 | + } UwForceDetailsComponent; |
| 183 | + UNNATURAL_API bool uwFetchForceDetailsComponent(UwEntityPtr entity, UwForceDetailsComponent *data); |
| 184 | + |
| 185 | + typedef struct UwForeignPolicyComponent |
| 186 | + { |
| 187 | + uint32 forces[2]; |
| 188 | + UwForeignPolicyEnum policy; |
| 189 | + } UwForeignPolicyComponent; |
| 190 | + UNNATURAL_API bool uwFetchForeignPolicyComponent(UwEntityPtr entity, UwForeignPolicyComponent *data); |
| 191 | + |
| 192 | + typedef struct UwDiplomacyProposalComponent |
| 193 | + { |
| 194 | + uint32 offeror; |
| 195 | + uint32 offeree; |
| 196 | + UwForeignPolicyEnum proposal; |
| 197 | + } UwDiplomacyProposalComponent; |
| 198 | + UNNATURAL_API bool uwFetchDiplomacyProposalComponent(UwEntityPtr entity, UwDiplomacyProposalComponent *data); |
| 199 | + |
| 200 | +#ifdef __cplusplus |
| 201 | +} // extern C |
| 202 | +#endif |
| 203 | + |
| 204 | +#endif // unnatural_uwapi_components_h_dxc2f4hz8werz |
0 commit comments