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