| 1 |
/*************************************************************************** |
| 2 |
* Copyright (C) 2005-2019 by the FIFE team * |
| 3 |
* http://www.fifengine.net * |
| 4 |
* This file is part of FIFE. * |
| 5 |
* * |
| 6 |
* FIFE is free software; you can redistribute it and/or * |
| 7 |
* modify it under the terms of the GNU Lesser General Public * |
| 8 |
* License as published by the Free Software Foundation; either * |
| 9 |
* version 2.1 of the License, or (at your option) any later version. * |
| 10 |
* * |
| 11 |
* This library is distributed in the hope that it will be useful, * |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
| 14 |
* Lesser General Public License for more details. * |
| 15 |
* * |
| 16 |
* You should have received a copy of the GNU Lesser General Public * |
| 17 |
* License along with this library; if not, write to the * |
| 18 |
* Free Software Foundation, Inc., * |
| 19 |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * |
| 20 |
***************************************************************************/ |
| 21 |
|
| 22 |
%module fife |
| 23 |
%{ |
| 24 |
#include "model/structures/cellcache.h" |
| 25 |
%} |
| 26 |
|
| 27 |
namespace FIFE { |
| 28 |
|
| 29 |
class Cell; |
| 30 |
class Layer; |
| 31 |
|
| 32 |
class CellCache : public FifeClass { |
| 33 |
public: |
| 34 |
CellCache(Layer* layer); |
| 35 |
~CellCache(); |
| 36 |
|
| 37 |
void createCells(); |
| 38 |
void forceUpdate(); |
| 39 |
void addCell(Cell* cell); |
| 40 |
Cell* createCell(const ModelCoordinate& mc); |
| 41 |
Cell* getCell(const ModelCoordinate& mc); |
| 42 |
void addInteractOnRuntime(Layer* interact); |
| 43 |
void removeInteractOnRuntime(Layer* interact); |
| 44 |
const Rect& getSize(); |
| 45 |
void setSize(const Rect& rec); |
| 46 |
uint32_t getWidth(); |
| 47 |
uint32_t getHeight(); |
| 48 |
int32_t getMaxIndex() const; |
| 49 |
void setMaxNeighborZ(int32_t z); |
| 50 |
int32_t getMaxNeighborZ(); |
| 51 |
|
| 52 |
bool isInCellCache(const Location& location) const; |
| 53 |
|
| 54 |
std::vector<Cell*> getCellsInLine(const ModelCoordinate& pt1, const ModelCoordinate& pt2, bool blocker = false); |
| 55 |
std::vector<Cell*> getCellsInRect(const Rect& rec); |
| 56 |
std::vector<Cell*> getCellsInCircle(const ModelCoordinate& center, uint16_t radius); |
| 57 |
std::vector<Cell*> getCellsInCircleSegment(const ModelCoordinate& center, uint16_t radius, int32_t sangle, int32_t eangle); |
| 58 |
|
| 59 |
void registerCost(const std::string& costId, double cost); |
| 60 |
void unregisterCost(const std::string& costId); |
| 61 |
double getCost(const std::string& costId); |
| 62 |
bool existsCost(const std::string& costId); |
| 63 |
std::list<std::string> getCosts(); |
| 64 |
void unregisterAllCosts(); |
| 65 |
void addCellToCost(const std::string& costId, Cell* cell); |
| 66 |
void addCellsToCost(const std::string& costId, const std::vector<Cell*>& cells); |
| 67 |
void removeCellFromCost(Cell* cell); |
| 68 |
void removeCellFromCost(const std::string& costId, Cell* cell); |
| 69 |
void removeCellsFromCost(const std::string& costId, const std::vector<Cell*>& cells); |
| 70 |
std::vector<Cell*> getCostCells(const std::string& costId); |
| 71 |
std::vector<std::string> getCellCosts(Cell* cell); |
| 72 |
bool existsCostForCell(const std::string& costId, Cell* cell); |
| 73 |
|
| 74 |
void setDefaultCostMultiplier(double multi); |
| 75 |
double getDefaultCostMultiplier(); |
| 76 |
void setDefaultSpeedMultiplier(double multi); |
| 77 |
double getDefaultSpeedMultiplier(); |
| 78 |
|
| 79 |
void addCellToArea(const std::string& id, Cell* cell); |
| 80 |
void addCellsToArea(const std::string& id, const std::vector<Cell*>& cells); |
| 81 |
void removeCellFromArea(const std::string& id, Cell* cell); |
| 82 |
void removeCellsFromArea(const std::string& id, const std::vector<Cell*>& cells); |
| 83 |
void removeArea(const std::string& id); |
| 84 |
bool existsArea(const std::string& id); |
| 85 |
std::vector<std::string> getAreas(); |
| 86 |
std::vector<std::string> getCellAreas(Cell* cell); |
| 87 |
std::vector<Cell*> getAreaCells(const std::string& id); |
| 88 |
bool isCellInArea(const std::string& id, Cell* cell); |
| 89 |
void setStaticSize(bool staticSize); |
| 90 |
bool isStaticSize(); |
| 91 |
}; |
| 92 |
} |