| 1 | /* |
| 2 | * LegacyClonk |
| 3 | * |
| 4 | * Copyright (c) 1998-2000, Matthes Bender (RedWolf Design) |
| 5 | * Copyright (c) 2017-2019, The LegacyClonk Team and contributors |
| 6 | * |
| 7 | * Distributed under the terms of the ISC license; see accompanying file |
| 8 | * "COPYING" for details. |
| 9 | * |
| 10 | * "Clonk" is a registered trademark of Matthes Bender, used with permission. |
| 11 | * See accompanying file "TRADEMARK" for details. |
| 12 | * |
| 13 | * To redistribute this file separately, substitute the full license texts |
| 14 | * for the above references. |
| 15 | */ |
| 16 | |
| 17 | /* Special regions to extend the pathfinder */ |
| 18 | |
| 19 | #pragma once |
| 20 | |
| 21 | #include "C4ForwardDeclarations.h" |
| 22 | |
| 23 | #include <cstdint> |
| 24 | |
| 25 | class C4TransferZones; |
| 26 | |
| 27 | class C4TransferZone |
| 28 | { |
| 29 | friend class C4TransferZones; |
| 30 | |
| 31 | public: |
| 32 | C4TransferZone(); |
| 33 | ~C4TransferZone(); |
| 34 | |
| 35 | public: |
| 36 | C4Object *Object; |
| 37 | int32_t X, Y, Wdt, Hgt; |
| 38 | bool Used; |
| 39 | |
| 40 | protected: |
| 41 | C4TransferZone *Next; |
| 42 | |
| 43 | public: |
| 44 | bool GetEntryPoint(int32_t &rX, int32_t &rY, int32_t iToX, int32_t iToY); |
| 45 | void Draw(C4FacetEx &cgo, bool fHighlight = false); |
| 46 | void Default(); |
| 47 | void Clear(); |
| 48 | bool At(int32_t iX, int32_t iY); |
| 49 | }; |
| 50 | |
| 51 | class C4TransferZones |
| 52 | { |
| 53 | public: |
| 54 | C4TransferZones(); |
| 55 | ~C4TransferZones(); |
| 56 | |
| 57 | protected: |
| 58 | int32_t RemoveNullZones(); |
| 59 | C4TransferZone *First; |
| 60 | |
| 61 | public: |
| 62 | void Default(); |
| 63 | void Clear(); |
| 64 | void ClearUsed(); |
| 65 | void ClearPointers(C4Object *pObj); |
| 66 | void Draw(C4FacetEx &cgo); |
| 67 | void Synchronize(); |
| 68 | C4TransferZone *Find(C4Object *pObj); |
| 69 | C4TransferZone *Find(int32_t iX, int32_t iY); |
| 70 | bool Add(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, C4Object *pObj); |
| 71 | bool Set(int32_t iX, int32_t iY, int32_t iWdt, int32_t iHgt, C4Object *pObj); |
| 72 | }; |
| 73 | |