std::vector<Coordinates>::iterator rangeIt;
this->sight.clear();
this->position.GetRoundRange(rangeVec, 0, 12);
- //std::for_each(rangeVec.begin(), rangeVec.end(), [&](const Coordinates r) { this->lore.GetFieldLore(0, r->GetX(), r.GetY()); });
for(rangeIt = rangeVec.begin(); rangeIt != rangeVec.end(); rangeIt++)
{
if(fieldPtr->HaveSight(this->position.GetX(), this->position.GetY(), rangeIt->GetX(), rangeIt->GetY()))
return true;
}
+ void Field::UpdateSight(void)
+ {
+ int x, y;
+ this->sightPass.resize((this->width * 2 + 1) * (this->height * 2 + 1));
+ this->physicalPass.resize((this->width * 2 + 1) * (this->height * 2 + 1));
+
+ for(y = 1; y < this->height * 2 + 1; y += 2)
+ {
+ for(x = 1; x < this->width * 2 + 1; x += 2)
+ {
+ this->sightPass[y * this->width + x] = (this->GetSquare(x / 2, y / 2)->GetFloorTag() == "VANILLA_PERMANENT_WALL");
+ this->physicalPass[y * this->width + x] = (this->GetSquare(x / 2, y / 2)->GetFloorTag() == "VANILLA_PERMANENT_WALL");
+ }
+ }
+ }
+
bool Field::HaveSight(int bx, int by, int tx, int ty)
{
std::vector<Coordinates> coordVec;
std::vector<boost::shared_ptr<Door>> doors; //!<\83h\83A\83C\83\93\83X\83^\83\93\83X\82Ì\94z\97ñ
std::vector<boost::shared_ptr<Trap>> traps; //!<\83g\83\89\83b\83v\83C\83\93\83X\83^\83\93\83X\82Ì\94z\97ñ
std::vector<boost::shared_ptr<Item>> items; //!<\83A\83C\83e\83\80\83C\83\93\83X\83^\83\93\83X\82Ì\94z\97ñ
+
+ std::vector<bool> sightPass; //!< \8el\8b÷\8e\8b\8ao\92Ê\89ß\83t\83\89\83O
+ std::vector<bool> physicalPass; //!< \8el\8b÷\95¨\97\9d\92Ê\89ß\83t\83\89\83O
+
MAP_LENGTH width; //!< \83t\83\8d\83A\82Ì\89¡\83T\83C\83Y
MAP_LENGTH height; //!< \83t\83\8d\83A\82Ì\8fc\83T\83C\83Y
bool generated; //!< \83t\83\8d\83A\90¶\90¬\8dÏ\82Ý
*/
bool Field::HaveSight(int bx, int by, int tx, int ty);
+ /*!
+ * @brief \8e\8b\8aE\94»\92è\8aî\8f\80\82Ì\82½\82ß\82Ì\8el\8b÷\83t\83\89\83O\82ð\91S\82Ä\8dX\90V\82·\82é\81B
+ * @return \82È\82µ
+ */
+ void Field::UpdateSight(void);
+
};
}